Improve performance of Advanced, ParzenWindowHistogram, ParzenWindowMutualInformation ImageToImageMetric#1444
Merged
Merged
Conversation
Used the most specific derived interpolator type in `AdvancedImageToImageMetric::EvaluateMovingImageValueAndDerivativeWithOptionalThreadId`, and optionally add the threadId to EvaluateAtContinuousIndex calls. ITK's `BSplineInterpolateImageFunction::EvaluateAtContinuousIndex` should be much faster with the threadId parameter.
Preallocated the memory for Parzen PDF values outside of for-each-sample loops. Passed the memory buffer as extra parameter to `ParzenWindowHistogramImageToImageMetric::UpdateJointPDFAndDerivatives` and `ParzenWindowMutualInformationImageToImageMetric::UpdateDerivativeLowMemory`. A small performance improvement (~5%) was observed, running elastix.exe on Windows 11 as part of the benchmark by Nicolas Chiaruttini (https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example/7736)
N-Dekker
added a commit
to N-Dekker/ITKElastix
that referenced
this pull request
May 15, 2026
Included elastix pull requests: SuperElastix/elastix#1444 "Improve performance of Advanced, ParzenWindowHistogram, ParzenWindowMutualInformation ImageToImageMetric" SuperElastix/elastix#1440 "PERF: Use ImageBufferRange in AfterThreadedComputePDFs" SuperElastix/elastix#1431 "ENH: Print a warning for each unused parameter of the ParameterMap" All included new commits: SuperElastix/elastix@5.3.1...77c726a
N-Dekker
added a commit
to N-Dekker/ITKElastix
that referenced
this pull request
May 15, 2026
Included elastix pull requests: SuperElastix/elastix#1444 "Improve performance of Advanced, ParzenWindowHistogram, ParzenWindowMutualInformation ImageToImageMetric" SuperElastix/elastix#1440 "PERF: Use ImageBufferRange in AfterThreadedComputePDFs" SuperElastix/elastix#1431 "ENH: Print a warning for each unused parameter of the ParameterMap" All included new commits: SuperElastix/elastix@5.3.1...77c726a
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.
AdvancedImageToImageMetric::EvaluateMovingImageValueAndDerivativeThe registration test case of the benchmark by Nicolas Chiaruttini (@NicoKiaru) at https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example/7736 appears to run more than 5 % faster with the CLI (elastix executable) on Window 11, at "my" LKEB/LUMC pc (AMD Threadripper, 32-Cores, 4 GHz, 64 logical processors), when using the default number of work units for the metric (
ITK_MAX_THREADS, which is 128 for the executable), so without specifying "-threads".