X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkVectorBSplineInterpolateImageFunctionWithLUT.txx;h=a237a35871b8866b2238c61eebea1e5386de4752;hb=08293e0d20ffba488a0808c66ffca457552f5d8e;hp=337b4c0d8e7a30bd66ff93f0be5bf83657138695;hpb=a87fe1bfb8c6b85456952f0b584d44b1da6cb3fa;p=clitk.git diff --git a/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx b/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx index 337b4c0..a237a35 100644 --- a/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx +++ b/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #ifndef _CLITKVECTORBSPLINEINTERPOLATEIMAGEFUNCTIONWITHLUT_TXX #define _CLITKVECTORBSPLINEINTERPOLATEIMAGEFUNCTIONWITHLUT_TXX /* ========================================================================= @@ -210,7 +210,7 @@ GetSampleIndexOfPixelPosition(const ContinuousIndexType & x, IndexType & Evaluat // Compute index in precomputed weights table TCoefficientType t2 = mSamplingFactors[l]*t1; - index[l] = (IndexValueType)lrint(t2); + index[l] = (IndexValueType)itk::Math::Floor(t2); // For even order : test if too close to 0.5 (but lower). In this // case : take the next coefficient @@ -245,7 +245,6 @@ typename VectorBSplineInterpolateImageFunctionWithLUT:: EvaluateAtContinuousIndex(const ContinuousIndexType & x) const { - // JV Compute BSpline weights if not up to date! Problem const: pass image as last // if (!mWeightsAreUpToDate) UpdatePrecomputedWeights(); // For shorter coding @@ -259,7 +258,7 @@ EvaluateAtContinuousIndex(const ContinuousIndexType & x) const indx = (long)vcl_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(x[l]); else { indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; @@ -359,7 +358,7 @@ EvaluateWeightsAtContinuousIndex(const ContinuousIndexType& x, const TCoeffici indx = (long)vcl_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(x[l]); else { indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; evaluateIndex[l] = indx;