]> Creatis software - clitk.git/blobdiff - itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx
Remove vcl_math calls
[clitk.git] / itk / clitkVectorBSplineInterpolateImageFunctionWithLUT.txx
index 4c66a2cb85fe0beb2210a25d641caeca364b2dc7..7096224daeee13aadb0b505888ce1d152b743dda 100644 (file)
@@ -206,11 +206,11 @@ GetSampleIndexOfPixelPosition(const ContinuousIndexType & x, IndexType & Evaluat
 
   for(int l=0; l<TImageType::ImageDimension; l++) {
     // 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;
-    index[l] = (IndexValueType)lrint(t2);
+    index[l] = (IndexValueType)itk::Math::Floor<IndexValueType,TCoefficientType>(t2);
 
     // For even order : test if too close to 0.5 (but lower). In this
     // case : take the next coefficient
@@ -255,12 +255,12 @@ EvaluateAtContinuousIndex(const ContinuousIndexType & x) const
   long indx;
   for (unsigned int l=0; l<d; l++)  {
     if (mSplineOrders[l] & 1) {  // Use this index calculation for odd splineOrder (like cubic)
-      indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_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]);
+      if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round<long, typename ContinuousIndexType::ValueType>(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; l<d; l++)  {
     if (mSplineOrders[l] & 1) {  // Use this index calculation for odd splineOrder (like cubic)
-      indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_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]);
+      if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round<long, typename ContinuousIndexType::ValueType>(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;
       }
     }