Skip to content

Commit

Permalink
Complete compliance to ITK5.
Browse files Browse the repository at this point in the history
  • Loading branch information
astamm authored and ocommowi committed Mar 24, 2020
1 parent 3efa583 commit 39cb989
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public anima::MaskedImageToImageFilter<itk::Image<ComponentType,ImageDimension>,
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RicianToGaussianImageFilter<ComponentType,ImageDimension>
}

// Initialize thread containers for global scale estimation
unsigned int numThreads = this->GetNumberOfThreads();
unsigned int numThreads = this->GetNumberOfWorkUnits();
m_ThreadScaleSamples.resize(numThreads);
this->Superclass::BeforeThreadedGenerateData();
}
Expand Down Expand Up @@ -235,7 +235,7 @@ RicianToGaussianImageFilter<ComponentType,ImageDimension>
if (m_Scale == 0)
{
std::vector<double> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ performTransformation(const typename itk::Image<ComponentType,ImageDimension>::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);
Expand Down Expand Up @@ -197,7 +197,7 @@ performTransformation(const typename itk::Image<ComponentType,ImageDimension>::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);
Expand Down Expand Up @@ -274,7 +274,7 @@ int main(int ac, const char** av)
TCLAP::ValueArg<double> 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<unsigned int> maxiterArg("I", "maxiter", "Maximum number of iterations (default: 100)", false, 100, "Maximum number of iterations", cmd);
TCLAP::ValueArg<unsigned int> nbpArg("T", "nbp", "Number of threads to run on -> default : automatically determine", false, itk::MultiThreader::GetGlobalDefaultNumberOfThreads(), "Number of threads", cmd);
TCLAP::ValueArg<unsigned int> nbpArg("T", "nbp", "Number of threads to run on -> default : automatically determine", false, itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(), "Number of threads", cmd);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 39cb989

Please sign in to comment.