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: 2007/03/03 00:17:37 $
00007   Version:   $Revision: 1.11 $
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   typedef TInputImage InputImageType;
00066   typedef TOutputImage OutputImageType;
00067   typedef typename InputImageType::Pointer InputImagePointer;
00068   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00069   typedef typename OutputImageType::Pointer OutputImagePointer;
00070   typedef typename InputImageType::RegionType InputImageRegionType;
00071 
00073   itkNewMacro(Self);  
00074 
00076   itkTypeMacro(VectorResampleImageFilter, ImageToImageFilter);
00077 
00079   itkStaticConstMacro(ImageDimension, unsigned int,
00080                       TOutputImage::ImageDimension);
00081 
00087   typedef Transform<TInterpolatorPrecisionType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType;
00088   typedef typename TransformType::ConstPointer TransformPointerType;
00089 
00091   typedef VectorInterpolateImageFunction<InputImageType, TInterpolatorPrecisionType> InterpolatorType;
00092   typedef typename InterpolatorType::Pointer  InterpolatorPointerType;
00093 
00095   typedef Size<itkGetStaticConstMacro(ImageDimension)> SizeType;
00096 
00098   typedef typename TOutputImage::IndexType IndexType;
00099 
00101   typedef typename InterpolatorType::PointType    PointType;
00102 
00104   typedef typename TOutputImage::PixelType   PixelType;
00105   typedef typename PixelType::ValueType      PixelComponentType;
00106 
00108   typedef typename TOutputImage::RegionType OutputImageRegionType;
00109 
00111   typedef typename TOutputImage::SpacingType SpacingType;
00112   typedef typename TOutputImage::PointType   OriginPointType;
00113   typedef typename TOutputImage::DirectionType DirectionType;
00114 
00120   itkSetConstObjectMacro( Transform, TransformType ); 
00121 
00123   itkGetConstObjectMacro( Transform, TransformType );
00124 
00127   itkSetObjectMacro( Interpolator, InterpolatorType );
00128 
00130   itkGetConstObjectMacro( Interpolator, InterpolatorType );
00131 
00133   itkSetMacro( Size, SizeType );
00134 
00136   itkGetConstReferenceMacro( Size, SizeType );
00137 
00140   itkSetMacro(DefaultPixelValue,PixelType);
00141 
00143   itkGetMacro(DefaultPixelValue,PixelType);
00144 
00146   itkSetMacro(OutputSpacing, SpacingType);
00147   virtual void SetOutputSpacing( const double* values);
00149 
00151   itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00152 
00154   itkSetMacro(OutputOrigin, PointType);
00155   virtual void SetOutputOrigin( const double* values);
00157 
00159   itkGetConstReferenceMacro( OutputOrigin, PointType );
00160 
00162   itkSetMacro(OutputDirection, DirectionType);
00163   itkGetConstReferenceMacro(OutputDirection, DirectionType);
00165 
00168   itkSetMacro( OutputStartIndex, IndexType );
00169 
00171   itkGetConstReferenceMacro( OutputStartIndex, IndexType );
00172 
00178   virtual void GenerateOutputInformation();
00179 
00185   virtual void GenerateInputRequestedRegion();
00186 
00189   virtual void BeforeThreadedGenerateData();
00190 
00193   virtual void AfterThreadedGenerateData();
00194 
00196   unsigned long GetMTime( void ) const;
00197 
00198 #ifdef ITK_USE_CONCEPT_CHECKING
00199 
00200   itkConceptMacro(InputHasNumericTraitsCheck,
00201     (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
00202   itkConceptMacro(OutputHasNumericTraitsCheck,
00203     (Concept::HasNumericTraits<PixelComponentType>));
00204 
00206 #endif
00207 
00208 protected:
00209   VectorResampleImageFilter();
00210   ~VectorResampleImageFilter() {};
00211   void PrintSelf(std::ostream& os, Indent indent) const;
00212 
00221   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00222                             int threadId );
00223 
00224 private:
00225   VectorResampleImageFilter(const Self&); //purposely not implemented
00226   void operator=(const Self&); //purposely not implemented
00227 
00228   SizeType                m_Size;       // Size of the output image
00229   TransformPointerType    m_Transform;  // Coordinate transform to use
00230   InterpolatorPointerType m_Interpolator;
00231   // Image function for interpolation
00232   PixelType               m_DefaultPixelValue; 
00233   // default pixel value if the point 
00234   // is outside the image
00235   SpacingType             m_OutputSpacing; // output image spacing
00236   PointType               m_OutputOrigin;  // output image origin
00237   DirectionType           m_OutputDirection; // output image direction cosines
00238   IndexType               m_OutputStartIndex; // output start index
00239 };
00240 
00241   
00242 } // end namespace itk
00243   
00244 #ifndef ITK_MANUAL_INSTANTIATION
00245 #include "itkVectorResampleImageFilter.txx"
00246 #endif
00247   
00248 #endif
00249 

Generated at Mon Mar 12 03:23:28 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000