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 __itkOptMorphologicalGradientImageFilter_h
00018 #define __itkOptMorphologicalGradientImageFilter_h
00019
00020 #include "itkKernelImageFilter.h"
00021 #include "itkMovingHistogramMorphologicalGradientImageFilter.h"
00022 #include "itkBasicDilateImageFilter.h"
00023 #include "itkBasicErodeImageFilter.h"
00024 #include "itkAnchorErodeImageFilter.h"
00025 #include "itkAnchorDilateImageFilter.h"
00026 #include "itkVanHerkGilWermanDilateImageFilter.h"
00027 #include "itkVanHerkGilWermanErodeImageFilter.h"
00028 #include "itkSubtractImageFilter.h"
00029 #include "itkConstantBoundaryCondition.h"
00030 #include "itkFlatStructuringElement.h"
00031 #include "itkNeighborhood.h"
00032
00033 namespace itk {
00034
00050 template<class TInputImage, class TOutputImage, class TKernel>
00051 class ITK_EXPORT MorphologicalGradientImageFilter :
00052 public KernelImageFilter<TInputImage, TOutputImage, TKernel>
00053 {
00054 public:
00056 typedef MorphologicalGradientImageFilter Self;
00057 typedef KernelImageFilter<TInputImage,TOutputImage, TKernel> Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkNewMacro(Self);
00063
00065 itkTypeMacro(MorphologicalGradientImageFilter,
00066 KernelImageFilter);
00067
00069 itkStaticConstMacro(ImageDimension, unsigned int,
00070 TInputImage::ImageDimension);
00071
00073 typedef TInputImage InputImageType;
00074 typedef TOutputImage OutputImageType;
00075 typedef typename TInputImage::RegionType RegionType;
00076 typedef typename TInputImage::SizeType SizeType;
00077 typedef typename TInputImage::IndexType IndexType;
00078 typedef typename TInputImage::PixelType PixelType;
00079 typedef typename TInputImage::OffsetType OffsetType;
00080 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00081
00082 typedef FlatStructuringElement< itkGetStaticConstMacro(ImageDimension) >
00083 FlatKernelType;
00084 typedef MovingHistogramMorphologicalGradientImageFilter< TInputImage, TOutputImage, TKernel >
00085 HistogramFilterType;
00086 typedef BasicDilateImageFilter< TInputImage, TInputImage, TKernel >
00087 BasicDilateFilterType;
00088 typedef BasicErodeImageFilter< TInputImage, TInputImage, TKernel >
00089 BasicErodeFilterType;
00090 typedef AnchorDilateImageFilter< TInputImage, FlatKernelType >
00091 AnchorDilateFilterType;
00092 typedef AnchorErodeImageFilter< TInputImage, FlatKernelType > AnchorErodeFilterType;
00093 typedef VanHerkGilWermanDilateImageFilter< TInputImage, FlatKernelType >
00094 VHGWDilateFilterType;
00095 typedef VanHerkGilWermanErodeImageFilter< TInputImage, FlatKernelType >
00096 VHGWErodeFilterType;
00097 typedef SubtractImageFilter< TInputImage, TInputImage, TOutputImage >
00098 SubtractFilterType;
00099
00101 typedef TKernel KernelType;
00102
00103
00104
00106 void SetKernel( const KernelType& kernel );
00107
00109 void SetAlgorithm(int algo );
00110 itkGetConstMacro(Algorithm, int);
00112
00114 virtual void Modified() const;
00115
00117 enum {
00118 BASIC = 0,
00119 HISTO = 1,
00120 ANCHOR = 2,
00121 VHGW = 3
00122 } AlgorithmChoice;
00123
00124
00125 protected:
00126 MorphologicalGradientImageFilter();
00127 ~MorphologicalGradientImageFilter() {};
00128 void PrintSelf(std::ostream& os, Indent indent) const;
00129
00130 void GenerateData();
00131
00132 private:
00133 MorphologicalGradientImageFilter(const Self&);
00134 void operator=(const Self&);
00135
00136
00137 typename HistogramFilterType::Pointer m_HistogramFilter;
00138 typename BasicDilateFilterType::Pointer m_BasicDilateFilter;
00139 typename BasicErodeFilterType::Pointer m_BasicErodeFilter;
00140 typename AnchorDilateFilterType::Pointer m_AnchorDilateFilter;
00141 typename AnchorErodeFilterType::Pointer m_AnchorErodeFilter;
00142 typename VHGWDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter;
00143 typename VHGWErodeFilterType::Pointer m_VanHerkGilWermanErodeFilter;
00144
00145
00146 int m_Algorithm;
00147
00148 };
00149
00150 }
00151
00152 #ifndef ITK_MANUAL_INSTANTIATION
00153 #include "itkOptMorphologicalGradientImageFilter.txx"
00154 #endif
00155
00156 #endif
00157