itkShrinkImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkShrinkImageFilter_h
00021 #define __itkShrinkImageFilter_h
00022
00023 #include "itkImageToImageFilter.h"
00024
00025 namespace itk
00026 {
00027
00054 template <class TInputImage, class TOutputImage>
00055 class ITK_EXPORT ShrinkImageFilter:
00056 public ImageToImageFilter<TInputImage,TOutputImage>
00057 {
00058 public:
00060 typedef ShrinkImageFilter Self;
00061 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00062 typedef SmartPointer<Self> Pointer;
00063 typedef SmartPointer<const Self> ConstPointer;
00064
00066 itkNewMacro(Self);
00067
00069 itkTypeMacro(ShrinkImageFilter, ImageToImageFilter);
00070
00072 typedef TOutputImage OutputImageType;
00073 typedef TInputImage InputImageType;
00074 typedef typename OutputImageType::Pointer OutputImagePointer;
00075 typedef typename InputImageType::Pointer InputImagePointer;
00076 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00077
00079 typedef typename TOutputImage::RegionType OutputImageRegionType;
00080
00082 itkStaticConstMacro(ImageDimension, unsigned int,
00083 TInputImage::ImageDimension );
00084 itkStaticConstMacro(OutputImageDimension, unsigned int,
00085 TOutputImage::ImageDimension );
00087
00090 void SetShrinkFactors( unsigned int factors[] );
00091 void SetShrinkFactors( unsigned int factor );
00092 void SetShrinkFactor( unsigned int i, unsigned int factor )
00093 {
00094 m_ShrinkFactors[i] = factor;
00095 }
00097
00099 const unsigned int * GetShrinkFactors() const
00100 { return m_ShrinkFactors; }
00101
00109 virtual void GenerateOutputInformation();
00110
00116 virtual void GenerateInputRequestedRegion();
00117
00118 #ifdef ITK_USE_CONCEPT_CHECKING
00119
00120 itkConceptMacro(InputConvertibleToOutputCheck,
00121 (Concept::Convertible<typename TInputImage::PixelType, typename TOutputImage::PixelType>));
00122 itkConceptMacro(SameDimensionCheck,
00123 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00124
00126 #endif
00127
00128 protected:
00129 ShrinkImageFilter();
00130 ~ShrinkImageFilter() {};
00131 void PrintSelf(std::ostream& os, Indent indent) const;
00132
00143 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00144 int threadId );
00145
00146 private:
00147 ShrinkImageFilter(const Self&);
00148 void operator=(const Self&);
00149
00150 unsigned int m_ShrinkFactors[ImageDimension];
00151 };
00152
00153
00154 }
00155
00156 #ifndef ITK_MANUAL_INSTANTIATION
00157 #include "itkShrinkImageFilter.txx"
00158 #endif
00159
00160 #endif
00161