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

itkWarpVectorImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkWarpVectorImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-25 12:28:12 $
00007   Version:   $Revision: 1.9 $
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 __itkWarpVectorImageFilter_h
00018 #define __itkWarpVectorImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkVectorInterpolateImageFunction.h"
00022 #include "itkVectorLinearInterpolateImageFunction.h"
00023 #include "itkPoint.h"
00024 #include "itkFixedArray.h"
00025 
00026 namespace itk
00027 {
00028 
00084 template <
00085   class TInputImage,
00086   class TOutputImage,
00087   class TDeformationField
00088   >
00089 class ITK_EXPORT WarpVectorImageFilter :
00090     public ImageToImageFilter<TInputImage, TOutputImage>
00091 {
00092 public:
00094   typedef WarpVectorImageFilter                        Self;
00095   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00096   typedef SmartPointer<Self>                           Pointer;
00097   typedef SmartPointer<const Self>                     ConstPointer;
00098 
00100   itkNewMacro(Self);
00101 
00103   itkTypeMacro( WarpVectorImageFilter, ImageToImageFilter );
00104 
00106   typedef typename TOutputImage::RegionType OutputImageRegionType;
00107 
00109   typedef typename Superclass::InputImageType         InputImageType;
00110   typedef typename Superclass::InputImagePointer      InputImagePointer;
00111   typedef typename Superclass::OutputImageType        OutputImageType;
00112   typedef typename Superclass::OutputImagePointer     OutputImagePointer;
00113   typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
00114 
00115   typedef typename OutputImageType::IndexType            IndexType;
00116   typedef typename OutputImageType::SizeType             SizeType;
00117   typedef typename OutputImageType::PixelType            PixelType;
00118   typedef typename OutputImageType::SpacingType          SpacingType;
00119   typedef typename OutputImageType::PixelType::ValueType ValueType;
00120 
00122   itkStaticConstMacro(ImageDimension, unsigned int,
00123                       TOutputImage::ImageDimension );
00124 
00126   itkStaticConstMacro(PixelDimension, unsigned int,
00127                       PixelType::Dimension );
00128 
00130   typedef TDeformationField                        DeformationFieldType;
00131   typedef typename DeformationFieldType::Pointer   DeformationFieldPointer;
00132   typedef typename DeformationFieldType::PixelType DisplacementType;
00133 
00135   typedef double CoordRepType;
00136   typedef VectorInterpolateImageFunction<InputImageType,CoordRepType>   InterpolatorType;
00137   typedef typename InterpolatorType::Pointer   InterpolatorPointer;
00138   typedef VectorLinearInterpolateImageFunction<InputImageType,CoordRepType>
00139   DefaultInterpolatorType;
00140 
00142   typedef Point<CoordRepType,itkGetStaticConstMacro(ImageDimension)> PointType;
00143 
00145   typedef typename TOutputImage::DirectionType     DirectionType;
00146 
00148   void SetDeformationField( const DeformationFieldType * field );
00149 
00151   void SetDeformationField( DeformationFieldType * field );
00152 
00154   DeformationFieldType * GetDeformationField(void);
00155 
00157   itkSetObjectMacro( Interpolator, InterpolatorType );
00158 
00160   itkGetObjectMacro( Interpolator, InterpolatorType );
00161 
00163   itkSetMacro(OutputSpacing, SpacingType);
00164   virtual void SetOutputSpacing( const double* values);
00166 
00168   itkGetConstReferenceMacro(OutputSpacing, SpacingType);
00169 
00171   itkSetMacro(OutputOrigin, PointType);
00172   virtual void SetOutputOrigin( const double* values);
00174 
00176   itkGetConstReferenceMacro(OutputOrigin, PointType);
00177 
00179   itkSetMacro(OutputDirection, DirectionType );
00180   itkGetConstReferenceMacro(OutputDirection, DirectionType );
00182 
00184   itkSetMacro( EdgePaddingValue, PixelType );
00185 
00187   itkGetConstMacro( EdgePaddingValue, PixelType );
00188 
00194   virtual void GenerateOutputInformation();
00195 
00202   virtual void GenerateInputRequestedRegion();
00203 
00206   virtual void BeforeThreadedGenerateData();
00207 
00208 #ifdef ITK_USE_CONCEPT_CHECKING
00209 
00210   itkConceptMacro(InputHasNumericTraitsCheck,
00211     (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
00212   itkConceptMacro(OutputHasNumericTraitsCheck,
00213     (Concept::HasNumericTraits<ValueType>));
00214   itkConceptMacro(DeformationFieldHasNumericTraitsCheck,
00215     (Concept::HasNumericTraits<typename TDeformationField::PixelType::ValueType>));
00216 
00218 #endif
00219 
00220 protected:
00221   WarpVectorImageFilter();
00222   ~WarpVectorImageFilter() {};
00223   void PrintSelf(std::ostream& os, Indent indent) const;
00224 
00228   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00229                             int threadId );
00230 
00231 private:
00232   WarpVectorImageFilter(const Self&); //purposely not implemented
00233   void operator=(const Self&); //purposely not implemented
00234 
00235   PixelType                  m_EdgePaddingValue;
00236   SpacingType                m_OutputSpacing;
00237   PointType                  m_OutputOrigin;
00238   DirectionType              m_OutputDirection;
00239 
00240   InterpolatorPointer        m_Interpolator;
00241   
00242 };
00243 
00244 } // end namespace itk
00245 
00246 #ifndef ITK_MANUAL_INSTANTIATION
00247 #include "itkWarpVectorImageFilter.txx"
00248 #endif
00249 
00250 #endif
00251 

Generated at Fri Apr 16 20:02:41 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000