From 025d440c5e27cf17886e7e3327f3c1aa0291f90d Mon Sep 17 00:00:00 2001 From: Aymeric Stamm Date: Tue, 24 Mar 2020 16:47:14 +0100 Subject: [PATCH] Complete compliance to ITK5. --- .../animaRicianToGaussianImageFilter.h | 3 +-- .../animaRicianToGaussianImageFilter.hxx | 4 ++-- .../rician_to_gaussian_noise/animaRicianToGaussianNoise.cxx | 6 +++--- .../kummer_function_test/animaKummerFunctionTest.cxx | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.h b/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.h index a968590d1..fba3373ec 100644 --- a/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.h +++ b/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.h @@ -81,8 +81,7 @@ public anima::MaskedImageToImageFilter, virtual ~RicianToGaussianImageFilter() {} void BeforeThreadedGenerateData(void) ITK_OVERRIDE; - void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, - itk::ThreadIdType threadId) ITK_OVERRIDE; + void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE; void AfterThreadedGenerateData(void) ITK_OVERRIDE; private: diff --git a/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.hxx b/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.hxx index 94bb2012a..e22a9cc8c 100644 --- a/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.hxx +++ b/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianImageFilter.hxx @@ -47,7 +47,7 @@ RicianToGaussianImageFilter } // Initialize thread containers for global scale estimation - unsigned int numThreads = this->GetNumberOfThreads(); + unsigned int numThreads = this->GetNumberOfWorkUnits(); m_ThreadScaleSamples.resize(numThreads); this->Superclass::BeforeThreadedGenerateData(); } @@ -235,7 +235,7 @@ RicianToGaussianImageFilter if (m_Scale == 0) { std::vector scaleSamples; - for (unsigned int i = 0;i < this->GetNumberOfThreads();++i) + for (unsigned int i = 0;i < this->GetNumberOfWorkUnits();++i) scaleSamples.insert(scaleSamples.end(), m_ThreadScaleSamples[i].begin(), m_ThreadScaleSamples[i].end()); m_Scale = anima::GetMedian(scaleSamples); diff --git a/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianNoise.cxx b/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianNoise.cxx index f955a49dc..4bfe24dce 100644 --- a/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianNoise.cxx +++ b/Anima/filtering/rician_to_gaussian_noise/animaRicianToGaussianNoise.cxx @@ -167,7 +167,7 @@ performTransformation(const typename itk::Image::P mainFilter->SetMaximumNumberOfIterations(args.maxiters); mainFilter->SetEpsilon(args.epsilon); mainFilter->SetSigma(args.sigma); - mainFilter->SetNumberOfThreads(args.nthreads); + mainFilter->SetNumberOfWorkUnits(args.nthreads); if (maskImage) mainFilter->SetComputationMask(maskImage); @@ -197,7 +197,7 @@ performTransformation(const typename itk::Image::P mainFilter->SetEpsilon(args.epsilon); mainFilter->SetSigma(args.sigma); mainFilter->SetScale(scale); - mainFilter->SetNumberOfThreads(args.nthreads); + mainFilter->SetNumberOfWorkUnits(args.nthreads); if (maskImage) mainFilter->SetComputationMask(maskImage); @@ -274,7 +274,7 @@ int main(int ac, const char** av) TCLAP::ValueArg sigmaArg("S", "sigma", "Gaussian standard deviation for defining neighbor weights (default: 1.0)", false, 1.0, "Gaussian standard deviation for defining neighbor weights", cmd); TCLAP::ValueArg maxiterArg("I", "maxiter", "Maximum number of iterations (default: 100)", false, 100, "Maximum number of iterations", cmd); - TCLAP::ValueArg nbpArg("T", "nbp", "Number of threads to run on -> default : automatically determine", false, itk::MultiThreader::GetGlobalDefaultNumberOfThreads(), "Number of threads", cmd); + TCLAP::ValueArg nbpArg("T", "nbp", "Number of threads to run on -> default : automatically determine", false, itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(), "Number of threads", cmd); try { diff --git a/Anima/math-tools/special_functions/kummer_function_test/animaKummerFunctionTest.cxx b/Anima/math-tools/special_functions/kummer_function_test/animaKummerFunctionTest.cxx index 28e633dfa..876480ff1 100644 --- a/Anima/math-tools/special_functions/kummer_function_test/animaKummerFunctionTest.cxx +++ b/Anima/math-tools/special_functions/kummer_function_test/animaKummerFunctionTest.cxx @@ -19,7 +19,7 @@ int main(int argc, char **argv) std::cout << "Input value: " << inArg.getValue() << std::endl; std::cout << "Kummer M value via direct ARB: " << anima::KummerFunction(inArg.getValue(), -0.5, 1.0) << std::endl; - std::cout << "Kummer M value via direct ARB: " << anima::OneHalfLaguerreFunction(inArg.getValue()) << std::endl; + std::cout << "Kummer M value via exponentially-scaled modified Bessel functions: " << anima::OneHalfLaguerreFunction(inArg.getValue()) << std::endl; return EXIT_SUCCESS; }