From f57924a2649534451ac1ae5a2bdc63e0b6a0092d Mon Sep 17 00:00:00 2001 From: delmon Date: Thu, 14 Apr 2011 08:19:24 +0000 Subject: [PATCH] itkv4 migration: + itk::Math::Round and itk::Math::Ceil need an explicit template when used. --- itk/itkBSplineInterpolateImageFunctionWithLUT.txx | 5 +++-- vv/vvSlicer.cxx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/itk/itkBSplineInterpolateImageFunctionWithLUT.txx b/itk/itkBSplineInterpolateImageFunctionWithLUT.txx index 35c1664..873b31c 100644 --- a/itk/itkBSplineInterpolateImageFunctionWithLUT.txx +++ b/itk/itkBSplineInterpolateImageFunctionWithLUT.txx @@ -17,6 +17,7 @@ ======================================================================-====*/ #ifndef _ITKINTERPOLATEIMAGEFUNCTIONWITHLUT_TXX #define _ITKINTERPOLATEIMAGEFUNCTIONWITHLUT_TXX +#include namespace itk { @@ -190,7 +191,7 @@ namespace itk // Compute index in precomputed weights table TCoefficientType t2 = mSamplingFactors[l]*t1; - index[l] = (IndexValueType)Math::Round(t2); + index[l] = (IndexValueType)Math::Round(t2); // For even order : test if too close to 0.5 (but lower). In this // case : take the next coefficient @@ -240,7 +241,7 @@ namespace itk evaluateIndex[l] = indx; } else { // Use this index calculation for even splineOrder - if (mSplineOrders[l] == 0) evaluateIndex[l] = Math::Round(x[l]); + 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; evaluateIndex[l] = indx; diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index abed78c..89ea978 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -748,7 +748,7 @@ void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice) origin[this->SliceOrientation] -= mImageReslice->GetOutput()->GetOrigin()[this->SliceOrientation]; origin[this->SliceOrientation] /= mImageReslice->GetOutput()->GetSpacing()[this->SliceOrientation]; // Step 2: round to superior grid positionInc - origin[this->SliceOrientation] = itk::Math::Ceil(origin[this->SliceOrientation]); + origin[this->SliceOrientation] = itk::Math::Ceil(origin[this->SliceOrientation]); // Step 3: back to world coordinates origin[this->SliceOrientation] *= mImageReslice->GetOutput()->GetSpacing()[this->SliceOrientation]; origin[this->SliceOrientation] += mImageReslice->GetOutput()->GetOrigin()[this->SliceOrientation]; @@ -896,7 +896,7 @@ void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const dExtents[i] = (dExtents[i]- targetImage->GetOrigin()[i/2]) / targetImage->GetSpacing()[i/2]; // Round to nearest - targetExtent[i] = itk::Math::Round(dExtents[i]); + targetExtent[i] = itk::Math::Round(dExtents[i]); } } //---------------------------------------------------------------------------- -- 2.47.1