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 __itkMedianImageFilter_h
00018 #define __itkMedianImageFilter_h
00019
00020
00021
00022
00023
00024 #include "itkConfigure.h"
00025
00026 #ifdef ITK_USE_CONSOLIDATED_MORPHOLOGY
00027 #include "itkOptMedianImageFilter.h"
00028 #else
00029
00030 #include "itkImageToImageFilter.h"
00031 #include "itkImage.h"
00032
00033 namespace itk
00034 {
00054 template <class TInputImage, class TOutputImage>
00055 class ITK_EXPORT MedianImageFilter :
00056 public ImageToImageFilter< TInputImage, TOutputImage >
00057 {
00058 public:
00060 itkStaticConstMacro(InputImageDimension, unsigned int,
00061 TInputImage::ImageDimension);
00062 itkStaticConstMacro(OutputImageDimension, unsigned int,
00063 TOutputImage::ImageDimension);
00065
00067 typedef TInputImage InputImageType;
00068 typedef TOutputImage OutputImageType;
00069
00071 typedef MedianImageFilter Self;
00072 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00073 typedef SmartPointer<Self> Pointer;
00074 typedef SmartPointer<const Self> ConstPointer;
00075
00077 itkNewMacro(Self);
00078
00080 itkTypeMacro(MedianImageFilter, ImageToImageFilter);
00081
00083 typedef typename InputImageType::PixelType InputPixelType;
00084 typedef typename OutputImageType::PixelType OutputPixelType;
00085
00086 typedef typename InputImageType::RegionType InputImageRegionType;
00087 typedef typename OutputImageType::RegionType OutputImageRegionType;
00088
00089 typedef typename InputImageType::SizeType InputSizeType;
00090
00092 itkSetMacro(Radius, InputSizeType);
00093
00095 itkGetConstReferenceMacro(Radius, InputSizeType);
00096
00103 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00104
00105 #ifdef ITK_USE_CONCEPT_CHECKING
00106
00107 itkConceptMacro(SameDimensionCheck,
00108 (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00109 itkConceptMacro(InputConvertibleToOutputCheck,
00110 (Concept::Convertible<InputPixelType, OutputPixelType>));
00111 itkConceptMacro(InputLessThanComparableCheck,
00112 (Concept::LessThanComparable<InputPixelType>));
00113
00115 #endif
00116
00117 protected:
00118 MedianImageFilter();
00119 virtual ~MedianImageFilter() {}
00120 void PrintSelf(std::ostream& os, Indent indent) const;
00121
00132 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00133 int threadId );
00134
00135 private:
00136 MedianImageFilter(const Self&);
00137 void operator=(const Self&);
00138
00139 InputSizeType m_Radius;
00140 };
00141
00142 }
00143
00144 #ifndef ITK_MANUAL_INSTANTIATION
00145 #include "itkMedianImageFilter.txx"
00146 #endif
00147
00148 #endif
00149
00150 #endif
00151