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: 2009-04-25 12:28:12 $
00007   Version:   $Revision: 1.13 $
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, class TInterpolatorPrecisionType=double>
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 
00066   typedef TInputImage                           InputImageType;
00067   typedef TOutputImage                          OutputImageType;
00068   typedef typename InputImageType::Pointer      InputImagePointer;
00069   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00070   typedef typename OutputImageType::Pointer     OutputImagePointer;
00071   typedef typename InputImageType::RegionType   InputImageRegionType;
00072 
00074   itkNewMacro(Self);  
00075 
00077   itkTypeMacro(VectorResampleImageFilter, ImageToImageFilter);
00078 
00080   itkStaticConstMacro(ImageDimension, unsigned int,
00081                       TOutputImage::ImageDimension);
00082 
00088   typedef Transform<TInterpolatorPrecisionType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType;
00089   typedef typename TransformType::ConstPointer TransformPointerType;
00090 
00092   typedef VectorInterpolateImageFunction<InputImageType, TInterpolatorPrecisionType> InterpolatorType;
00093   typedef typename InterpolatorType::Pointer  InterpolatorPointerType;
00094 
00096   typedef Size<itkGetStaticConstMacro(ImageDimension)> SizeType;
00097 
00099   typedef typename TOutputImage::IndexType IndexType;
00100 
00102   typedef typename InterpolatorType::PointType    PointType;
00103 
00105   typedef typename TOutputImage::PixelType   PixelType;
00106   typedef typename PixelType::ValueType      PixelComponentType;
00107 
00109   typedef typename TOutputImage::RegionType OutputImageRegionType;
00110 
00112   typedef typename TOutputImage::SpacingType   SpacingType;
00113   typedef typename TOutputImage::PointType     OriginPointType;
00114   typedef typename TOutputImage::DirectionType DirectionType;
00115 
00121   itkSetConstObjectMacro( Transform, TransformType ); 
00122 
00124   itkGetConstObjectMacro( Transform, TransformType );
00125 
00128   itkSetObjectMacro( Interpolator, InterpolatorType );
00129 
00131   itkGetConstObjectMacro( Interpolator, InterpolatorType );
00132 
00134   itkSetMacro( Size, SizeType );
00135 
00137   itkGetConstReferenceMacro( Size, SizeType );
00138 
00141   itkSetMacro(DefaultPixelValue,PixelType);
00142 
00144   itkGetConstMacro(DefaultPixelValue,PixelType);
00145 
00147   itkSetMacro(OutputSpacing, SpacingType);
00148   virtual void SetOutputSpacing( const double* values);
00150 
00152   itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00153 
00155   itkSetMacro(OutputOrigin, PointType);
00156   virtual void SetOutputOrigin( const double* values);
00158 
00160   itkGetConstReferenceMacro( OutputOrigin, PointType );
00161 
00163   itkSetMacro(OutputDirection, DirectionType);
00164   itkGetConstReferenceMacro(OutputDirection, DirectionType);
00166 
00169   itkSetMacro( OutputStartIndex, IndexType );
00170 
00172   itkGetConstReferenceMacro( OutputStartIndex, IndexType );
00173 
00179   virtual void GenerateOutputInformation();
00180 
00186   virtual void GenerateInputRequestedRegion();
00187 
00190   virtual void BeforeThreadedGenerateData();
00191 
00194   virtual void AfterThreadedGenerateData();
00195 
00197   unsigned long GetMTime( void ) const;
00198 
00199 #ifdef ITK_USE_CONCEPT_CHECKING
00200 
00201   itkConceptMacro(InputHasNumericTraitsCheck,
00202     (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
00203   itkConceptMacro(OutputHasNumericTraitsCheck,
00204     (Concept::HasNumericTraits<PixelComponentType>));
00205 
00207 #endif
00208 
00209 protected:
00210   VectorResampleImageFilter();
00211   ~VectorResampleImageFilter() {};
00212   void PrintSelf(std::ostream& os, Indent indent) const;
00213 
00222   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00223                             int threadId );
00224 
00225 private:
00226   VectorResampleImageFilter(const Self&); //purposely not implemented
00227   void operator=(const Self&); //purposely not implemented
00228 
00229   SizeType                m_Size;       // Size of the output image
00230   TransformPointerType    m_Transform;  // Coordinate transform to use
00231   InterpolatorPointerType m_Interpolator;
00232   // Image function for interpolation
00233   PixelType               m_DefaultPixelValue; 
00234   // default pixel value if the point 
00235   // is outside the image
00236   SpacingType             m_OutputSpacing; // output image spacing
00237   PointType               m_OutputOrigin;  // output image origin
00238   DirectionType           m_OutputDirection; // output image direction cosines
00239   IndexType               m_OutputStartIndex; // output start index
00240 };
00241 
00242   
00243 } // end namespace itk
00244   
00245 #ifndef ITK_MANUAL_INSTANTIATION
00246 #include "itkVectorResampleImageFilter.txx"
00247 #endif
00248   
00249 #endif
00250 

Generated at Mon Jul 12 2010 20:13:10 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000