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
00051 template <class TInputImage, class TOutputImage>
00052 class ITK_EXPORT ShrinkImageFilter:
00053 public ImageToImageFilter<TInputImage,TOutputImage>
00054 {
00055 public:
00057 typedef ShrinkImageFilter Self;
00058 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00059 typedef SmartPointer<Self> Pointer;
00060 typedef SmartPointer<const Self> ConstPointer;
00061
00063 itkNewMacro(Self);
00064
00066 itkTypeMacro(ShrinkImageFilter, ImageToImageFilter);
00067
00069 typedef TOutputImage OutputImageType;
00070 typedef TInputImage InputImageType;
00071 typedef typename OutputImageType::Pointer OutputImagePointer;
00072 typedef typename InputImageType::Pointer InputImagePointer;
00073 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00074
00076 typedef typename TOutputImage::RegionType OutputImageRegionType;
00077
00079 itkStaticConstMacro(ImageDimension, unsigned int,
00080 TInputImage::ImageDimension );
00081 itkStaticConstMacro(OutputImageDimension, unsigned int,
00082 TOutputImage::ImageDimension );
00084
00087 void SetShrinkFactors( unsigned int factors[] );
00088 void SetShrinkFactors( unsigned int factor );
00089 void SetShrinkFactor( unsigned int i, unsigned int factor )
00090 {
00091 m_ShrinkFactors[i] = factor;
00092 }
00094
00096 const unsigned int * GetShrinkFactors() const
00097 { return m_ShrinkFactors; }
00098
00106 virtual void GenerateOutputInformation();
00107
00113 virtual void GenerateInputRequestedRegion();
00114 virtual void EnlargeOutputRequestedRegion(DataObject *output);
00116
00117 #ifdef ITK_USE_CONCEPT_CHECKING
00118
00119 itkConceptMacro(InputConvertibleToOutputCheck,
00120 (Concept::Convertible<typename TInputImage::PixelType, typename TOutputImage::PixelType>));
00121 itkConceptMacro(SameDimensionCheck,
00122 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00123
00125 #endif
00126
00127 protected:
00128 ShrinkImageFilter();
00129 ~ShrinkImageFilter() {};
00130 void PrintSelf(std::ostream& os, Indent indent) const;
00131
00142 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00143 int threadId );
00144
00145 private:
00146 ShrinkImageFilter(const Self&);
00147 void operator=(const Self&);
00148
00149 unsigned int m_ShrinkFactors[ImageDimension];
00150 };
00151
00152
00153 }
00154
00155 #ifndef ITK_MANUAL_INSTANTIATION
00156 #include "itkShrinkImageFilter.txx"
00157 #endif
00158
00159 #endif
00160