X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkCorrelationRatioImageToImageMetric.txx;h=f6b5af11cb7abae02d367d9fc80dce70257ceaae;hb=8d51bd1cb7e9ca416b46677dcd73ba76d107a587;hp=aac2a786560e270580faafdee5155b488b327fde;hpb=c4de479fec231c7d53555dcd21d308f06aad17ec;p=clitk.git diff --git a/registration/clitkCorrelationRatioImageToImageMetric.txx b/registration/clitkCorrelationRatioImageToImageMetric.txx index aac2a78..f6b5af1 100644 --- a/registration/clitkCorrelationRatioImageToImageMetric.txx +++ b/registration/clitkCorrelationRatioImageToImageMetric.txx @@ -51,7 +51,11 @@ CorrelationRatioImageToImageMetric template void CorrelationRatioImageToImageMetric +#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 )) +::Initialize(void) +#else ::Initialize(void) throw ( ExceptionObject ) +#endif { this->Superclass::Initialize(); @@ -164,7 +168,7 @@ CorrelationRatioImageToImageMetric //check in which bin the fixed value belongs, get the index const double fixedImageBinTerm = (fixedValue - m_FixedImageMin) / m_FixedImageBinSize; - const unsigned int fixedImageBinIndex = static_cast( vcl_floor(fixedImageBinTerm ) ); + const unsigned int fixedImageBinIndex = static_cast( std::floor(fixedImageBinTerm ) ); //adapt the measures per bin this->m_mMSVPB[fixedImageBinIndex]+=movingSquaredValue; this->m_mSMVPB[fixedImageBinIndex]+=movingValue; @@ -227,7 +231,7 @@ CorrelationRatioImageToImageMetric FixedImageType> FixedIteratorType; typedef itk::ImageRegionConstIteratorWithIndex< - ITK_TYPENAME Superclass::GradientImageType> GradientIteratorType; + typename Superclass::GradientImageType> GradientIteratorType; FixedIteratorType ti( fixedImage, this->GetFixedImageRegion() ); @@ -240,7 +244,7 @@ CorrelationRatioImageToImageMetric const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( itk::NumericTraits::Zero ); + derivative.Fill( itk::NumericTraits::Zero ); ti.GoToBegin(); @@ -266,14 +270,8 @@ 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(); this->m_NumberOfPixelsCounted++; @@ -348,7 +346,7 @@ CorrelationRatioImageToImageMetric FixedImageType> FixedIteratorType; typedef itk::ImageRegionConstIteratorWithIndex< - ITK_TYPENAME Superclass::GradientImageType> GradientIteratorType; + typename Superclass::GradientImageType> GradientIteratorType; FixedIteratorType ti( fixedImage, this->GetFixedImageRegion() ); @@ -363,7 +361,7 @@ CorrelationRatioImageToImageMetric const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType( ParametersDimension ); - derivative.Fill( NumericTraits::Zero ); + derivative.Fill( NumericTraits::Zero ); ti.GoToBegin(); @@ -389,14 +387,8 @@ 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(); this->m_NumberOfPixelsCounted++;