00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkIsolatedWatershedImageFilter_h
00018 #define __itkIsolatedWatershedImageFilter_h
00019
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 #include "itkWatershedImageFilter.h"
00023 #include "itkGradientMagnitudeImageFilter.h"
00024
00025 namespace itk{
00026
00040 template <class TInputImage, class TOutputImage>
00041 class ITK_EXPORT IsolatedWatershedImageFilter:
00042 public ImageToImageFilter<TInputImage,TOutputImage>
00043 {
00044 public:
00046 typedef IsolatedWatershedImageFilter Self;
00047 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00052 itkNewMacro(Self);
00053
00055 itkTypeMacro(IsolatedWatershedImageFilter,
00056 ImageToImageFilter);
00057
00058 typedef TInputImage InputImageType;
00059 typedef typename InputImageType::Pointer InputImagePointer;
00060 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00061 typedef typename InputImageType::RegionType InputImageRegionType;
00062 typedef typename InputImageType::PixelType InputImagePixelType;
00063 typedef typename InputImageType::IndexType IndexType;
00064 typedef typename InputImageType::SizeType SizeType;
00065
00066 typedef TOutputImage OutputImageType;
00067 typedef typename OutputImageType::Pointer OutputImagePointer;
00068 typedef typename OutputImageType::RegionType OutputImageRegionType;
00069 typedef typename OutputImageType::PixelType OutputImagePixelType;
00070
00071 typedef WatershedImageFilter<InputImageType> WatershedType;
00072 typedef GradientMagnitudeImageFilter<InputImageType,OutputImageType> GradientMagnitudeType;
00073 void PrintSelf ( std::ostream& os, Indent indent ) const;
00074
00078 itkSetMacro(Seed1, IndexType);
00079
00083 itkSetMacro(Seed2, IndexType);
00084
00086 itkSetMacro(Threshold, double);
00087 itkGetMacro(Threshold, double);
00089
00092 itkSetMacro(IsolatedValueTolerance, double);
00093 itkGetMacro(IsolatedValueTolerance, double);
00095
00098 itkSetMacro(UpperValueLimit, double);
00099 itkGetMacro(UpperValueLimit, double);
00101
00102
00106 itkSetMacro(ReplaceValue1, OutputImagePixelType);
00107 itkGetMacro(ReplaceValue1, OutputImagePixelType);
00108 itkSetMacro(ReplaceValue2, OutputImagePixelType);
00109 itkGetMacro(ReplaceValue2, OutputImagePixelType);
00111
00113 itkGetMacro(IsolatedValue, double);
00114
00115 protected:
00116 IsolatedWatershedImageFilter();
00117 ~IsolatedWatershedImageFilter(){};
00118 IndexType m_Seed1;
00119 IndexType m_Seed2;
00120 OutputImagePixelType m_ReplaceValue1;
00121 OutputImagePixelType m_ReplaceValue2;
00122
00123 typename GradientMagnitudeType::Pointer m_GradientMagnitude;
00124 typename WatershedType::Pointer m_Watershed;
00125
00126 double m_Threshold;
00127 double m_IsolatedValue;
00128 double m_IsolatedValueTolerance;
00129 double m_UpperValueLimit;
00130
00131
00132 void GenerateInputRequestedRegion();
00133
00134
00135 void EnlargeOutputRequestedRegion(DataObject *output);
00136
00137 void GenerateData();
00138
00139 private:
00140 IsolatedWatershedImageFilter(const Self&);
00141 void operator=(const Self&);
00142
00143 };
00144
00145 }
00146
00147 #ifndef ITK_MANUAL_INSTANTIATION
00148 #include "itkIsolatedWatershedImageFilter.txx"
00149 #endif
00150
00151 #endif
00152