00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkCoreAtomImageToDistanceMatrixProcess.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007-01-26 14:28:44 $ 00007 Version: $Revision: 1.5 $ 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 __itkCoreAtomImageToDistanceMatrixProcess_h 00018 #define __itkCoreAtomImageToDistanceMatrixProcess_h 00019 00020 #include "itkBloxCoreAtomImage.h" 00021 #include "itkBloxCoreAtomPixel.h" 00022 #include "itkDataObject.h" 00023 #include "itkImage.h" 00024 #include "itkMatrixResizeableDataObject.h" 00025 #include "itkProcessObject.h" 00026 #include "vnl/vnl_matrix.h" 00027 00028 namespace itk 00029 { 00030 00037 template< typename TSourceImage > 00038 class CoreAtomImageToDistanceMatrixProcess : public ProcessObject 00039 { 00040 public: 00042 itkStaticConstMacro(NDimensions, unsigned int, TSourceImage::ImageDimension); 00043 00045 typedef CoreAtomImageToDistanceMatrixProcess Self; 00046 typedef ProcessObject Superclass; 00047 typedef SmartPointer<Self> Pointer; 00048 typedef SmartPointer<const Self> ConstPointer; 00049 00051 typedef DataObject::Pointer DataObjectPointer; 00052 00054 itkNewMacro(Self); 00055 00057 itkTypeMacro(itkCoreAtomImageToDistanceMatrixProcess, ProcessObject); 00058 00059 //Get macro for m_NumNodes 00060 itkGetMacro(NumberOfNodes, int); 00061 00063 typedef TSourceImage CoreAtomImageType; 00064 typedef typename CoreAtomImageType::Pointer CoreAtomImagePointer; 00065 typedef typename CoreAtomImageType::RegionType CoreAtomImageRegionType; 00066 typedef typename CoreAtomImageType::PixelType CoreAtomImagePixelType; 00067 typedef typename CoreAtomImageType::ConstPointer CoreAtomImageConstPointer; 00068 00070 typedef MatrixResizeableDataObject<double> DistanceMatrixType; 00071 typedef typename DistanceMatrixType::Pointer DistanceMatrixPointer; 00072 00073 //MedialNode typedef 00074 typedef BloxCoreAtomPixel<itkGetStaticConstMacro(NDimensions)> MedialNodeType; 00075 00077 typedef Point<double, itkGetStaticConstMacro(NDimensions)> PositionType; 00078 00080 DistanceMatrixType * GetOutput(void); 00081 DistanceMatrixType * GetOutput(unsigned int idx); 00083 00085 void SetInput1( const CoreAtomImageType * CoreAtomImageA ); 00086 00087 virtual void Update() {this->GenerateData();} 00088 00089 virtual DataObjectPointer MakeOutput(unsigned int idx); 00090 00091 protected: 00092 CoreAtomImageToDistanceMatrixProcess(); 00093 virtual ~CoreAtomImageToDistanceMatrixProcess(){} 00094 00095 void PrintSelf(std::ostream& os, Indent indent) const; 00096 00098 void GenerateData(); 00099 00101 TSourceImage * GetInput1(); 00102 00103 private: 00104 CoreAtomImageToDistanceMatrixProcess(const Self&); //purposely not implemented 00105 void operator=(const Self&); //purposely not implemented 00106 00107 CoreAtomImagePointer m_CoreAtomImage; 00108 DistanceMatrixPointer m_DistanceMatrix; 00109 00110 int m_NumberOfNodes; 00111 }; 00112 00113 } // end namespace itk 00114 00115 #ifndef ITK_MANUAL_INSTANTIATION 00116 #include "itkCoreAtomImageToDistanceMatrixProcess.txx" 00117 #endif 00118 00119 #endif 00120