From 8d51bd1cb7e9ca416b46677dcd73ba76d107a587 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Fri, 15 Feb 2019 13:23:42 +0100 Subject: [PATCH] Remove vcl_math calls In the early days of itk development, many c++ compilers treated math functions inconsistently. The vcl_math routines provided a platform independent interface. Now, with modern c++ compilers, math functions are treated more uniformly. This patch removes the vcl_math calls. The extra layer provided by vcl is no longer needed and may even cause problems with newer compilers. --- itk/RelativePositionPropImageFilter.h | 2 +- ...vePositionConstraintToLabelImageFilter.txx | 2 +- itk/clitkComposeVFFilter.txx | 2 +- itk/clitkForwardWarpImageFilter.txx | 2 +- itk/clitkInvertVFFilter.txx | 2 +- ...litkSliceBySliceRelativePositionFilter.txx | 2 +- ...kVectorBSplineDecompositionImageFilter.txx | 16 +++---- ...BSplineDecompositionImageFilterWithOBD.txx | 16 +++---- ...kVectorBSplineInterpolateImageFunction.txx | 4 +- ...BSplineInterpolateImageFunctionWithLUT.txx | 10 ++--- ...BSplineDecompositionImageFilterWithOBD.txx | 16 +++---- ...BSplineInterpolateImageFunctionWithLUT.txx | 6 +-- ...terpolateImageFunctionWithLUT.txx.original | 6 +-- ...CastInterpolateImageFunctionWithOrigin.txx | 42 +++++++++---------- .../clitkBSplineDeformableTransform.txx | 2 +- ...litkCorrelationRatioImageToImageMetric.txx | 2 +- ...litkMultiResolutionPyramidRegionFilter.txx | 4 +- ...ormalizedCorrelationImageToImageMetric.txx | 4 +- ...relationImageToImageMetricFor3DBLUTFFD.txx | 4 +- ...poralMultiResolutionPyramidImageFilter.txx | 4 +- ...dBLUTSpatioTemporalDeformableTransform.txx | 2 +- ...MultiResolutionImageRegistrationMethod.txx | 4 +- ...poralMultiResolutionPyramidImageFilter.txx | 8 ++-- ...ormationImageToImageMetricFor3DBLUTFFD.txx | 8 ++-- 24 files changed, 85 insertions(+), 85 deletions(-) diff --git a/itk/RelativePositionPropImageFilter.h b/itk/RelativePositionPropImageFilter.h index e876f9f..c2391e7 100644 --- a/itk/RelativePositionPropImageFilter.h +++ b/itk/RelativePositionPropImageFilter.h @@ -181,7 +181,7 @@ namespace itk { m_Alpha1 = 0; m_Alpha2 = 0; - m_K1 = vcl_acos(-1.0)/2; + m_K1 = std::acos(-1.0)/2; // m_K2 = 3.1417/2; m_Radius = 2; // DS m_Fast = true; // DS diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx index c97ba0e..0e3581e 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx @@ -61,7 +61,7 @@ AddRelativePositionConstraintToLabelImageFilter(): FuzzyMapOnlyFlagOff(); FastFlagOff(); SetRadius(2.0); - SetK1(vcl_acos(-1.0)/2); + SetK1(std::acos(-1.0)/2); } //-------------------------------------------------------------------- diff --git a/itk/clitkComposeVFFilter.txx b/itk/clitkComposeVFFilter.txx index 5cc5db1..e42c852 100644 --- a/itk/clitkComposeVFFilter.txx +++ b/itk/clitkComposeVFFilter.txx @@ -98,7 +98,7 @@ namespace clitk { // The following block is equivalent to the following line without // having to call floor. (Only for positive inputs, we already now that is in the image) - // baseIndex[dim] = (long) vcl_floor(contIndex[dim] ); + // baseIndex[dim] = (long) std::floor(contIndex[dim] ); baseIndex[dim] = (long) contIndex[dim]; distance[dim] = contIndex[dim] - double( baseIndex[dim] ); diff --git a/itk/clitkForwardWarpImageFilter.txx b/itk/clitkForwardWarpImageFilter.txx index 4d49b4d..88804f5 100644 --- a/itk/clitkForwardWarpImageFilter.txx +++ b/itk/clitkForwardWarpImageFilter.txx @@ -184,7 +184,7 @@ void HelperClass1::Thread for(dim = 0; dim < ImageDimension; dim++) { // The following block is equivalent to the following line without // having to call floor. For positive inputs!!! - // baseIndex[dim] = (long) vcl_floor(contIndex[dim] ); + // baseIndex[dim] = (long) std::floor(contIndex[dim] ); baseIndex[dim] = (long) contIndex[dim]; distance[dim] = contIndex[dim] - double( baseIndex[dim] ); } diff --git a/itk/clitkInvertVFFilter.txx b/itk/clitkInvertVFFilter.txx index b2485e0..ec3c90f 100644 --- a/itk/clitkInvertVFFilter.txx +++ b/itk/clitkInvertVFFilter.txx @@ -169,7 +169,7 @@ void HelperClass1::ThreadedGenerateData(const O for(dim = 0; dim < ImageDimension; dim++) { // The following block is equivalent to the following line without // having to call floor. (Only for positive inputs, we already now that is in the image) - // baseIndex[dim] = (long) vcl_floor(contIndex[dim] ); + // baseIndex[dim] = (long) std::floor(contIndex[dim] ); baseIndex[dim] = (long) contIndex[dim]; distance[dim] = contIndex[dim] - double( baseIndex[dim] ); diff --git a/itk/clitkSliceBySliceRelativePositionFilter.txx b/itk/clitkSliceBySliceRelativePositionFilter.txx index 16571ea..fc820be 100644 --- a/itk/clitkSliceBySliceRelativePositionFilter.txx +++ b/itk/clitkSliceBySliceRelativePositionFilter.txx @@ -43,7 +43,7 @@ SliceBySliceRelativePositionFilter(): SetObjectCCLSelectionDirection(1); ObjectCCLSelectionIgnoreSingleCCLFlagOff(); VerboseSlicesFlagOff(); - this->SetK1(vcl_acos(-1.0)/2); + this->SetK1(std::acos(-1.0)/2); } //-------------------------------------------------------------------- diff --git a/itk/clitkVectorBSplineDecompositionImageFilter.txx b/itk/clitkVectorBSplineDecompositionImageFilter.txx index 7031745..90bfa5c 100644 --- a/itk/clitkVectorBSplineDecompositionImageFilter.txx +++ b/itk/clitkVectorBSplineDecompositionImageFilter.txx @@ -131,7 +131,7 @@ VectorBSplineDecompositionImageFilter switch (m_SplineOrder) { case 3: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0; + m_SplinePoles[0] = std::sqrt(3.0) - 2.0; break; case 0: m_NumberOfPoles = 0; @@ -141,18 +141,18 @@ VectorBSplineDecompositionImageFilter break; case 2: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0; + m_SplinePoles[0] = std::sqrt(8.0) - 3.0; break; case 4: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0; - m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0; + m_SplinePoles[0] = std::sqrt(664.0 - std::sqrt(438976.0)) + std::sqrt(304.0) - 19.0; + m_SplinePoles[1] = std::sqrt(664.0 + std::sqrt(438976.0)) - std::sqrt(304.0) - 19.0; break; case 5: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0) + m_SplinePoles[0] = std::sqrt(135.0 / 2.0 - std::sqrt(17745.0 / 4.0)) + std::sqrt(105.0 / 4.0) - 13.0 / 2.0; - m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0) + m_SplinePoles[1] = std::sqrt(135.0 / 2.0 + std::sqrt(17745.0 / 4.0)) - std::sqrt(105.0 / 4.0) - 13.0 / 2.0; break; default: @@ -182,7 +182,7 @@ VectorBSplineDecompositionImageFilter horizon = m_DataLength[m_IteratorDirection]; zn = z; if (m_Tolerance > 0.0) { - horizon = (long)vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z))); + horizon = (long)std::ceil(log(m_Tolerance) / std::log(fabs(z))); } if (horizon < m_DataLength[m_IteratorDirection]) { /* accelerated loop */ @@ -195,7 +195,7 @@ VectorBSplineDecompositionImageFilter } else { /* full loop */ iz = 1.0 / z; - z2n = vcl_pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L)); + z2n = std::pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L)); sum = m_Scratch[0] + z2n * m_Scratch[m_DataLength[m_IteratorDirection] - 1L]; z2n *= z2n * iz; for (unsigned int n = 1; n <= (m_DataLength[m_IteratorDirection] - 2); n++) { diff --git a/itk/clitkVectorBSplineDecompositionImageFilterWithOBD.txx b/itk/clitkVectorBSplineDecompositionImageFilterWithOBD.txx index 7bc3165..51e6361 100644 --- a/itk/clitkVectorBSplineDecompositionImageFilterWithOBD.txx +++ b/itk/clitkVectorBSplineDecompositionImageFilterWithOBD.txx @@ -138,7 +138,7 @@ VectorBSplineDecompositionImageFilterWithOBD switch (m_SplineOrder) { case 3: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0; + m_SplinePoles[0] = std::sqrt(3.0) - 2.0; break; case 0: m_NumberOfPoles = 0; @@ -148,18 +148,18 @@ VectorBSplineDecompositionImageFilterWithOBD break; case 2: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0; + m_SplinePoles[0] = std::sqrt(8.0) - 3.0; break; case 4: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0; - m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0; + m_SplinePoles[0] = std::sqrt(664.0 - std::sqrt(438976.0)) + std::sqrt(304.0) - 19.0; + m_SplinePoles[1] = std::sqrt(664.0 + std::sqrt(438976.0)) - std::sqrt(304.0) - 19.0; break; case 5: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0) + m_SplinePoles[0] = std::sqrt(135.0 / 2.0 - std::sqrt(17745.0 / 4.0)) + std::sqrt(105.0 / 4.0) - 13.0 / 2.0; - m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0) + m_SplinePoles[1] = std::sqrt(135.0 / 2.0 + std::sqrt(17745.0 / 4.0)) - std::sqrt(105.0 / 4.0) - 13.0 / 2.0; break; default: @@ -189,7 +189,7 @@ VectorBSplineDecompositionImageFilterWithOBD horizon = m_DataLength[m_IteratorDirection]; zn = z; if (m_Tolerance > 0.0) { - horizon = (long)vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z))); + horizon = (long)std::ceil(log(m_Tolerance) / std::log(fabs(z))); } if (horizon < m_DataLength[m_IteratorDirection]) { /* accelerated loop */ @@ -202,7 +202,7 @@ VectorBSplineDecompositionImageFilterWithOBD } else { /* full loop */ iz = 1.0 / z; - z2n = vcl_pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L)); + z2n = std::pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L)); sum = m_Scratch[0] + z2n * m_Scratch[m_DataLength[m_IteratorDirection] - 1L]; z2n *= z2n * iz; for (unsigned int n = 1; n <= (m_DataLength[m_IteratorDirection] - 2); n++) { diff --git a/itk/clitkVectorBSplineInterpolateImageFunction.txx b/itk/clitkVectorBSplineInterpolateImageFunction.txx index 2599b80..935f257 100644 --- a/itk/clitkVectorBSplineInterpolateImageFunction.txx +++ b/itk/clitkVectorBSplineInterpolateImageFunction.txx @@ -484,12 +484,12 @@ VectorBSplineInterpolateImageFunction // compute the interpolation indexes for (unsigned int n = 0; n< ImageDimension; n++) { if (splineOrder & 1) { // Use this index calculation for odd splineOrder - indx = (long)vcl_floor((float)x[n]) - splineOrder / 2; + indx = (long)std::floor((float)x[n]) - splineOrder / 2; for (unsigned int k = 0; k <= splineOrder; k++) { evaluateIndex[n][k] = indx++; } } else { // Use this index calculation for even splineOrder - indx = (long)vcl_floor((float)(x[n] + 0.5)) - splineOrder / 2; + indx = (long)std::floor((float)(x[n] + 0.5)) - splineOrder / 2; for (unsigned int k = 0; k <= splineOrder; k++) { evaluateIndex[n][k] = indx++; } diff --git a/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx b/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx index a237a35..7096224 100644 --- a/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx +++ b/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx @@ -206,7 +206,7 @@ GetSampleIndexOfPixelPosition(const ContinuousIndexType & x, IndexType & Evaluat for(int l=0; lm_SplineOrder / 2; + indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } else { // Use this index calculation for even splineOrder if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round(x[l]); else { - indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; + indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } } @@ -355,12 +355,12 @@ EvaluateWeightsAtContinuousIndex(const ContinuousIndexType& x, const TCoeffici long indx; for (unsigned int l=0; lm_SplineOrder / 2; + indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } else { // Use this index calculation for even splineOrder if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round(x[l]); else { - indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; + indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } } diff --git a/itk/itkBSplineDecompositionImageFilterWithOBD.txx b/itk/itkBSplineDecompositionImageFilterWithOBD.txx index 8041409..46af359 100644 --- a/itk/itkBSplineDecompositionImageFilterWithOBD.txx +++ b/itk/itkBSplineDecompositionImageFilterWithOBD.txx @@ -146,7 +146,7 @@ BSplineDecompositionImageFilterWithOBD case 3: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0; + m_SplinePoles[0] = std::sqrt(3.0) - 2.0; break; case 0: m_NumberOfPoles = 0; @@ -156,18 +156,18 @@ BSplineDecompositionImageFilterWithOBD break; case 2: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0; + m_SplinePoles[0] = std::sqrt(8.0) - 3.0; break; case 4: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0; - m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0; + m_SplinePoles[0] = std::sqrt(664.0 - std::sqrt(438976.0)) + std::sqrt(304.0) - 19.0; + m_SplinePoles[1] = std::sqrt(664.0 + std::sqrt(438976.0)) - std::sqrt(304.0) - 19.0; break; case 5: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0) + m_SplinePoles[0] = std::sqrt(135.0 / 2.0 - std::sqrt(17745.0 / 4.0)) + std::sqrt(105.0 / 4.0) - 13.0 / 2.0; - m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0) + m_SplinePoles[1] = std::sqrt(135.0 / 2.0 + std::sqrt(17745.0 / 4.0)) - std::sqrt(105.0 / 4.0) - 13.0 / 2.0; break; default: @@ -196,7 +196,7 @@ BSplineDecompositionImageFilterWithOBD horizon = m_DataLength[m_IteratorDirection]; zn = z; if (m_Tolerance > 0.0) { - horizon = (long)vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z))); + horizon = (long)std::ceil(log(m_Tolerance) / std::log(fabs(z))); } if (horizon < m_DataLength[m_IteratorDirection]) { /* accelerated loop */ @@ -209,7 +209,7 @@ BSplineDecompositionImageFilterWithOBD } else { /* full loop */ iz = 1.0 / z; - z2n = vcl_pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L)); + z2n = std::pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L)); sum = m_Scratch[0] + z2n * m_Scratch[m_DataLength[m_IteratorDirection] - 1L]; z2n *= z2n * iz; for (unsigned int n = 1; n <= (m_DataLength[m_IteratorDirection] - 2); n++) { diff --git a/itk/itkBSplineInterpolateImageFunctionWithLUT.txx b/itk/itkBSplineInterpolateImageFunctionWithLUT.txx index b9354a5..58a173a 100644 --- a/itk/itkBSplineInterpolateImageFunctionWithLUT.txx +++ b/itk/itkBSplineInterpolateImageFunctionWithLUT.txx @@ -187,7 +187,7 @@ namespace itk for(int l=0; lm_SplineOrder / 2; + indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } else { // Use this index calculation for even splineOrder if (mSplineOrders[l] == 0) evaluateIndex[l] = Math::Round(x[l]); else { - indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; + indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } } diff --git a/itk/itkBSplineInterpolateImageFunctionWithLUT.txx.original b/itk/itkBSplineInterpolateImageFunctionWithLUT.txx.original index 3a8744f..877a784 100644 --- a/itk/itkBSplineInterpolateImageFunctionWithLUT.txx.original +++ b/itk/itkBSplineInterpolateImageFunctionWithLUT.txx.original @@ -259,7 +259,7 @@ GetSampleIndexOfPixelPosition(const ContinuousIndexType & x, IndexType & Evaluat // bool mChange = false; // Compute t1 = distance to floor - TCoefficientType t1 = x[l]- vcl_floor(x[l]); + TCoefficientType t1 = x[l]- std::floor(x[l]); // Compute index in precomputed weights table TCoefficientType t2 = mSamplingFactors[l]*t1; @@ -311,13 +311,13 @@ EvaluateAtContinuousIndex(const ContinuousIndexType & x) const { long indx; for (unsigned int l=0; lm_SplineOrder / 2; + indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2; EvaluateIndex[l] = indx; } else { // Use this index calculation for even splineOrder if (mSplineOrders[l] == 0) EvaluateIndex[l] = (long)rint(x[l]); else { - indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; + indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; EvaluateIndex[l] = indx; } } diff --git a/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx b/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx index ebf73cf..d173a48 100644 --- a/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx +++ b/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx @@ -129,7 +129,7 @@ public: typename InputImageType::SpacingType spacing=this->m_Image->GetSpacing(); if (m_ValidRay) - return vcl_sqrt(m_VoxelIncrement[0]*spacing[0]*m_VoxelIncrement[0]*spacing[0] + return std::sqrt(m_VoxelIncrement[0]*spacing[0]*m_VoxelIncrement[0]*spacing[0] + m_VoxelIncrement[1]*spacing[1]*m_VoxelIncrement[1]*spacing[1] + m_VoxelIncrement[2]*spacing[2]*m_VoxelIncrement[2]*spacing[2] ); else @@ -470,10 +470,10 @@ RayCastHelper + C*m_BoundingCorner[c1][2] ); // initialise plane value and normalise - m_BoundingPlane[j][0] = A/vcl_sqrt(A*A + B*B + C*C); - m_BoundingPlane[j][1] = B/vcl_sqrt(A*A + B*B + C*C); - m_BoundingPlane[j][2] = C/vcl_sqrt(A*A + B*B + C*C); - m_BoundingPlane[j][3] = D/vcl_sqrt(A*A + B*B + C*C); + m_BoundingPlane[j][0] = A/std::sqrt(A*A + B*B + C*C); + m_BoundingPlane[j][1] = B/std::sqrt(A*A + B*B + C*C); + m_BoundingPlane[j][2] = C/std::sqrt(A*A + B*B + C*C); + m_BoundingPlane[j][3] = D/std::sqrt(A*A + B*B + C*C); if ( (A*A + B*B + C*C) == 0 ) { itk::ExceptionObject err(__FILE__, __LINE__); @@ -799,9 +799,9 @@ RayCastHelper // Calculate the number of voxels in each direction - xNum = vcl_fabs(m_RayVoxelStartPosition[0] - m_RayVoxelEndPosition[0]); - yNum = vcl_fabs(m_RayVoxelStartPosition[1] - m_RayVoxelEndPosition[1]); - zNum = vcl_fabs(m_RayVoxelStartPosition[2] - m_RayVoxelEndPosition[2]); + xNum = std::fabs(m_RayVoxelStartPosition[0] - m_RayVoxelEndPosition[0]); + yNum = std::fabs(m_RayVoxelStartPosition[1] - m_RayVoxelEndPosition[1]); + zNum = std::fabs(m_RayVoxelStartPosition[2] - m_RayVoxelEndPosition[2]); // The direction iterated in is that with the greatest number of voxels // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -991,9 +991,9 @@ RayCastHelper startOK = false; endOK = false; - Istart[0] = (int) vcl_floor(m_RayVoxelStartPosition[0]); - Istart[1] = (int) vcl_floor(m_RayVoxelStartPosition[1]); - Istart[2] = (int) vcl_floor(m_RayVoxelStartPosition[2]); + Istart[0] = (int) std::floor(m_RayVoxelStartPosition[0]); + Istart[1] = (int) std::floor(m_RayVoxelStartPosition[1]); + Istart[2] = (int) std::floor(m_RayVoxelStartPosition[2]); if( (Istart[0] >= 0) && (Istart[0] + Idirn[0] < m_NumberOfVoxelsInX) && (Istart[1] >= 0) && (Istart[1] + Idirn[1] < m_NumberOfVoxelsInY) && @@ -1008,13 +1008,13 @@ RayCastHelper m_TotalRayVoxelPlanes--; } - Istart[0] = (int) vcl_floor(m_RayVoxelStartPosition[0] + Istart[0] = (int) std::floor(m_RayVoxelStartPosition[0] + m_TotalRayVoxelPlanes*m_VoxelIncrement[0]); - Istart[1] = (int) vcl_floor(m_RayVoxelStartPosition[1] + Istart[1] = (int) std::floor(m_RayVoxelStartPosition[1] + m_TotalRayVoxelPlanes*m_VoxelIncrement[1]); - Istart[2] = (int) vcl_floor(m_RayVoxelStartPosition[2] + Istart[2] = (int) std::floor(m_RayVoxelStartPosition[2] + m_TotalRayVoxelPlanes*m_VoxelIncrement[2]); if( (Istart[0] >= 0) && (Istart[0] + Idirn[0] < m_NumberOfVoxelsInX) && @@ -1286,18 +1286,18 @@ RayCastHelper switch( m_TraversalDirection ) { case TRANSVERSE_IN_X: { - y = m_Position3Dvox[1] - vcl_floor(m_Position3Dvox[1]); - z = m_Position3Dvox[2] - vcl_floor(m_Position3Dvox[2]); + y = m_Position3Dvox[1] - std::floor(m_Position3Dvox[1]); + z = m_Position3Dvox[2] - std::floor(m_Position3Dvox[2]); break; } case TRANSVERSE_IN_Y: { - y = m_Position3Dvox[0] - vcl_floor(m_Position3Dvox[0]); - z = m_Position3Dvox[2] - vcl_floor(m_Position3Dvox[2]); + y = m_Position3Dvox[0] - std::floor(m_Position3Dvox[0]); + z = m_Position3Dvox[2] - std::floor(m_Position3Dvox[2]); break; } case TRANSVERSE_IN_Z: { - y = m_Position3Dvox[0] - vcl_floor(m_Position3Dvox[0]); - z = m_Position3Dvox[1] - vcl_floor(m_Position3Dvox[1]); + y = m_Position3Dvox[0] - std::floor(m_Position3Dvox[0]); + z = m_Position3Dvox[1] - std::floor(m_Position3Dvox[1]); break; } default: { @@ -1322,7 +1322,7 @@ void RayCastHelper ::IncrementIntensities(double increment) { - short inc = (short) vcl_floor(increment + 0.5); + short inc = (short) std::floor(increment + 0.5); if (! m_ValidRay) { return; diff --git a/registration/clitkBSplineDeformableTransform.txx b/registration/clitkBSplineDeformableTransform.txx index 60a2136..151c259 100644 --- a/registration/clitkBSplineDeformableTransform.txx +++ b/registration/clitkBSplineDeformableTransform.txx @@ -296,7 +296,7 @@ namespace clitk // when spline order is even. // The valid interval for evaluation is [start+offset, last-offset) // when spline order is odd. - // Where offset = vcl_floor(spline / 2 ). + // Where offset = std::floor(spline / 2 ). // Note that the last pixel is not included in the valid region // with odd spline orders. typename RegionType::SizeType size = m_GridRegion.GetSize(); diff --git a/registration/clitkCorrelationRatioImageToImageMetric.txx b/registration/clitkCorrelationRatioImageToImageMetric.txx index 1454539..f6b5af1 100644 --- a/registration/clitkCorrelationRatioImageToImageMetric.txx +++ b/registration/clitkCorrelationRatioImageToImageMetric.txx @@ -168,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; diff --git a/registration/clitkMultiResolutionPyramidRegionFilter.txx b/registration/clitkMultiResolutionPyramidRegionFilter.txx index 17c63d4..eeee602 100644 --- a/registration/clitkMultiResolutionPyramidRegionFilter.txx +++ b/registration/clitkMultiResolutionPyramidRegionFilter.txx @@ -68,14 +68,14 @@ namespace clitk const float scaleFactor = static_cast( m_Schedule[ level ][ dim ] ); size[ dim ] = static_cast( - vcl_floor(static_cast( inputSize[ dim ] ) / scaleFactor ) ); + std::floor(static_cast( inputSize[ dim ] ) / scaleFactor ) ); if( size[ dim ] < 1 ) { size[ dim ] = 1; } start[ dim ] = static_cast( - vcl_ceil(static_cast( inputStart[ dim ] ) / scaleFactor ) ); + std::ceil(static_cast( inputStart[ dim ] ) / scaleFactor ) ); } m_RegionPyramid[ level ].SetSize( size ); m_RegionPyramid[ level ].SetIndex( start ); diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx b/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx index ea2c52a..fbb52ca 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx @@ -310,7 +310,7 @@ NormalizedCorrelationImageToImageMetric } - const RealType denom = -1.0 * vcl_sqrt(sff * smm ); + const RealType denom = -1.0 * std::sqrt(sff * smm ); MeasureType measure; if( this->m_NumberOfPixelsCounted > 0 && denom != 0.0) { measure = sfm / denom; @@ -400,7 +400,7 @@ NormalizedCorrelationImageToImageMetric } - m_Denom = -1.0 * vcl_sqrt(m_SFF * m_SMM ); + m_Denom = -1.0 * std::sqrt(m_SFF * m_SMM ); MeasureType measure; if( this->m_NumberOfPixelsCounted > 0 && m_Denom != 0.0) { measure = m_SFM / m_Denom; diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx index 042b4b7..494c61a 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx @@ -310,7 +310,7 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD } - const RealType denom = -1.0 * vcl_sqrt(sff * smm ); + const RealType denom = -1.0 * std::sqrt(sff * smm ); MeasureType measure; if( this->m_NumberOfPixelsCounted > 0 && denom != 0.0) { measure = sfm / denom; @@ -400,7 +400,7 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD } - m_Denom = -1.0 * vcl_sqrt(m_SFF * m_SMM ); + m_Denom = -1.0 * std::sqrt(m_SFF * m_SMM ); MeasureType measure; if( this->m_NumberOfPixelsCounted > 0 && m_Denom != 0.0) { measure = m_SFM / m_Denom; diff --git a/registration/clitkRecursiveSpatioTemporalMultiResolutionPyramidImageFilter.txx b/registration/clitkRecursiveSpatioTemporalMultiResolutionPyramidImageFilter.txx index c1dd208..12e90f8 100644 --- a/registration/clitkRecursiveSpatioTemporalMultiResolutionPyramidImageFilter.txx +++ b/registration/clitkRecursiveSpatioTemporalMultiResolutionPyramidImageFilter.txx @@ -367,14 +367,14 @@ RecursiveSpatioTemporalMultiResolutionPyramidImageFilter( vcl_floor( + requestedSize[idim] = static_cast( std::floor( static_cast(requestedSize[idim]) / static_cast(factors[idim]) ) ); if( requestedSize[idim] < 1 ) { requestedSize[idim] = 1; } - requestedIndex[idim] = static_cast( vcl_ceil( + requestedIndex[idim] = static_cast( std::ceil( static_cast(requestedIndex[idim]) / static_cast(factors[idim]) ) ); diff --git a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx index 7cc0107..a57ead0 100644 --- a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx +++ b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx @@ -478,7 +478,7 @@ namespace clitk // when spline order is even. // The valid interval for evaluation is [start+offset, last-offset) // when spline order is odd. - // Where offset = vcl_floor(spline / 2 ). + // Where offset = std::floor(spline / 2 ). // Note that the last pixel is not included in the valid region // with odd spline orders. typename RegionType::SizeType size = m_PaddedGridRegion.GetSize(); diff --git a/registration/clitkSpatioTemporalMultiResolutionImageRegistrationMethod.txx b/registration/clitkSpatioTemporalMultiResolutionImageRegistrationMethod.txx index 4d67baf..405b2c6 100644 --- a/registration/clitkSpatioTemporalMultiResolutionImageRegistrationMethod.txx +++ b/registration/clitkSpatioTemporalMultiResolutionImageRegistrationMethod.txx @@ -280,14 +280,14 @@ SpatioTemporalMultiResolutionImageRegistrationMethod const float scaleFactor = static_cast( schedule[ level ][ dim ] ); size[ dim ] = static_cast( - vcl_floor(static_cast( inputSize[ dim ] ) / scaleFactor ) ); + std::floor(static_cast( inputSize[ dim ] ) / scaleFactor ) ); if( size[ dim ] < 1 ) { size[ dim ] = 1; } start[ dim ] = static_cast( - vcl_ceil(static_cast( inputStart[ dim ] ) / scaleFactor ) ); + std::ceil(static_cast( inputStart[ dim ] ) / scaleFactor ) ); } m_FixedImageRegionPyramid[ level ].SetSize( size ); m_FixedImageRegionPyramid[ level ].SetIndex( start ); diff --git a/registration/clitkSpatioTemporalMultiResolutionPyramidImageFilter.txx b/registration/clitkSpatioTemporalMultiResolutionPyramidImageFilter.txx index 4c01738..7c702b2 100644 --- a/registration/clitkSpatioTemporalMultiResolutionPyramidImageFilter.txx +++ b/registration/clitkSpatioTemporalMultiResolutionPyramidImageFilter.txx @@ -433,11 +433,11 @@ SpatioTemporalMultiResolutionPyramidImageFilter outputSpacing[idim] = inputSpacing[idim] * shrinkFactor; outputSize[idim] = static_cast( - vcl_floor(static_cast(inputSize[idim]) / shrinkFactor ) ); + std::floor(static_cast(inputSize[idim]) / shrinkFactor ) ); if( outputSize[idim] < 1 ) { outputSize[idim] = 1; } outputStartIndex[idim] = static_cast( - vcl_ceil(static_cast(inputStartIndex[idim]) / shrinkFactor ) ); + std::ceil(static_cast(inputStartIndex[idim]) / shrinkFactor ) ); } //Now compute the new shifted origin for the updated levels; const typename OutputImageType::PointType::VectorType outputOriginOffset @@ -528,11 +528,11 @@ SpatioTemporalMultiResolutionPyramidImageFilter double factor = static_cast( m_Schedule[ilevel][idim] ); outputSize[idim] = static_cast( - vcl_floor(static_cast(baseSize[idim]) / factor ) ); + std::floor(static_cast(baseSize[idim]) / factor ) ); if( outputSize[idim] < 1 ) { outputSize[idim] = 1; } outputIndex[idim] = static_cast( - vcl_ceil(static_cast(baseIndex[idim]) / factor ) ); + std::ceil(static_cast(baseIndex[idim]) / factor ) ); } diff --git a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx index ef4257e..9f71766 100644 --- a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx @@ -768,9 +768,9 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD // check for non-zero bin contribution if( jointPDFValue > 1e-16 && movingImagePDFValue > 1e-16 ) { - double pRatio = vcl_log(jointPDFValue / movingImagePDFValue ); + double pRatio = std::log(jointPDFValue / movingImagePDFValue ); if( fixedImagePDFValue > 1e-16) { - sum += jointPDFValue * ( pRatio - vcl_log(fixedImagePDFValue ) ); + sum += jointPDFValue * ( pRatio - std::log(fixedImagePDFValue ) ); } } // end if-block to check non-zero bin contribution @@ -1093,10 +1093,10 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD // check for non-zero bin contribution if( jointPDFValue > 1e-16 && movingImagePDFValue > 1e-16 ) { - double pRatio = vcl_log(jointPDFValue / movingImagePDFValue ); + double pRatio = std::log(jointPDFValue / movingImagePDFValue ); if( fixedImagePDFValue > 1e-16) { - sum += jointPDFValue * ( pRatio - vcl_log(fixedImagePDFValue ) ); + sum += jointPDFValue * ( pRatio - std::log(fixedImagePDFValue ) ); } if( this->m_UseExplicitPDFDerivatives ) { -- 2.47.1