X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FitkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx;h=9391dc23898a7045fec8c1c55475695c9399dc6e;hb=6d86b71b2f5fb9737cf57e55fa809219aa07d226;hp=f13fe2aa81b9d950cdb80795f5f0d640d92ae947;hpb=573d80d0f7a17607d2ee883c21c940c0ba020282;p=clitk.git diff --git a/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx b/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx index f13fe2a..9391dc2 100644 --- a/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx @@ -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++ ) {