WIP: PERF: Accumulate joint histograms in ThreadedComputePDFs#1451
Draft
N-Dekker wants to merge 1 commit into
Draft
Conversation
Inspired by a suggestion from Bradley Lowekamp, 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
06657ab to
302f1ee
Compare
N-Dekker
commented
Jun 5, 2026
| m_JointPDF = JointPDFType::New(); | ||
| m_JointPDF->SetRegions(JointPDFSizeType{ m_NumberOfMovingHistogramBins, m_NumberOfFixedHistogramBins }); | ||
| m_JointPDF->Allocate(); | ||
| m_JointPDF->AllocateInitialized(); |
Member
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.