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);
00088
00091 itkSetMacro(IsolatedValueTolerance, double);
00092 itkGetMacro(IsolatedValueTolerance, double);
00093
00096 itkSetMacro(UpperValueLimit, double);
00097 itkGetMacro(UpperValueLimit, double);
00098
00099
00103 itkSetMacro(ReplaceValue1, OutputImagePixelType);
00104 itkGetMacro(ReplaceValue1, OutputImagePixelType);
00105 itkSetMacro(ReplaceValue2, OutputImagePixelType);
00106 itkGetMacro(ReplaceValue2, OutputImagePixelType);
00107
00109 itkGetMacro(IsolatedValue, double);
00110
00111 protected:
00112 IsolatedWatershedImageFilter();
00113 ~IsolatedWatershedImageFilter(){};
00114 IndexType m_Seed1;
00115 IndexType m_Seed2;
00116 OutputImagePixelType m_ReplaceValue1;
00117 OutputImagePixelType m_ReplaceValue2;
00118
00119 typename GradientMagnitudeType::Pointer m_GradientMagnitude;
00120 typename WatershedType::Pointer m_Watershed;
00121
00122 double m_Threshold;
00123 double m_IsolatedValue;
00124 double m_IsolatedValueTolerance;
00125 double m_UpperValueLimit;
00126
00127
00128 void GenerateInputRequestedRegion();
00129
00130
00131 void EnlargeOutputRequestedRegion(DataObject *output);
00132
00133 void GenerateData();
00134
00135 private:
00136 IsolatedWatershedImageFilter(const Self&);
00137 void operator=(const Self&);
00138
00139 };
00140
00141 }
00142
00143 #ifndef ITK_MANUAL_INSTANTIATION
00144 #include "itkIsolatedWatershedImageFilter.txx"
00145 #endif
00146
00147 #endif