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

itkVectorResampleImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVectorResampleImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/07/27 15:21:12 $
00007   Version:   $Revision: 1.5 $
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 __itkVectorResampleImageFilter_h
00018 #define __itkVectorResampleImageFilter_h
00019 
00020 #include "itkTransform.h"
00021 #include "itkImageFunction.h"
00022 #include "itkImageRegionIterator.h"
00023 #include "itkImageToImageFilter.h"
00024 #include "itkVectorInterpolateImageFunction.h"
00025 #include "itkFixedArray.h"
00026 #include "itkSize.h"
00027 
00028 namespace itk
00029 {
00030 
00055 template <class TInputImage, class TOutputImage>
00056 class ITK_EXPORT VectorResampleImageFilter:
00057     public ImageToImageFilter<TInputImage, TOutputImage>
00058 {
00059 public:
00061   typedef VectorResampleImageFilter         Self;
00062   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00063   typedef SmartPointer<Self>        Pointer;
00064   typedef SmartPointer<const Self>  ConstPointer;
00065   typedef TInputImage InputImageType;
00066   typedef TOutputImage OutputImageType;
00067   typedef typename InputImageType::Pointer InputImagePointer;
00068   typedef typename OutputImageType::Pointer OutputImagePointer;
00069   typedef typename InputImageType::RegionType InputImageRegionType;
00070 
00072   itkNewMacro(Self);  
00073 
00075   itkTypeMacro(VectorResampleImageFilter, ImageToImageFilter);
00076 
00078   itkStaticConstMacro(ImageDimension, unsigned int,
00079                       TOutputImage::ImageDimension);
00080 
00086   typedef Transform<double, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType;
00087   typedef typename TransformType::Pointer TransformPointerType;
00088 
00090   typedef VectorInterpolateImageFunction<InputImageType, double> InterpolatorType;
00091   typedef typename InterpolatorType::Pointer  InterpolatorPointerType;
00092 
00094   typedef Size<itkGetStaticConstMacro(ImageDimension)> SizeType;
00095 
00097   typedef typename TOutputImage::IndexType IndexType;
00098 
00100   typedef typename InterpolatorType::PointType    PointType;
00101 
00103   typedef typename TOutputImage::PixelType   PixelType;
00104   typedef typename PixelType::ValueType      PixelComponentType;
00105 
00107   typedef typename TOutputImage::RegionType OutputImageRegionType;
00108 
00110   typedef typename TOutputImage::SpacingType SpacingType;
00111   typedef typename TOutputImage::PointType   OriginPointType;
00112   
00118   itkSetObjectMacro( Transform, TransformType ); 
00119 
00121   itkGetObjectMacro( Transform, TransformType );
00122 
00125   itkSetObjectMacro( Interpolator, InterpolatorType );
00126 
00128   itkGetObjectMacro( Interpolator, InterpolatorType );
00129 
00131   itkSetMacro( Size, SizeType );
00132 
00134   itkGetConstReferenceMacro( Size, SizeType );
00135      
00138   itkSetMacro(DefaultPixelValue,PixelType);
00139 
00141   itkGetMacro(DefaultPixelValue,PixelType);
00142 
00144   itkSetMacro(OutputSpacing, SpacingType);
00145   virtual void SetOutputSpacing( const double* values);
00146 
00148   itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00149 
00151   itkSetMacro(OutputOrigin, PointType);
00152   virtual void SetOutputOrigin( const double* values);
00153 
00155   itkGetConstReferenceMacro( OutputOrigin, PointType );
00156 
00159   itkSetMacro( OutputStartIndex, IndexType );
00160 
00162   itkGetConstReferenceMacro( OutputStartIndex, IndexType );
00163 
00169   virtual void GenerateOutputInformation();
00170 
00176   virtual void GenerateInputRequestedRegion();
00177 
00180   virtual void BeforeThreadedGenerateData();
00181 
00184   virtual void AfterThreadedGenerateData();
00185 
00187   unsigned long GetMTime( void ) const;
00188 
00189 protected:
00190   VectorResampleImageFilter();
00191   ~VectorResampleImageFilter() {};
00192   void PrintSelf(std::ostream& os, Indent indent) const;
00193 
00202   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00203                             int threadId );
00204 
00205 private:
00206   VectorResampleImageFilter(const Self&); //purposely not implemented
00207   void operator=(const Self&); //purposely not implemented
00208 
00209   SizeType                m_Size;       // Size of the output image
00210   TransformPointerType    m_Transform;  // Coordinate transform to use
00211   InterpolatorPointerType m_Interpolator;
00212   // Image function for interpolation
00213   PixelType               m_DefaultPixelValue; 
00214   // default pixel value if the point 
00215   // is outside the image
00216   SpacingType             m_OutputSpacing; // output image spacing
00217   PointType               m_OutputOrigin;  // output image origin
00218   IndexType               m_OutputStartIndex; // output start index
00219 };
00220 
00221   
00222 } // end namespace itk
00223   
00224 #ifndef ITK_MANUAL_INSTANTIATION
00225 #include "itkVectorResampleImageFilter.txx"
00226 #endif
00227   
00228 #endif

Generated at Thu May 25 00:14:39 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000