1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #ifndef __clitkDeformationFieldTransform_h
19 #define __clitkDeformationFieldTransform_h
20 #include "clitkList.h"
21 #include "clitkLists.h"
24 #include "itkTransform.h"
25 #include "itkVectorInterpolateImageFunction.h"
26 #include "itkVectorLinearInterpolateImageFunction.h"
31 template < class TScalarType=double, unsigned int InputDimension=4,unsigned int OutputDimension=4, unsigned int SpaceDimension=3 >
32 class ITK_EXPORT DeformationFieldTransform : public itk::Transform< TScalarType, InputDimension, OutputDimension >
35 /** Standard class typedefs. */
36 typedef DeformationFieldTransform Self;
37 typedef itk::Transform< TScalarType, InputDimension, OutputDimension > Superclass;
38 typedef itk::SmartPointer<Self> Pointer;
39 typedef itk::SmartPointer<const Self> ConstPointer;
41 /** New macro for creation of through the object factory. */
44 /** Run-time type information (and related methods). */
45 itkTypeMacro( DeformationFieldTransform, Transform );
47 /** Standard coordinate point type for this class. */
48 typedef itk::Point<TScalarType, InputDimension> InputPointType;
49 typedef itk::Point<TScalarType, OutputDimension> OutputPointType;
52 typedef itk::Point<double, SpaceDimension> SpacePointType;
53 typedef itk::Vector<double, SpaceDimension> DisplacementType;
54 typedef itk::Image<DisplacementType, InputDimension> DeformationFieldType;
55 typedef itk::VectorInterpolateImageFunction<DeformationFieldType, double> InterpolatorType;
56 typedef itk::VectorLinearInterpolateImageFunction<DeformationFieldType, double> DefaultInterpolatorType;
59 void SetDeformationField (typename DeformationFieldType::Pointer p){m_DeformationField=p; m_Interpolator->SetInputImage(m_DeformationField);}
60 void SetInterpolator (typename InterpolatorType::Pointer i){ m_Interpolator=i; m_Interpolator->SetInputImage(m_DeformationField);}
61 OutputPointType TransformPoint(const InputPointType &point ) const;
64 DeformationFieldTransform();
65 ~DeformationFieldTransform(){;}
68 DeformationFieldTransform(const Self&); //purposely not implemented
69 void operator=(const Self&); //purposely not implemented
71 typename DeformationFieldType::Pointer m_DeformationField;
72 typename InterpolatorType::Pointer m_Interpolator;
75 }; //class DeformationFieldTransform
82 #ifndef ITK_MANUAL_INSTANTIATION
83 #include "clitkDeformationFieldTransform.txx"
86 #endif /* __clitkDeformationFieldTransform_h */