27template <
class PrecisionType>
28void interpolantCubicSpline( PrecisionType ratio, PrecisionType *basis )
30 if (ratio < 0.0) ratio = 0.0;
31 PrecisionType FF = ratio * ratio;
32 basis[0] = (PrecisionType)((ratio * ((2.0 - ratio)*ratio - 1.0)) / 2.0);
33 basis[1] = (PrecisionType)((FF * (3.0*ratio - 5.0) + 2.0) / 2.0);
34 basis[2] = (PrecisionType)((ratio * ((4.0 - 3.0*ratio)*ratio + 1.0)) / 2.0);
35 basis[3] = (PrecisionType)((ratio - 1.0) * FF / 2.0);
38template <
class PrecisionType>
39void interpolantCubicSpline( PrecisionType ratio, PrecisionType *basis, PrecisionType *derivative )
41 interpolantCubicSpline<PrecisionType>( ratio, basis );
42 if (ratio < 0.0) ratio = 0.0;
43 PrecisionType FF = ratio * ratio;
44 derivative[0] = (PrecisionType)((4.0*ratio - 3.0*FF - 1.0) / 2.0);
45 derivative[1] = (PrecisionType)((9.0*ratio - 10.0) * ratio / 2.0);
46 derivative[2] = (PrecisionType)((8.0*ratio - 9.0*FF + 1) / 2.0);
47 derivative[3] = (PrecisionType)((3.0*ratio - 2.0) * ratio / 2.0);
76 virtual void SetParameters( PrecisionType* paramsIn,
bool parametersAreDisplacements ) = 0;
109 void TransformImage( nifti_image* sourceImage, nifti_image* warpedImage );
124 nifti_image* warpedImage, nifti_image* warpedWeightsImage );
128 virtual std::shared_ptr<Transformation>
DeepCopy() = 0;
206 void TrilinearTransformImageAdjoint( nifti_image * sourceImage, nifti_image * sourceWeightsImage, nifti_image * warpedImage, nifti_image * warpedWeightsImage );
207 void BilinearTransformImageAdjoint( nifti_image * sourceImage, nifti_image * sourceWeightsImage, nifti_image * warpedImage, nifti_image * warpedWeightsImage );