X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx;h=16ecec4ee09fb9dbe0075ffb11b5d672b2f12cab;hb=1bfa0da6c453a072c0b04003e297dcf0073dc168;hp=511f97392259cdda3a4927e7909bab8ee9b8a18a;hpb=573d80d0f7a17607d2ee883c21c940c0ba020282;p=clitk.git diff --git a/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx b/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx index 511f973..16ecec4 100644 --- a/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx @@ -24,7 +24,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 "clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx" #else @@ -181,13 +181,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( itk::NumericTraits::Zero ); + derivative.Fill( itk::NumericTraits::Zero ); DerivativeType derivativeF = DerivativeType( ParametersDimension ); - derivativeF.Fill( itk::NumericTraits::Zero ); + derivativeF.Fill( itk::NumericTraits::Zero ); DerivativeType derivativeM = DerivativeType( ParametersDimension ); - derivativeM.Fill( itk::NumericTraits::Zero ); + derivativeM.Fill( itk::NumericTraits::Zero ); ti.GoToBegin(); // First compute the sums @@ -251,8 +251,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); const RealType fixedValue = ti.Get(); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian ); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); +#endif // Get the gradient by NearestNeighboorInterpolation: // which is equivalent to round up the point components. @@ -353,16 +358,16 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( itk::NumericTraits::Zero ); + derivative.Fill( itk::NumericTraits::Zero ); DerivativeType derivativeF = DerivativeType( ParametersDimension ); - derivativeF.Fill( itk::NumericTraits::Zero ); + derivativeF.Fill( itk::NumericTraits::Zero ); DerivativeType derivativeM = DerivativeType( ParametersDimension ); - derivativeM.Fill( itk::NumericTraits::Zero ); + derivativeM.Fill( itk::NumericTraits::Zero ); DerivativeType derivativeM1 = DerivativeType( ParametersDimension ); - derivativeM1.Fill( itk::NumericTraits::Zero ); + derivativeM1.Fill( itk::NumericTraits::Zero ); ti.GoToBegin(); // First compute the sums @@ -427,8 +432,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); const RealType fixedValue = ti.Get(); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian ); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); +#endif // Get the gradient by NearestNeighboorInterpolation: // which is equivalent to round up the point components.