Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkShrinkImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkShrinkImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-09 18:34:25 $
00007   Version:   $Revision: 1.46 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
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&); //purposely not implemented
00152   void operator=(const Self&); //purposely not implemented
00153 
00154   unsigned int m_ShrinkFactors[ImageDimension];
00155 };
00156 
00157   
00158 } // end namespace itk
00159   
00160 #ifndef ITK_MANUAL_INSTANTIATION
00161 #include "itkShrinkImageFilter.txx"
00162 #endif
00163   
00164 #endif
00165 

Generated at Tue Sep 15 04:57:24 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000