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

itkResampleImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkResampleImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:28:55 $
00007   Version:   $Revision: 1.26 $
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      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkResampleImageFilter_h
00018 #define __itkResampleImageFilter_h
00019 
00020 #include "itkTransform.h"
00021 #include "itkImageFunction.h"
00022 #include "itkImageRegionIterator.h"
00023 #include "itkImageToImageFilter.h"
00024 #include "itkInterpolateImageFunction.h"
00025 #include "itkSize.h"
00026 
00027 namespace itk
00028 {
00029 
00060 template <class TInputImage, class TOutputImage>
00061 class ITK_EXPORT ResampleImageFilter:
00062     public ImageToImageFilter<TInputImage, TOutputImage>
00063 {
00064 public:
00066   typedef ResampleImageFilter         Self;
00067   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00068   typedef SmartPointer<Self>        Pointer;
00069   typedef SmartPointer<const Self>  ConstPointer;
00070   typedef TInputImage InputImageType;
00071   typedef TOutputImage OutputImageType;
00072   typedef typename InputImageType::Pointer InputImagePointer;
00073   typedef typename OutputImageType::Pointer OutputImagePointer;
00074   typedef typename InputImageType::RegionType InputImageRegionType;
00075 
00077   itkNewMacro(Self);  
00078 
00080   itkTypeMacro(ResampleImageFilter, ImageToImageFilter);
00081 
00083   itkStaticConstMacro(ImageDimension, unsigned int,
00084                       TOutputImage::ImageDimension);
00085 
00091   typedef Transform<double, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType;
00092   typedef typename TransformType::Pointer TransformPointerType;
00093 
00095   typedef InterpolateImageFunction<InputImageType, double> InterpolatorType;
00096   typedef typename InterpolatorType::Pointer  InterpolatorPointerType;
00097 
00099   typedef Size<itkGetStaticConstMacro(ImageDimension)> SizeType;
00100 
00102   typedef typename TOutputImage::IndexType IndexType;
00103 
00105   typedef typename InterpolatorType::PointType    PointType;
00106 
00108   typedef typename TOutputImage::PixelType   PixelType;
00109 
00111   typedef typename TOutputImage::RegionType OutputImageRegionType;
00112 
00118   itkSetObjectMacro( Transform, TransformType ); 
00119 
00121   itkGetObjectMacro( Transform, TransformType );
00122 
00129   itkSetObjectMacro( Interpolator, InterpolatorType );
00130 
00132   itkGetObjectMacro( Interpolator, InterpolatorType );
00133 
00135   itkSetMacro( Size, SizeType );
00136 
00138   itkGetConstReferenceMacro( Size, SizeType );
00139      
00142   itkSetMacro(DefaultPixelValue,PixelType);
00143 
00145   itkGetMacro(DefaultPixelValue,PixelType);
00146 
00148   virtual void SetOutputSpacing( const double values[ImageDimension] );
00149 
00151   const double * GetOutputSpacing()
00152   { return m_OutputSpacing; }
00153 
00155   virtual void SetOutputOrigin( const double values[ImageDimension] );
00156 
00158   const double * GetOutputOrigin()
00159   { return m_OutputSpacing; }
00160 
00161 
00167   virtual void GenerateOutputInformation();
00168 
00174   virtual void GenerateInputRequestedRegion();
00175 
00178   virtual void BeforeThreadedGenerateData();
00179 
00181   unsigned long GetMTime( void ) const;
00182 
00183 protected:
00184   ResampleImageFilter();
00185   ~ResampleImageFilter() {};
00186   void PrintSelf(std::ostream& os, Indent indent) const;
00187 
00196   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00197                             int threadId );
00198 
00199 private:
00200   ResampleImageFilter(const Self&); //purposely not implemented
00201   void operator=(const Self&); //purposely not implemented
00202 
00203   SizeType                m_Size;       // Size of the output image
00204   TransformPointerType    m_Transform;  // Coordinate transform to use
00205   InterpolatorPointerType m_Interpolator;
00206   // Image function for interpolation
00207   PixelType               m_DefaultPixelValue; 
00208   // default pixel value if the point 
00209   // is outside the image
00210   double                  m_OutputSpacing[ImageDimension]; // output image spacing
00211   double                  m_OutputOrigin[ImageDimension];  // output image origin
00212 
00213 };
00214 
00215   
00216 } // end namespace itk
00217   
00218 #ifndef ITK_MANUAL_INSTANTIATION
00219 #include "itkResampleImageFilter.txx"
00220 #endif
00221   
00222 #endif

Generated at Tue Sep 16 11:32:08 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000