00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkBinaryMedialNodeMetric.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:28 $ 00007 Version: $Revision: 1.2 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkBinaryMedialNodeMetric_h 00018 #define __itkBinaryMedialNodeMetric_h 00019 00020 #include "itkLightObject.h" 00021 00022 #include "vnl/vnl_vector_fixed.h" 00023 #include "itkBloxCoreAtomPixel.h" 00024 00025 namespace itk 00026 { 00027 00036 template <int VDimensions> 00037 class BinaryMedialNodeMetric : public LightObject 00038 { 00039 public: 00040 00042 typedef BinaryMedialNodeMetric Self; 00043 typedef LightObject Superclass; 00044 typedef SmartPointer<Self> Pointer; 00045 typedef SmartPointer<const Self> ConstPointer; 00046 00048 itkNewMacro(Self); 00049 00053 itkStaticConstMacro(EMPTY, int, 2); 00054 00056 itkTypeMacro(BinaryMedialNodeMetric, LightObject); 00057 00059 typedef BloxCoreAtomPixel<VDimensions> MedialNode; 00060 00062 typedef Point<double, VDimensions> PositionType; 00063 00065 void Initialize(void); 00066 00068 void SetMedialNodes(MedialNode * NodeA1, MedialNode * NodeA2, MedialNode * NodeB1, MedialNode * NodeB2); 00069 00071 void PrintCombinedEigens(); 00072 00074 void ShowCalculation(){m_ShowCalc = true;} 00075 00077 void DontShowCalculation(){m_ShowCalc = false;} 00078 00080 double GetResult(){return m_Result;} 00081 //itkSetMacro(Result, double); 00082 //itkGetMacro(Result, double); 00083 00084 00085 protected: 00087 BinaryMedialNodeMetric(); 00088 00090 ~BinaryMedialNodeMetric() {}; 00091 00092 void PrintSelf(std::ostream& os, Indent indent) const; 00093 00094 private: 00095 00097 void OrderValues(); 00098 00100 double m_CombinedEigenValues[VDimensions*2]; 00101 double m_CombinedDistanceValues[VDimensions*2]; 00102 00104 int m_CombinedEigensKey[VDimensions*2]; 00105 00107 MedialNode * m_NodeA1; 00108 MedialNode * m_NodeA2; 00109 00111 MedialNode * m_NodeB1; 00112 MedialNode * m_NodeB2; 00113 00115 typename MedialNode::EigenvalueType m_EigenA; 00116 typename MedialNode::EigenvalueType m_EigenB; 00117 00119 PositionType m_DistanceVectorA; 00120 PositionType m_DistanceVectorB; 00121 00123 double m_Result; 00124 00126 bool m_ShowCalc; 00127 }; 00128 00129 } // end namespace itk 00130 00131 #ifndef ITK_MANUAL_INSTANTIATION 00132 #include "itkBinaryMedialNodeMetric.txx" 00133 #endif 00134 00135 #endif 00136 00137 00138