X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=registration%2FclitkShapedBLUTSpatioTemporalDeformableTransform.txx;h=cebdb5bae492ec753a7e0e247bf9cf52aa70777b;hb=fa358ee6738c92950cd9e6c45f55dda6e9b4576e;hp=7600276d8c0e4397e62ced6fcf8ef752741f60b6;hpb=657652a78c2e2717a6f77e027049173442ca29f0;p=clitk.git diff --git a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx old mode 100755 new mode 100644 index 7600276..cebdb5b --- a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx +++ b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #ifndef __clitkShapedBLUTSpatioTemporalDeformableTransform_txx #define __clitkShapedBLUTSpatioTemporalDeformableTransform_txx #include "clitkShapedBLUTSpatioTemporalDeformableTransform.h" @@ -32,7 +32,11 @@ namespace clitk // Constructor with default arguments template ShapedBLUTSpatioTemporalDeformableTransform +#if ITK_VERSION_MAJOR >= 4 + ::ShapedBLUTSpatioTemporalDeformableTransform():Superclass(0) +#else ::ShapedBLUTSpatioTemporalDeformableTransform():Superclass(OutputDimension,0) +#endif { unsigned int i; @@ -802,11 +806,19 @@ namespace clitk //===================================== //JV Wrap jacobian into OutputDimension X Vectorial images //===================================== +#if ITK_VERSION_MAJOR >= 4 + this->m_SharedDataBSplineJacobian.set_size( OutputDimension, this->GetNumberOfParameters() ); +#else this->m_Jacobian.set_size( OutputDimension, this->GetNumberOfParameters() ); +#endif // Use memset to set the memory // JV four rows of three comps of parameters +#if ITK_VERSION_MAJOR >= 4 + JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_SharedDataBSplineJacobian.data_block()); +#else JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_Jacobian.data_block()); +#endif memset(jacobianDataPointer, 0, OutputDimension*numberOfPixels*sizeof(JacobianPixelType)); for (unsigned int j=0; j PasteImageFilterType; typedef clitk::ExtractImageFilter ExtractImageFilterType; typedef clitk::LinearCombinationImageFilter LinearCombinationFilterType; - typedef itk::MultiplyByConstantImageFilter MultiplicationFilterType; // Regions typename CoefficientImageType::RegionType sourceRegion=m_PaddedCoefficientImage->GetLargestPossibleRegion(); @@ -2376,11 +2387,17 @@ namespace clitk // JV weights are identical as for transformpoint, could be done simultaneously in metric!!!! // Compute the Jacobian in one position template +#if ITK_VERSION_MAJOR >= 4 + void + ShapedBLUTSpatioTemporalDeformableTransform + ::ComputeJacobianWithRespectToParameters( const InputPointType & point, JacobianType & jacobian) const +#else const typename ShapedBLUTSpatioTemporalDeformableTransform ::JacobianType & ShapedBLUTSpatioTemporalDeformableTransform ::GetJacobian( const InputPointType & point ) const +#endif { //======================================================== @@ -2476,7 +2493,12 @@ namespace clitk if(m_Mask && !(m_Mask->IsInside(point) ) ) { // Outside: no (deformable) displacement +#if ITK_VERSION_MAJOR >= 4 + jacobian = m_SharedDataBSplineJacobian; + return; +#else return this->m_Jacobian; +#endif } // Get index @@ -2486,7 +2508,12 @@ namespace clitk // we assume zero displacement and return the input point if ( !this->InsideValidRegion( m_Index ) ) { +#if ITK_VERSION_MAJOR >= 4 + jacobian = m_SharedDataBSplineJacobian; + return; +#else return this->m_Jacobian; +#endif } // Compute interpolation weights @@ -2654,7 +2681,11 @@ namespace clitk } // Return the result +#if ITK_VERSION_MAJOR >= 4 + jacobian = m_SharedDataBSplineJacobian; +#else return this->m_Jacobian; +#endif }