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: 2006/03/22 16:26:45 $
00007   Version:   $Revision: 1.42 $
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 
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&); //purposely not implemented
00147   void operator=(const Self&); //purposely not implemented
00148 
00149   unsigned int m_ShrinkFactors[ImageDimension];
00150 };
00151 
00152   
00153 } // end namespace itk
00154   
00155 #ifndef ITK_MANUAL_INSTANTIATION
00156 #include "itkShrinkImageFilter.txx"
00157 #endif
00158   
00159 #endif
00160 

Generated at Mon Mar 12 02:59:45 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000