======================================================================-====*/
#ifndef _ITKINTERPOLATEIMAGEFUNCTIONWITHLUT_TXX
#define _ITKINTERPOLATEIMAGEFUNCTIONWITHLUT_TXX
+#include <itkMath.h>
namespace itk
{
// Compute index in precomputed weights table
TCoefficientType t2 = mSamplingFactors[l]*t1;
- index[l] = (IndexValueType)Math::Round(t2);
+ index[l] = (IndexValueType)Math::Round<TCoefficientType>(t2);
// For even order : test if too close to 0.5 (but lower). In this
// case : take the next coefficient
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<typename ContinuousIndexType::ValueType>(x[l]);
else {
indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
evaluateIndex[l] = indx;
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<double>(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];
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<double>(dExtents[i]);
}
}
//----------------------------------------------------------------------------