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: 2002/12/15 00:43:05 $
00007   Version:   $Revision: 1.23 $
00008 
00009   Copyright (c) 2002 Insight 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 
00051 template <class TInputImage, class TOutputImage>
00052 class ITK_EXPORT ResampleImageFilter:
00053     public ImageToImageFilter<TInputImage, TOutputImage>
00054 {
00055 public:
00057   typedef ResampleImageFilter         Self;
00058   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00059   typedef SmartPointer<Self>        Pointer;
00060   typedef SmartPointer<const Self>  ConstPointer;
00061   typedef TInputImage InputImageType;
00062   typedef TOutputImage OutputImageType;
00063   typedef typename InputImageType::Pointer InputImagePointer;
00064   typedef typename OutputImageType::Pointer OutputImagePointer;
00065   typedef typename InputImageType::RegionType InputImageRegionType;
00066 
00068   itkNewMacro(Self);  
00069 
00071   itkTypeMacro(ResampleImageFilter, ImageToImageFilter);
00072 
00074   itkStaticConstMacro(ImageDimension, unsigned int,
00075                       TOutputImage::ImageDimension);
00076 
00082   typedef Transform<double, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType;
00083   typedef typename TransformType::Pointer TransformPointerType;
00084 
00086   typedef InterpolateImageFunction<InputImageType, double> InterpolatorType;
00087   typedef typename InterpolatorType::Pointer  InterpolatorPointerType;
00088 
00090   typedef Size<itkGetStaticConstMacro(ImageDimension)> SizeType;
00091 
00093   typedef typename TOutputImage::IndexType IndexType;
00094 
00096   typedef typename InterpolatorType::PointType    PointType;
00097 
00099   typedef typename TOutputImage::PixelType   PixelType;
00100 
00102   typedef typename TOutputImage::RegionType OutputImageRegionType;
00103 
00108   itkSetObjectMacro( Transform, TransformType ); 
00109 
00111   itkGetObjectMacro( Transform, TransformType );
00112 
00114   itkSetObjectMacro( Interpolator, InterpolatorType );
00115 
00117   itkGetObjectMacro( Interpolator, InterpolatorType );
00118 
00120   itkSetMacro( Size, SizeType );
00121 
00123   itkGetConstReferenceMacro( Size, SizeType );
00124      
00126   itkSetMacro(DefaultPixelValue,PixelType);
00127 
00129   itkGetMacro(DefaultPixelValue,PixelType);
00130 
00132   virtual void SetOutputSpacing( const double values[ImageDimension] );
00133 
00135   const double * GetOutputSpacing()
00136     { return m_OutputSpacing; }
00137 
00139   virtual void SetOutputOrigin( const double values[ImageDimension] );
00140 
00142   const double * GetOutputOrigin()
00143     { return m_OutputSpacing; }
00144 
00145 
00151   virtual void GenerateOutputInformation();
00152 
00158   virtual void GenerateInputRequestedRegion();
00159 
00162   virtual void BeforeThreadedGenerateData();
00163 
00165   unsigned long GetMTime( void ) const;
00166 
00167 protected:
00168   ResampleImageFilter();
00169   ~ResampleImageFilter() {};
00170   void PrintSelf(std::ostream& os, Indent indent) const;
00171 
00180   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00181                             int threadId );
00182 
00183 private:
00184   ResampleImageFilter(const Self&); //purposely not implemented
00185   void operator=(const Self&); //purposely not implemented
00186 
00187   SizeType                m_Size;       // Size of the output image
00188   TransformPointerType    m_Transform;  // Coordinate transform to use
00189   InterpolatorPointerType m_Interpolator;
00190                                         // Image function for interpolation
00191   PixelType               m_DefaultPixelValue; 
00192                                         // default pixel value if the point 
00193                                         // is outside the image
00194   double                  m_OutputSpacing[ImageDimension]; // output image spacing
00195   double                  m_OutputOrigin[ImageDimension];  // output image origin
00196 
00197 };
00198 
00199   
00200 } // end namespace itk
00201   
00202 #ifndef ITK_MANUAL_INSTANTIATION
00203 #include "itkResampleImageFilter.txx"
00204 #endif
00205   
00206 #endif

Generated at Fri May 21 01:15:15 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000