X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FitkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx;h=9391dc23898a7045fec8c1c55475695c9399dc6e;hb=8384566019af2b9625646827e4de339869352c43;hp=171ed4763f8db8d11c29573ab75dc47c609a85c7;hpb=c18059db4f507fd31b5898667f57eced7d48c5f7;p=clitk.git diff --git a/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx b/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx index 171ed47..9391dc2 100644 --- a/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.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 -======================================================================-====*/ +===========================================================================**/ /*========================================================================= @@ -41,7 +41,7 @@ // gets integrated into the main directories. #include "itkConfigure.h" -#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS +#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4 #include "itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx" #else @@ -1441,9 +1441,13 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD // Compute the transform Jacobian. typedef typename TransformType::JacobianType JacobianType; - const JacobianType& jacobian = - this->m_Transform->GetJacobian( - m_FixedImageSamples[sampleNumber].FixedImagePointValue ); +#if ITK_VERSION_MAJOR >= 4 + JacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( m_FixedImageSamples[sampleNumber].FixedImagePointValue, jacobian ); +#else + const JacobianType & jacobian = + this->m_Transform->GetJacobian( m_FixedImageSamples[sampleNumber].FixedImagePointValue ); +#endif for ( unsigned int mu = 0; mu < m_NumberOfParameters; mu++ ) { double innerProduct = 0.0; @@ -1476,8 +1480,13 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD weights = m_BSplineTransformWeightsArray[sampleNumber]; indices = m_BSplineTransformIndicesArray[sampleNumber]; } else { +#if ITK_VERSION_MAJOR >= 4 + m_BSplineTransform->ComputeJacobianFromBSplineWeightsWithRespectToPosition( + m_FixedImageSamples[sampleNumber].FixedImagePointValue, m_Weights, m_Indices ); +#else m_BSplineTransform->GetJacobian( m_FixedImageSamples[sampleNumber].FixedImagePointValue, m_Weights, m_Indices ); +#endif } for( unsigned int dim = 0; dim < FixedImageDimension; dim++ ) {