00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkConnectedThresholdImageFilter_h
00018 #define __itkConnectedThresholdImageFilter_h
00019
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022
00023 namespace itk{
00024
00034 template <class TInputImage, class TOutputImage>
00035 class ConnectedThresholdImageFilter:
00036 public ImageToImageFilter<TInputImage,TOutputImage>
00037 {
00038 public:
00040 typedef ConnectedThresholdImageFilter Self;
00041 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00042 typedef SmartPointer<Self> Pointer;
00043 typedef SmartPointer<const Self> ConstPointer;
00044
00046 itkNewMacro(Self);
00047
00049 itkTypeMacro(ConnectedThresholdImageFilter,
00050 ImageToImageFilter);
00051
00052 typedef TInputImage InputImageType;
00053 typedef typename InputImageType::Pointer InputImagePointer;
00054 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00055 typedef typename InputImageType::RegionType InputImageRegionType;
00056 typedef typename InputImageType::PixelType InputImagePixelType;
00057 typedef typename InputImageType::IndexType IndexType;
00058 typedef typename InputImageType::SizeType SizeType;
00059
00060 typedef TOutputImage OutputImageType;
00061 typedef typename OutputImageType::Pointer OutputImagePointer;
00062 typedef typename OutputImageType::RegionType OutputImageRegionType;
00063 typedef typename OutputImageType::PixelType OutputImagePixelType;
00064
00065 void PrintSelf ( std::ostream& os, Indent indent ) const;
00066
00067
00069 void SetSeed ( const IndexType & seed )
00070 {
00071 this->ClearSeeds();
00072 this->AddSeed ( seed );
00073 }
00074 void AddSeed(const IndexType & seed)
00075 {
00076 m_SeedList.push_back ( seed );
00077 };
00078
00080 void ClearSeeds ()
00081 {
00082 m_SeedList.clear();
00083 };
00084
00086 itkSetMacro(Lower, InputImagePixelType);
00087 itkGetMacro(Lower, InputImagePixelType);
00088
00091 itkSetMacro(Upper, InputImagePixelType);
00092 itkGetMacro(Upper, InputImagePixelType);
00093
00097 itkSetMacro(ReplaceValue, OutputImagePixelType);
00098 itkGetMacro(ReplaceValue, OutputImagePixelType);
00099
00100 protected:
00101 ConnectedThresholdImageFilter();
00102 ~ConnectedThresholdImageFilter(){};
00103 std::vector<IndexType> m_SeedList;
00104 InputImagePixelType m_Lower;
00105 InputImagePixelType m_Upper;
00106 OutputImagePixelType m_ReplaceValue;
00107
00108
00109 void GenerateInputRequestedRegion();
00110
00111
00112 void EnlargeOutputRequestedRegion(DataObject *output);
00113
00114 void GenerateData();
00115
00116 private:
00117 ConnectedThresholdImageFilter(const Self&);
00118 void operator=(const Self&);
00119
00120 };
00121
00122 }
00123
00124 #ifndef ITK_MANUAL_INSTANTIATION
00125 #include "itkConnectedThresholdImageFilter.txx"
00126 #endif
00127
00128 #endif