itkGradientVectorFlowImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGradientVectorFlowImageFilter_h
00018 #define __itkGradientVectorFlowImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "vnl/vnl_matrix_fixed.h"
00022 #include "vnl/vnl_math.h"
00023 #include "itkImage.h"
00024 #include "itkVector.h"
00025 #include "itkLaplacianImageFilter.h"
00026 #include "itkImageRegionIterator.h"
00027 #include "itkImageRegionConstIteratorWithIndex.h"
00028
00029 namespace itk
00030 {
00031
00041 template <class TInputImage, class TOutputImage, class TInternalPixel=double>
00042 class ITK_EXPORT GradientVectorFlowImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
00043 {
00044 public:
00046 typedef GradientVectorFlowImageFilter Self;
00047
00049 typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00050
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056 itkNewMacro(Self);
00057
00059 itkTypeMacro(GradientVectorFlowImageFilter, ImageToImageFilter);
00060
00062 typedef TInputImage InputImageType;
00063 typedef TOutputImage OutputImageType;
00064
00065 typedef typename TInputImage::IndexType IndexType;
00066 typedef typename TInputImage::SizeType SizeType;
00067 typedef typename TInputImage::PixelType PixelType;
00068 typedef typename OutputImageType::Pointer OutputImagePointer;
00069 typedef typename OutputImageType::RegionType RegionType;
00070
00072
00073 typedef ImageRegionIterator<InputImageType> InputImageIterator;
00074 typedef ImageRegionConstIteratorWithIndex<InputImageType> InputImageConstIterator;
00075 typedef ImageRegionIterator<OutputImageType> OutputImageIterator;
00076
00078 itkStaticConstMacro(ImageDimension, unsigned int,
00079 TInputImage::ImageDimension);
00080 itkStaticConstMacro(OutputImageDimension, unsigned int,
00081 TOutputImage::ImageDimension);
00083
00084 typedef TInternalPixel InternalPixelType;
00085 typedef itk::Image<InternalPixelType, itkGetStaticConstMacro(ImageDimension)>
00086 InternalImageType;
00087 typedef typename InternalImageType::Pointer InternalImagePointer;
00088 typedef ImageRegionIterator<InternalImageType> InternalImageIterator;
00089
00090 typedef LaplacianImageFilter<InternalImageType, InternalImageType>
00091 LaplacianFilterType;
00092 typedef typename LaplacianFilterType::Pointer LaplacianFilterPointer;
00093
00096 itkSetMacro(LaplacianFilter, LaplacianFilterPointer);
00097
00098 itkSetMacro(TimeStep, double);
00099 itkGetConstMacro(TimeStep, double);
00100
00101 itkSetMacro(NoiseLevel, double);
00102 itkGetConstMacro(NoiseLevel, double);
00103
00104 itkSetMacro(IterationNum, int);
00105 itkGetConstMacro(IterationNum, int);
00106
00107 #ifdef ITK_USE_CONCEPT_CHECKING
00108
00109 itkConceptMacro(SameDimensionCheck,
00110 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00111 itkConceptMacro(InputHasNumericTraitsCheck,
00112 (Concept::HasNumericTraits<typename PixelType::ValueType>));
00113 itkConceptMacro(OutputHasNumericTraitsCheck,
00114 (Concept::HasNumericTraits<typename TOutputImage::PixelType::ValueType>));
00115
00117 #endif
00118
00119 protected:
00120 GradientVectorFlowImageFilter();
00121 ~GradientVectorFlowImageFilter() {}
00122 GradientVectorFlowImageFilter(const Self&) {}
00123 void operator=(const Self&) {}
00124 void PrintSelf(std::ostream& os, Indent indent) const;
00125
00126 virtual void GenerateData();
00127
00128 void InitInterImage();
00129 void UpdateInterImage();
00130 void UpdatePixels();
00131
00132 private:
00133
00134 double m_TimeStep;
00135 double m_Steps[Superclass::InputImageDimension];
00136 double m_NoiseLevel;
00137 int m_IterationNum;
00138
00139 LaplacianFilterPointer m_LaplacianFilter;
00140 typename Superclass::InputImagePointer m_IntermediateImage;
00141
00142 InternalImagePointer m_InternalImages[Superclass::InputImageDimension];
00143 InternalImagePointer m_BImage;
00144
00145 typename Superclass::InputImagePointer m_CImage;
00146 };
00147
00148 }
00149
00150 #ifndef ITK_MANUAL_INSTANTIATION
00151 #include "itkGradientVectorFlowImageFilter.txx"
00152 #endif
00153
00154 #endif
00155