X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FitkBSplineDecompositionImageFilterWithOBD.txx;h=46af35997f837db37d912b6977d2c70664ee1aa3;hb=378ee630dce37a3e15baf3a8027542c2f8cf43de;hp=3812bb5080e29ff3e7613e016f19e4f3f152c746;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/itk/itkBSplineDecompositionImageFilterWithOBD.txx b/itk/itkBSplineDecompositionImageFilterWithOBD.txx index 3812bb5..46af359 100644 --- a/itk/itkBSplineDecompositionImageFilterWithOBD.txx +++ b/itk/itkBSplineDecompositionImageFilterWithOBD.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 _itkBSplineDecompositionImageFilterWithOBD_txx #define _itkBSplineDecompositionImageFilterWithOBD_txx #include "itkBSplineDecompositionImageFilterWithOBD.h" @@ -34,6 +34,8 @@ BSplineDecompositionImageFilterWithOBD ::BSplineDecompositionImageFilterWithOBD() { m_SplineOrder = 0; + for(unsigned int i=0; i ::SetSplineOrders(SizeType SplineOrders) { + if (SplineOrders == m_SplineOrders) + { + return; + } m_SplineOrders=SplineOrders; + this->Modified(); } template @@ -139,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; @@ -149,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: @@ -189,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 */ @@ -202,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++) {