Skip to content

WIP: PERF: Accumulate joint histograms in ThreadedComputePDFs#1451

Draft
N-Dekker wants to merge 1 commit into
mainfrom
Accumulate-joint-histograms-in-ParzenWindowHistogramImageToImageMetric-ThreadedComputePDFs
Draft

WIP: PERF: Accumulate joint histograms in ThreadedComputePDFs#1451
N-Dekker wants to merge 1 commit into
mainfrom
Accumulate-joint-histograms-in-ParzenWindowHistogramImageToImageMetric-ThreadedComputePDFs

Conversation

@N-Dekker

@N-Dekker N-Dekker commented Jun 5, 2026

Copy link
Copy Markdown
Member

Inspired by a suggestion from Bradley Lowekamp (@blowekamp), June 2, 2026, at https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example/7736/37


A major performance improvement (10% to 40%) of elastix.exe was observed on the benchmark data set from https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example (by @NicoKiaru). However, this PR might cause slightly different results, because it may change the order of additions of floating point numbers, during accumulation.

@N-Dekker N-Dekker marked this pull request as draft June 5, 2026 11:54
@N-Dekker N-Dekker force-pushed the Accumulate-joint-histograms-in-ParzenWindowHistogramImageToImageMetric-ThreadedComputePDFs branch from 06657ab to 302f1ee Compare June 5, 2026 13:37
m_JointPDF = JointPDFType::New();
m_JointPDF->SetRegions(JointPDFSizeType{ m_NumberOfMovingHistogramBins, m_NumberOfFixedHistogramBins });
m_JointPDF->Allocate();
m_JointPDF->AllocateInitialized();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: It might not be sufficient to zero-initialize the values here in InitializeHistograms(). Maybe ComputePDFs should (also) do m_JointPDF->FillBuffer(0.0) before calling m_Threader->SetSingleMethodAndExecute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant