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 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022
00023 namespace itk
00024 {
00044 template <class TInputImage, class TOutputImage>
00045 class ITK_EXPORT MedianImageFilter :
00046 public ImageToImageFilter< TInputImage, TOutputImage >
00047 {
00048 public:
00050 itkStaticConstMacro(InputImageDimension, unsigned int,
00051 TInputImage::ImageDimension);
00052 itkStaticConstMacro(OutputImageDimension, unsigned int,
00053 TOutputImage::ImageDimension);
00055
00057 typedef TInputImage InputImageType;
00058 typedef TOutputImage OutputImageType;
00059
00061 typedef MedianImageFilter Self;
00062 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00063 typedef SmartPointer<Self> Pointer;
00064 typedef SmartPointer<const Self> ConstPointer;
00065
00067 itkNewMacro(Self);
00068
00070 itkTypeMacro(MedianImageFilter, ImageToImageFilter);
00071
00073 typedef typename InputImageType::PixelType InputPixelType;
00074 typedef typename OutputImageType::PixelType OutputPixelType;
00075
00076 typedef typename InputImageType::RegionType InputImageRegionType;
00077 typedef typename OutputImageType::RegionType OutputImageRegionType;
00078
00079 typedef typename InputImageType::SizeType InputSizeType;
00080
00082 itkSetMacro(Radius, InputSizeType);
00083
00085 itkGetConstReferenceMacro(Radius, InputSizeType);
00086
00093 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00094
00095 #ifdef ITK_USE_CONCEPT_CHECKING
00096
00097 itkConceptMacro(SameDimensionCheck,
00098 (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00099 itkConceptMacro(InputConvertibleToOutputCheck,
00100 (Concept::Convertible<InputPixelType, OutputPixelType>));
00101 itkConceptMacro(InputLessThanComparableCheck,
00102 (Concept::LessThanComparable<InputPixelType>));
00103
00105 #endif
00106
00107 protected:
00108 MedianImageFilter();
00109 virtual ~MedianImageFilter() {}
00110 void PrintSelf(std::ostream& os, Indent indent) const;
00111
00122 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00123 int threadId );
00124
00125 private:
00126 MedianImageFilter(const Self&);
00127 void operator=(const Self&);
00128
00129 InputSizeType m_Radius;
00130 };
00131
00132 }
00133
00134 #ifndef ITK_MANUAL_INSTANTIATION
00135 #include "itkMedianImageFilter.txx"
00136 #endif
00137
00138 #endif
00139