00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMedialNodePairCorrespondenceProcess.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/11/22 17:45:48 $ 00007 Version: $Revision: 1.4 $ 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 __itkMedialNodePairCorrespondenceProcess_h 00018 #define __itkMedialNodePairCorrespondenceProcess_h 00019 00020 #include "itkImage.h" 00021 #include "itkProcessObject.h" 00022 #include "itkDataObject.h" 00023 #include "itkBloxCoreAtomImage.h" 00024 #include "itkBloxCoreAtomPixel.h" 00025 #include "itkMatrixResizeableDataObject.h" 00026 #include "itkBinaryMedialNodeMetric.h" 00027 00028 #include "itkCorrespondenceDataStructure.h" 00029 #include "itkSecondaryNodeList.h" 00030 #include "itkCorrespondingList.h" 00031 #include "itkCorrespondingMedialNodeClique.h" 00032 #include "itkCorrespondenceDataStructureIterator.h" 00033 00034 namespace itk 00035 { 00036 00045 template< typename TSourceImage > 00046 class MedialNodePairCorrespondenceProcess : public ProcessObject 00047 { 00048 public: 00050 itkStaticConstMacro(NDimensions, unsigned int, TSourceImage::ImageDimension); 00051 00053 typedef MedialNodePairCorrespondenceProcess Self; 00054 typedef ProcessObject Superclass; 00055 typedef SmartPointer<Self> Pointer; 00056 typedef SmartPointer<const Self> ConstPointer; 00057 00059 typedef DataObject::Pointer DataObjectPointer; 00060 00062 itkNewMacro(Self); 00063 00065 itkTypeMacro(MedialNodePairCorrespondenceProcess, ProcessObject); 00066 00068 typedef TSourceImage CoreAtomImageType; 00069 typedef typename CoreAtomImageType::Pointer CoreAtomImagePointer; 00070 typedef typename CoreAtomImageType::RegionType CoreAtomImageRegionType; 00071 typedef typename CoreAtomImageType::PixelType CoreAtomImagePixelType; 00072 typedef typename CoreAtomImageType::ConstPointer CoreAtomImageConstPointer; 00073 00075 typedef MatrixResizeableDataObject<double> DistanceMatrixType; 00076 typedef typename DistanceMatrixType::Pointer DistanceMatrixPointer; 00077 00079 typedef MatrixResizeableDataObject<double> CorrespondenceMatrixType; 00080 typedef typename CorrespondenceMatrixType::Pointer CorrespondenceMatrixPointer; 00081 00083 typedef CorrespondingMedialNodeClique<itkGetStaticConstMacro(NDimensions),2> NodeType; 00084 typedef CorrespondenceDataStructure<NodeType,2> DataStructureType; 00085 typedef typename CorrespondenceDataStructure<NodeType,2>::Pointer DataStructurePointerType; 00086 typedef CorrespondenceDataStructureIterator<DataStructureType> IteratorType; 00087 00089 typedef BinaryMedialNodeMetric<itkGetStaticConstMacro(NDimensions)> BinaryMetricType; 00090 typedef typename BinaryMedialNodeMetric<itkGetStaticConstMacro(NDimensions)>::Pointer BinaryMetricPointer; 00091 00093 typedef BloxCoreAtomPixel<itkGetStaticConstMacro(NDimensions)> MedialNodeType; 00094 00096 typedef Point<double, itkGetStaticConstMacro(NDimensions)> PositionType; 00097 00099 DataStructureType * GetOutput(void); 00100 DataStructureType * GetOutput(unsigned int idx); 00101 00102 /* This is important to note...the inputs for this process are somewhat 00103 complicated, and there are a lot of them. You need all 5 inputs for 00104 this process to perform its task */ 00105 00107 void SetCoreAtomImageA( const CoreAtomImageType * CoreAtomImageA ); 00108 00110 void SetCoreAtomImageB( const CoreAtomImageType * CoreAtomImageB ); 00111 00113 void SetDistanceMatrixA( const DistanceMatrixType * DistanceMatrixA ); 00114 00116 void SetDistanceMatrixB( const DistanceMatrixType * DistanceMatrixB ); 00117 00119 int GetNumberOfNodePairs() {return m_NumberOfNodePairs;} 00120 00122 int GetNumberOfNodeBasePairs() {return m_NumberOfNodeBasePairs;} 00123 00125 void SetCorrespondenceMatrix( const CorrespondenceMatrixType * CorrespondenceMatrix ); 00126 00127 virtual void Update() {this->GenerateData();} 00128 00129 virtual DataObjectPointer MakeOutput(unsigned int idx); 00130 00131 protected: 00132 MedialNodePairCorrespondenceProcess(); 00133 virtual ~MedialNodePairCorrespondenceProcess(){} 00134 00135 void PrintSelf(std::ostream& os, Indent indent) const; 00136 00138 void GenerateData(); 00139 00141 TSourceImage * GetCoreAtomImageA(); 00142 TSourceImage * GetCoreAtomImageB(); 00143 00145 DistanceMatrixType * GetDistanceMatrixA(); 00146 DistanceMatrixType * GetDistanceMatrixB(); 00147 00149 CorrespondenceMatrixType * GetCorrespondenceMatrix(); 00150 00151 private: 00152 MedialNodePairCorrespondenceProcess(const Self&); //purposely not implemented 00153 void operator=(const Self&); //purposely not implemented 00154 00155 CoreAtomImagePointer m_CoreAtomImageA; 00156 CoreAtomImagePointer m_CoreAtomImageB; 00157 00158 DistanceMatrixPointer m_DistanceMatrixA; 00159 DistanceMatrixPointer m_DistanceMatrixB; 00160 00161 CorrespondenceMatrixPointer m_CorrespondenceMatrix; 00162 00163 DataStructurePointerType m_DataStructure; 00164 00165 BinaryMetricPointer m_BinaryMetric; 00166 00167 int m_Rows; 00168 int m_Columns; 00169 00170 int m_NumberOfNodePairs; 00171 int m_NumberOfNodeBasePairs; 00172 00173 }; 00174 00175 } // end namespace itk 00176 00177 #ifndef ITK_MANUAL_INSTANTIATION 00178 #include "itkMedialNodePairCorrespondenceProcess.txx" 00179 #endif 00180 00181 #endif