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_txx
19 #define __clitkDeformationFieldTransform_txx
20 #include "clitkDeformationFieldTransform.h"
27 template<class TScalarType, unsigned int InputDimension, unsigned int OutputDimension, unsigned int SpaceDimension>
28 DeformationFieldTransform<TScalarType, InputDimension, OutputDimension, SpaceDimension>
29 ::DeformationFieldTransform():Superclass(OutputDimension,1)
31 m_DeformationField=NULL;
32 m_Interpolator=DefaultInterpolatorType::New();
36 template<class TScalarType, unsigned int InputDimension,unsigned int OutputDimension, unsigned int SpaceDimension>
37 typename DeformationFieldTransform<TScalarType, InputDimension, OutputDimension, SpaceDimension>::OutputPointType
38 DeformationFieldTransform<TScalarType, InputDimension, OutputDimension, SpaceDimension>::
39 TransformPoint(const InputPointType &inputPoint) const
41 OutputPointType outputPoint;
43 for (unsigned int i=0;i<min(OutputDimension,InputDimension); i++) outputPoint[i]=inputPoint[i];
44 DisplacementType displacement;
45 if (m_Interpolator->IsInsideBuffer(inputPoint) )
47 displacement=m_Interpolator->Evaluate(inputPoint);
48 for (unsigned int i=0;i<min(OutputDimension,SpaceDimension); i++)
49 outputPoint[i]+=displacement[i];
54 else return outputPoint;