]> Creatis software - clitk.git/blob - registration/clitkDeformationFieldTransform.h
*** empty log message ***
[clitk.git] / registration / clitkDeformationFieldTransform.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
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"
22
23 // itk
24 #include "itkTransform.h"
25 #include "itkVectorInterpolateImageFunction.h"
26 #include "itkVectorLinearInterpolateImageFunction.h"
27
28 namespace clitk
29 {
30
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 >
33   {
34   public:
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;
40       
41     /** New macro for creation of through the object factory. */
42     itkNewMacro( Self );
43
44     /** Run-time type information (and related methods). */
45     itkTypeMacro( DeformationFieldTransform, Transform );
46
47     /** Standard coordinate point type for this class. */
48     typedef itk::Point<TScalarType, InputDimension> InputPointType;
49     typedef itk::Point<TScalarType, OutputDimension> OutputPointType;
50
51     // typedef 
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;
57
58     // Members
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;
62    
63   protected:
64     DeformationFieldTransform();
65     ~DeformationFieldTransform(){;}
66
67   private:
68     DeformationFieldTransform(const Self&); //purposely not implemented
69     void operator=(const Self&); //purposely not implemented
70
71     typename DeformationFieldType::Pointer m_DeformationField;
72     typename InterpolatorType::Pointer m_Interpolator;
73
74
75   }; //class DeformationFieldTransform
76
77
78
79 }  // namespace itk
80
81
82 #ifndef ITK_MANUAL_INSTANTIATION
83 #include "clitkDeformationFieldTransform.txx"
84 #endif
85
86 #endif /* __clitkDeformationFieldTransform_h */