X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FitkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx;h=9391dc23898a7045fec8c1c55475695c9399dc6e;hb=6d86b71b2f5fb9737cf57e55fa809219aa07d226;hp=852583b8373c52a804e9e007b329bf07edd6c645;hpb=eddba34cfd972c817bdfba337a9c866b3ae5c410;p=clitk.git diff --git a/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx b/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx index 852583b..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 @@ -54,11 +54,7 @@ #include "itkImageRegionIterator.h" #include "itkImageIterator.h" #include "vnl/vnl_math.h" -#if ITK_VERSION_MAJOR >= 4 - #include "itkBSplineTransform.h" -#else - #include "itkBSplineDeformableTransform.h" -#endif +#include "itkBSplineDeformableTransform.h" namespace itk { @@ -1445,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; @@ -1480,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++ ) {