00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMedialNodePairCorrespondenceProcess.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:35 $ 00007 Version: $Revision: 1.3 $ 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 "itkPNGImageIO.h" 00029 #include "itkImageFileWriter.h" 00030 #include "itkRawImageIO.h" 00031 00032 #include "itkCorrespondenceDataStructure.h" 00033 #include "itkSecondaryNodeList.h" 00034 #include "itkCorrespondingList.h" 00035 #include "itkCorrespondingMedialNodeClique.h" 00036 #include "itkCorrespondenceDataStructureIterator.h" 00037 00038 namespace itk 00039 { 00040 00049 template< typename TSourceImage > 00050 class MedialNodePairCorrespondenceProcess : public ProcessObject 00051 { 00052 public: 00054 itkStaticConstMacro(NDimensions, unsigned int, TSourceImage::ImageDimension); 00055 00057 typedef MedialNodePairCorrespondenceProcess Self; 00058 typedef ProcessObject Superclass; 00059 typedef SmartPointer<Self> Pointer; 00060 typedef SmartPointer<const Self> ConstPointer; 00061 00063 typedef DataObject::Pointer DataObjectPointer; 00064 00066 itkNewMacro(Self); 00067 00069 itkTypeMacro(MedialNodePairCorrespondenceProcess, ProcessObject); 00070 00072 typedef TSourceImage CoreAtomImageType; 00073 typedef typename CoreAtomImageType::Pointer CoreAtomImagePointer; 00074 typedef typename CoreAtomImageType::RegionType CoreAtomImageRegionType; 00075 typedef typename CoreAtomImageType::PixelType CoreAtomImagePixelType; 00076 typedef typename CoreAtomImageType::ConstPointer CoreAtomImageConstPointer; 00077 00079 typedef MatrixResizeableDataObject<double> DistanceMatrixType; 00080 typedef typename DistanceMatrixType::Pointer DistanceMatrixPointer; 00081 00083 typedef MatrixResizeableDataObject<double> CorrespondenceMatrixType; 00084 typedef typename CorrespondenceMatrixType::Pointer CorrespondenceMatrixPointer; 00085 00087 typedef CorrespondingMedialNodeClique<itkGetStaticConstMacro(NDimensions),2> NodeType; 00088 typedef CorrespondenceDataStructure<NodeType,2> DataStructureType; 00089 typedef typename CorrespondenceDataStructure<NodeType,2>::Pointer DataStructurePointerType; 00090 typedef CorrespondenceDataStructureIterator<DataStructureType> IteratorType; 00091 00093 typedef BinaryMedialNodeMetric<itkGetStaticConstMacro(NDimensions)> BinaryMetricType; 00094 typedef typename BinaryMedialNodeMetric<itkGetStaticConstMacro(NDimensions)>::Pointer BinaryMetricPointer; 00095 00097 typedef BloxCoreAtomPixel<itkGetStaticConstMacro(NDimensions)> MedialNodeType; 00098 00100 typedef Point<double, itkGetStaticConstMacro(NDimensions)> PositionType; 00101 00103 DataStructureType * GetOutput(void); 00104 DataStructureType * GetOutput(unsigned int idx); 00105 00106 /* This is important to note...the inputs for this process are somewhat 00107 complicated, and there are a lot of them. You need all 5 inputs for 00108 this process to perform its task */ 00109 00111 void SetCoreAtomImageA( const CoreAtomImageType * CoreAtomImageA ); 00112 00114 void SetCoreAtomImageB( const CoreAtomImageType * CoreAtomImageB ); 00115 00117 void SetDistanceMatrixA( const DistanceMatrixType * DistanceMatrixA ); 00118 00120 void SetDistanceMatrixB( const DistanceMatrixType * DistanceMatrixB ); 00121 00123 int GetNumberOfNodePairs() {return m_NumberOfNodePairs;} 00124 00126 int GetNumberOfNodeBasePairs() {return m_NumberOfNodeBasePairs;} 00127 00129 void SetCorrespondenceMatrix( const CorrespondenceMatrixType * CorrespondenceMatrix ); 00130 00131 virtual void Update() {this->GenerateData();} 00132 00133 virtual DataObjectPointer MakeOutput(unsigned int idx); 00134 00135 protected: 00136 MedialNodePairCorrespondenceProcess(); 00137 virtual ~MedialNodePairCorrespondenceProcess(){} 00138 00139 void PrintSelf(std::ostream& os, Indent indent) const; 00140 00142 void GenerateData(); 00143 00145 TSourceImage * GetCoreAtomImageA(); 00146 TSourceImage * GetCoreAtomImageB(); 00147 00149 DistanceMatrixType * GetDistanceMatrixA(); 00150 DistanceMatrixType * GetDistanceMatrixB(); 00151 00153 CorrespondenceMatrixType * GetCorrespondenceMatrix(); 00154 00155 private: 00156 MedialNodePairCorrespondenceProcess(const Self&); //purposely not implemented 00157 void operator=(const Self&); //purposely not implemented 00158 00159 CoreAtomImagePointer m_CoreAtomImageA; 00160 CoreAtomImagePointer m_CoreAtomImageB; 00161 00162 DistanceMatrixPointer m_DistanceMatrixA; 00163 DistanceMatrixPointer m_DistanceMatrixB; 00164 00165 CorrespondenceMatrixPointer m_CorrespondenceMatrix; 00166 00167 DataStructurePointerType m_DataStructure; 00168 00169 BinaryMetricPointer m_BinaryMetric; 00170 00171 int m_Rows; 00172 int m_Columns; 00173 00174 int m_NumberOfNodePairs; 00175 int m_NumberOfNodeBasePairs; 00176 00178 bool m_OutputPNG; 00179 00183 bool m_CreateOutputFile; 00184 }; 00185 00186 } // end namespace itk 00187 00188 #ifndef ITK_MANUAL_INSTANTIATION 00189 #include "itkMedialNodePairCorrespondenceProcess.txx" 00190 #endif 00191 00192 #endif