Skip to content

FUTURE REMOVE MersenneTwisterRandomVariateGenerator::Initialize#5346

Merged
thewtex merged 2 commits intoInsightSoftwareConsortium:masterfrom
N-Dekker:Replace-Initialize-with-SetSeed
May 15, 2025
Merged

FUTURE REMOVE MersenneTwisterRandomVariateGenerator::Initialize#5346
thewtex merged 2 commits intoInsightSoftwareConsortium:masterfrom
N-Dekker:Replace-Initialize-with-SetSeed

Conversation

@N-Dekker
Copy link
Contributor

The MersenneTwisterRandomVariateGenerator member function Initialize behaves just like SetSeed, but SetSeed is more commonly used, and clearer.

N-Dekker added 2 commits May 13, 2025 17:25
The two MersenneTwisterRandomVariateGenerator member functions `Initialize` and
`SetSeed` behave the same, but `SetSeed` is more commonly used, and clearer.
The MersenneTwisterRandomVariateGenerator member function `Initialize` behaves
just like `SetSeed`, but `SetSeed` is more commonly used, and clearer.
@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Registration Issues affecting the Registration module area:Numerics Issues affecting the Numerics module labels May 13, 2025
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Looks good on a glance.

@N-Dekker N-Dekker marked this pull request as ready for review May 13, 2025 22:20
@N-Dekker
Copy link
Contributor Author

Thanks for your approval @dzenanz 👍

By the way, I find the name MersenneTwisterRandomVariateGenerator::Initialize especially confusing, because it seems to suggest that a newly created MersenneTwisterRandomVariateGenerator is still uninitialized! But actually, an instance created by MersenneTwisterRandomVariateGenerator::New() can be used directly, without calling Initialize!

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

👍

@thewtex thewtex merged commit 68bcf62 into InsightSoftwareConsortium:master May 15, 2025
16 checks passed
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Feb 10, 2026
Avoided warnings from ITK 6 (v6.0b02), saying:

    warning: 'void itk::Statistics::MersenneTwisterRandomVariateGenerator::Initialize(itk::Statistics::MersenneTwisterRandomVariateGenerator::IntegerType)' is deprecated: ITK 6 discourages using this member function. Please use `SetSeed` instead!

Following ITK pull request InsightSoftwareConsortium/ITK#5346 commit InsightSoftwareConsortium/ITK@7bb3671 "STYLE: Replace `Initialize` calls random number generator with `SetSeed`"
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Feb 10, 2026
Avoided warnings from ITK 6 (v6.0b02), saying:

    warning: 'void itk::Statistics::MersenneTwisterRandomVariateGenerator::Initialize(itk::Statistics::MersenneTwisterRandomVariateGenerator::IntegerType)' is deprecated: ITK 6 discourages using this member function. Please use `SetSeed` instead!

Following ITK pull request InsightSoftwareConsortium/ITK#5346 commit InsightSoftwareConsortium/ITK@7bb3671 "STYLE: Replace `Initialize` calls random number generator with `SetSeed`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants