You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ENH: Make random numbers multithreading registrations deterministic
Stopped using the global instance of MersenneTwisterRandomVariateGenerator. Stopped calling its `GetInstance()`.
Added a deterministic default-constructed `m_RandomVariateGenerator` to ElastixBase.
Added pointers to this generator to AdvancedImageToImageMetric, ImageRandomSamplerBase, and CMAEvolutionStrategyOptimizer. Added `SetRandomVariateGenerator` member functions to these classes (using a default-constructed generator when `SetRandomVariateGenerator` is not yet called).
Also removed the one `MersenneTwisterRandomVariateGenerator::New()` call from elastix, which was for a local generator in `ImageRandomSamplerBase::GenerateRandomNumberList()`. Instead, added `m_Seed` to ImageRandomSamplerBase, and used that seed for a default-constructed local generator.
Aims to make the results of running multiple registrations parallel (multi-threaded) within a single process deterministic.
Triggered by pull request InsightSoftwareConsortium/ITK#5287 "Deterministic multithreading usage of itkMersenneTwisterRandomVariateGenerator.cxx", Michal Meszaros, Mar 21, 2025.
0 commit comments