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://www.centreleonberard.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 #if ITK_VERSION_MAJOR >= 4
30 ::DeformationFieldTransform():Superclass(1)
32 ::DeformationFieldTransform():Superclass(OutputDimension,1)
35 m_DeformationField=NULL;
36 m_Interpolator=DefaultInterpolatorType::New();
40 template<class TScalarType, unsigned int InputDimension,unsigned int OutputDimension, unsigned int SpaceDimension>
41 typename DeformationFieldTransform<TScalarType, InputDimension, OutputDimension, SpaceDimension>::OutputPointType
42 DeformationFieldTransform<TScalarType, InputDimension, OutputDimension, SpaceDimension>::
43 TransformPoint(const InputPointType &inputPoint) const
45 OutputPointType outputPoint;
47 for (unsigned int i=0;i<min(OutputDimension,InputDimension); i++) outputPoint[i]=inputPoint[i];
48 DisplacementType displacement;
49 if (m_Interpolator->IsInsideBuffer(inputPoint) )
51 displacement=m_Interpolator->Evaluate(inputPoint);
52 for (unsigned int i=0;i<min(OutputDimension,SpaceDimension); i++)
53 outputPoint[i]+=displacement[i];
58 else return outputPoint;