X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FitkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx;h=d6793e58e18fe1a9106f3ad3b4633058266462f3;hb=7f7c290c75d4917446f8751856ae7d450f58a6f0;hp=c9d78617047dcd0f32c452a8da6129941974dcc4;hpb=c18059db4f507fd31b5898667f57eced7d48c5f7;p=clitk.git diff --git a/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx b/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx index c9d7861..d6793e5 100644 --- a/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.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 -======================================================================-====*/ +===========================================================================**/ /*========================================================================= @@ -40,7 +40,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 "itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.txx" #else @@ -171,7 +171,7 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( NumericTraits::Zero ); + derivative.Fill( NumericTraits::Zero ); ti.GoToBegin(); @@ -197,9 +197,13 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) { const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian ); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); - +#endif const RealType fixedValue = ti.Value(); this->m_NumberOfPixelsCounted++; @@ -285,7 +289,7 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( NumericTraits::Zero ); + derivative.Fill( NumericTraits::Zero ); ti.GoToBegin(); @@ -311,9 +315,13 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) { const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian ); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); - +#endif const RealType fixedValue = ti.Value(); this->m_NumberOfPixelsCounted++;