00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkBinaryMedialNodeMetric.h,v $ 00005 Language: C++ 00006 Date: $Date: 2010-06-23 17:48:14 $ 00007 Version: $Revision: 1.7 $ 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 "itkObjectFactory.h" 00021 #include "itkLightObject.h" 00022 #include "itkBloxCoreAtomPixel.h" 00023 00024 namespace itk 00025 { 00026 00035 template <int VDimensions> 00036 class ITK_EXPORT BinaryMedialNodeMetric : public LightObject 00037 { 00038 public: 00039 00041 typedef BinaryMedialNodeMetric Self; 00042 typedef LightObject Superclass; 00043 typedef SmartPointer<Self> Pointer; 00044 typedef SmartPointer<const Self> ConstPointer; 00045 00047 itkNewMacro(Self); 00048 00052 itkStaticConstMacro(EMPTY, int, 2); 00053 00055 itkTypeMacro(BinaryMedialNodeMetric, LightObject); 00056 00058 typedef BloxCoreAtomPixel<VDimensions> MedialNode; 00059 00061 typedef Point<double, VDimensions> PositionType; 00062 00064 void Initialize(void); 00065 00067 void SetMedialNodes(MedialNode * NodeA1, MedialNode * NodeA2, MedialNode * NodeB1, MedialNode * NodeB2); 00068 00070 void PrintCombinedEigens(); 00071 00073 void ShowCalculation(){m_ShowCalc = true;} 00074 00076 void DontShowCalculation(){m_ShowCalc = false;} 00077 00079 double GetResult(){return m_Result;} 00080 //itkSetMacro(Result, double); 00081 //itkGetConstMacro(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