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 __itkNeighborhoodConnectedImageFilter_h
00018 #define __itkNeighborhoodConnectedImageFilter_h
00019
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022
00023 namespace itk {
00024
00034 template <class TInputImage, class TOutputImage>
00035 class ITK_EXPORT NeighborhoodConnectedImageFilter:
00036 public ImageToImageFilter<TInputImage,TOutputImage>
00037 {
00038 public:
00040 typedef NeighborhoodConnectedImageFilter 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(NeighborhoodConnectedImageFilter,
00050 ImageToImageFilter);
00051
00052 typedef TInputImage InputImageType;
00053 typedef typename InputImageType::Pointer InputImagePointer;
00054 typedef typename InputImageType::RegionType InputImageRegionType;
00055 typedef typename InputImageType::PixelType InputImagePixelType;
00056 typedef typename InputImageType::IndexType IndexType;
00057 typedef typename InputImageType::SizeType InputImageSizeType;
00058
00059 typedef TOutputImage OutputImageType;
00060 typedef typename OutputImageType::Pointer OutputImagePointer;
00061 typedef typename OutputImageType::RegionType OutputImageRegionType;
00062 typedef typename OutputImageType::PixelType OutputImagePixelType;
00063
00064 void PrintSelf ( std::ostream& os, Indent indent ) const;
00065
00067 void ClearSeeds();
00068
00070 void SetSeed(const IndexType & seed);
00071
00073 void AddSeed ( const IndexType & seed );
00074
00076 itkSetMacro(Lower, InputImagePixelType);
00077 itkGetConstMacro(Lower, InputImagePixelType);
00079
00082 itkSetMacro(Upper, InputImagePixelType);
00083 itkGetConstMacro(Upper, InputImagePixelType);
00085
00089 itkSetMacro(ReplaceValue, OutputImagePixelType);
00090 itkGetConstMacro(ReplaceValue, OutputImagePixelType);
00092
00094 itkSetMacro(Radius, InputImageSizeType);
00095
00097 itkGetConstReferenceMacro(Radius, InputImageSizeType);
00098
00100 itkStaticConstMacro(InputImageDimension, unsigned int,
00101 TInputImage::ImageDimension);
00102 itkStaticConstMacro(OutputImageDimension, unsigned int,
00103 TOutputImage::ImageDimension);
00105
00106 #ifdef ITK_USE_CONCEPT_CHECKING
00107
00108 itkConceptMacro(InputEqualityComparableCheck,
00109 (Concept::EqualityComparable<InputImagePixelType>));
00110 itkConceptMacro(OutputEqualityComparableCheck,
00111 (Concept::EqualityComparable<OutputImagePixelType>));
00112 itkConceptMacro(SameDimensionCheck,
00113 (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00114 itkConceptMacro(InputOStreamWritableCheck,
00115 (Concept::OStreamWritable<InputImagePixelType>));
00116 itkConceptMacro(OutputOStreamWritableCheck,
00117 (Concept::OStreamWritable<OutputImagePixelType>));
00118
00120 #endif
00121
00122 protected:
00123 NeighborhoodConnectedImageFilter();
00124 ~NeighborhoodConnectedImageFilter(){};
00125 std::vector<IndexType> m_Seeds;
00126 InputImagePixelType m_Lower;
00127 InputImagePixelType m_Upper;
00128 OutputImagePixelType m_ReplaceValue;
00129 InputImageSizeType m_Radius;
00130
00131
00132
00133 void GenerateInputRequestedRegion();
00134
00135
00136 void EnlargeOutputRequestedRegion(DataObject *output);
00137 void GenerateData();
00138
00139 private:
00140 NeighborhoodConnectedImageFilter(const Self&);
00141 void operator=(const Self&);
00142
00143 };
00144
00145 }
00146
00147 #ifndef ITK_MANUAL_INSTANTIATION
00148 #include "itkNeighborhoodConnectedImageFilter.txx"
00149 #endif
00150
00151 #endif
00152