blowekamp
(Bradley Lowekamp)
June 2, 2026, 1:23pm
37
Niels_Dekker:
In the registration example case of @NicoKiaru , the work units of the metric (“AdvancedMattesMutualInformation”) appear quite expensive (requiring dynamic memory allocation for each work unit). Moreover, the “AfterThreaded” post-processing (accumulating the result from the threads) also appears quite expensive when there are many work units.
Yes merging histograms or other data in a single threaded fashion can be quite slow. You might find the approach using in LabelStatisticImageFilter useful for reference.
ITK/Modules/Filtering/ImageStatistics/include/itkLabelStatisticsImageFilter.hxx at fc3590bf3bed62a9d77a1587c7b190fa25d52f82 · InsightSoftwareConsortium/ITK · GitHub It performs the merges concurrently during threading instead of after.
2 Likes