00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkBinaryMedianImageFilter_h
00018 #define __itkBinaryMedianImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022
00023 namespace itk
00024 {
00047 template <class TInputImage, class TOutputImage>
00048 class ITK_EXPORT BinaryMedianImageFilter :
00049 public ImageToImageFilter< TInputImage, TOutputImage >
00050 {
00051 public:
00053 itkStaticConstMacro(InputImageDimension, unsigned int,
00054 TInputImage::ImageDimension);
00055 itkStaticConstMacro(OutputImageDimension, unsigned int,
00056 TOutputImage::ImageDimension);
00058
00060 typedef TInputImage InputImageType;
00061 typedef TOutputImage OutputImageType;
00062
00064 typedef BinaryMedianImageFilter Self;
00065 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00066 typedef SmartPointer<Self> Pointer;
00067 typedef SmartPointer<const Self> ConstPointer;
00068
00070 itkNewMacro(Self);
00071
00073 itkTypeMacro(BinaryMedianImageFilter, ImageToImageFilter);
00074
00076 typedef typename InputImageType::PixelType InputPixelType;
00077 typedef typename OutputImageType::PixelType OutputPixelType;
00078
00079 typedef typename InputImageType::RegionType InputImageRegionType;
00080 typedef typename OutputImageType::RegionType OutputImageRegionType;
00081
00082 typedef typename InputImageType::SizeType InputSizeType;
00083
00085 itkSetMacro(Radius, InputSizeType);
00086
00088 itkGetConstReferenceMacro(Radius, InputSizeType);
00089
00092 itkSetMacro(BackgroundValue, InputPixelType);
00093 itkSetMacro(ForegroundValue, InputPixelType);
00095
00098 itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
00099 itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
00101
00102
00109 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00110
00111 #ifdef ITK_USE_CONCEPT_CHECKING
00112
00113 itkConceptMacro(InputEqualityComparableCheck,
00114 (Concept::EqualityComparable<typename TInputImage::PixelType>));
00115 itkConceptMacro(InputConvertibleToOutputCheck,
00116 (Concept::Convertible<typename TInputImage::PixelType,
00117 typename TOutputImage::PixelType>));
00118 itkConceptMacro(SameDimensionCheck,
00119 (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00120 itkConceptMacro(InputOStreamWritableCheck,
00121 (Concept::OStreamWritable<typename TInputImage::PixelType>));
00122
00124 #endif
00125
00126 protected:
00127 BinaryMedianImageFilter();
00128 virtual ~BinaryMedianImageFilter() {}
00129 void PrintSelf(std::ostream& os, Indent indent) const;
00130
00141 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00142 int threadId );
00143
00144 private:
00145 BinaryMedianImageFilter(const Self&);
00146 void operator=(const Self&);
00147
00148 InputSizeType m_Radius;
00149
00150 InputPixelType m_ForegroundValue;
00151 InputPixelType m_BackgroundValue;
00152
00153 };
00154
00155 }
00156
00157 #ifndef ITK_MANUAL_INSTANTIATION
00158 #include "itkBinaryMedianImageFilter.txx"
00159 #endif
00160
00161 #endif
00162