00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMeanImageFilter_h
00018 #define __itkMeanImageFilter_h
00019
00020
00021
00022
00023
00024 #include "itkConfigure.h"
00025
00026 #ifdef ITK_USE_CONSOLIDATED_MORPHOLOGY
00027 #include "itkOptMeanImageFilter.h"
00028 #else
00029
00030 #include "itkImageToImageFilter.h"
00031 #include "itkImage.h"
00032 #include "itkNumericTraits.h"
00033
00034 namespace itk
00035 {
00051 template <class TInputImage, class TOutputImage>
00052 class ITK_EXPORT MeanImageFilter :
00053 public ImageToImageFilter< TInputImage, TOutputImage >
00054 {
00055 public:
00057 itkStaticConstMacro(InputImageDimension, unsigned int,
00058 TInputImage::ImageDimension);
00059 itkStaticConstMacro(OutputImageDimension, unsigned int,
00060 TOutputImage::ImageDimension);
00062
00064 typedef TInputImage InputImageType;
00065 typedef TOutputImage OutputImageType;
00066
00068 typedef MeanImageFilter Self;
00069 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00070 typedef SmartPointer<Self> Pointer;
00071 typedef SmartPointer<const Self> ConstPointer;
00072
00074 itkNewMacro(Self);
00075
00077 itkTypeMacro(MeanImageFilter, ImageToImageFilter);
00078
00080 typedef typename InputImageType::PixelType InputPixelType;
00081 typedef typename OutputImageType::PixelType OutputPixelType;
00082 typedef typename NumericTraits<InputPixelType>::RealType InputRealType;
00083
00084 typedef typename InputImageType::RegionType InputImageRegionType;
00085 typedef typename OutputImageType::RegionType OutputImageRegionType;
00086 typedef typename InputImageType::SizeType InputSizeType;
00087
00089 itkSetMacro(Radius, InputSizeType);
00090
00092 itkGetConstReferenceMacro(Radius, InputSizeType);
00093
00100 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00101
00102 #ifdef ITK_USE_CONCEPT_CHECKING
00103
00104 itkConceptMacro(InputHasNumericTraitsCheck,
00105 (Concept::HasNumericTraits<InputPixelType>));
00106
00108 #endif
00109
00110 protected:
00111 MeanImageFilter();
00112 virtual ~MeanImageFilter() {}
00113 void PrintSelf(std::ostream& os, Indent indent) const;
00114
00125 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00126 int threadId );
00127
00128 private:
00129 MeanImageFilter(const Self&);
00130 void operator=(const Self&);
00131
00132 InputSizeType m_Radius;
00133 };
00134
00135 }
00136
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkMeanImageFilter.txx"
00139 #endif
00140
00141 #endif
00142
00143 #endif
00144