X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkCorrelationRatioImageToImageMetric.txx;h=a400e5100c0819fb46bc8c9bd20f93fdbe35666b;hb=cff1bb0cd9b0850379e20c0594ccd511a3a38133;hp=e7133ca69da81d03113c216b952f4ffc6b1a829c;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/registration/clitkCorrelationRatioImageToImageMetric.txx b/registration/clitkCorrelationRatioImageToImageMetric.txx index e7133ca..a400e51 100644 --- a/registration/clitkCorrelationRatioImageToImageMetric.txx +++ b/registration/clitkCorrelationRatioImageToImageMetric.txx @@ -227,7 +227,7 @@ CorrelationRatioImageToImageMetric FixedImageType> FixedIteratorType; typedef itk::ImageRegionConstIteratorWithIndex< - ITK_TYPENAME Superclass::GradientImageType> GradientIteratorType; + typename Superclass::GradientImageType> GradientIteratorType; FixedIteratorType ti( fixedImage, this->GetFixedImageRegion() ); @@ -240,7 +240,7 @@ CorrelationRatioImageToImageMetric const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( itk::NumericTraits::Zero ); + derivative.Fill( itk::NumericTraits::Zero ); ti.GoToBegin(); @@ -266,8 +266,13 @@ CorrelationRatioImageToImageMetric 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(); @@ -343,7 +348,7 @@ CorrelationRatioImageToImageMetric FixedImageType> FixedIteratorType; typedef itk::ImageRegionConstIteratorWithIndex< - ITK_TYPENAME Superclass::GradientImageType> GradientIteratorType; + typename Superclass::GradientImageType> GradientIteratorType; FixedIteratorType ti( fixedImage, this->GetFixedImageRegion() ); @@ -358,7 +363,7 @@ CorrelationRatioImageToImageMetric const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( NumericTraits::Zero ); + derivative.Fill( NumericTraits::Zero ); ti.GoToBegin(); @@ -384,8 +389,13 @@ CorrelationRatioImageToImageMetric 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();