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
00084 void SetShrinkFactors( unsigned int factors[] );
00085 void SetShrinkFactors( unsigned int factor );
00086 void SetShrinkFactor( unsigned int i, unsigned int factor )
00087 {
00088 m_ShrinkFactors[i] = factor;
00089 }
00090
00092 const unsigned int * GetShrinkFactors() const
00093 { return m_ShrinkFactors; }
00094
00102 virtual void GenerateOutputInformation();
00103
00109 virtual void GenerateInputRequestedRegion();
00110
00111 protected:
00112 ShrinkImageFilter();
00113 ~ShrinkImageFilter() {};
00114 void PrintSelf(std::ostream& os, Indent indent) const;
00115
00126 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00127 int threadId );
00128
00129 private:
00130 ShrinkImageFilter(const Self&);
00131 void operator=(const Self&);
00132
00133 unsigned int m_ShrinkFactors[ImageDimension];
00134 };
00135
00136
00137 }
00138
00139 #ifndef ITK_MANUAL_INSTANTIATION
00140 #include "itkShrinkImageFilter.txx"
00141 #endif
00142
00143 #endif