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
00078 typedef typename TOutputImage::IndexType OutputIndexType;
00079 typedef typename TInputImage::IndexType InputIndexType;
00080 typedef typename TOutputImage::OffsetType OutputOffsetType;
00081
00083 typedef typename TOutputImage::RegionType OutputImageRegionType;
00084
00086 itkStaticConstMacro(ImageDimension, unsigned int,
00087 TInputImage::ImageDimension );
00088 itkStaticConstMacro(OutputImageDimension, unsigned int,
00089 TOutputImage::ImageDimension );
00091
00094 void SetShrinkFactors( unsigned int factors[] );
00095 void SetShrinkFactors( unsigned int factor );
00096 void SetShrinkFactor( unsigned int i, unsigned int factor )
00097 {
00098 m_ShrinkFactors[i] = factor;
00099 }
00101
00103 const unsigned int * GetShrinkFactors() const
00104 { return m_ShrinkFactors; }
00105
00113 virtual void GenerateOutputInformation();
00114
00120 virtual void GenerateInputRequestedRegion();
00121
00122 #ifdef ITK_USE_CONCEPT_CHECKING
00123
00124 itkConceptMacro(InputConvertibleToOutputCheck,
00125 (Concept::Convertible<typename TInputImage::PixelType, typename TOutputImage::PixelType>));
00126 itkConceptMacro(SameDimensionCheck,
00127 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00128
00130 #endif
00131
00132 protected:
00133 ShrinkImageFilter();
00134 ~ShrinkImageFilter() {};
00135 void PrintSelf(std::ostream& os, Indent indent) const;
00136
00147 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00148 int threadId );
00149
00150 private:
00151 ShrinkImageFilter(const Self&);
00152 void operator=(const Self&);
00153
00154 unsigned int m_ShrinkFactors[ImageDimension];
00155 };
00156
00157
00158 }
00159
00160 #ifndef ITK_MANUAL_INSTANTIATION
00161 #include "itkShrinkImageFilter.txx"
00162 #endif
00163
00164 #endif
00165