Skip to content
Snippets Groups Projects
Commit 73b12b62 authored by Guillaume Pernot's avatar Guillaume Pernot
Browse files

set rand in DoExecute

parent 7c6a72c8
No related branches found
No related tags found
No related merge requests found
......@@ -180,9 +180,6 @@ private:
void DoUpdateParameters() override
{
if (!HasUserValue("rand")) {
SetParameterInt("rand", std::time(0));
}
}
void DoExecute() override
......@@ -253,6 +250,11 @@ private:
itk::RandomPermutation randPerm(numberOfStreamDivisions);
unsigned int index = 0;
// Randomize seed if not given
if (!HasUserValue("rand")) {
SetParameterInt("rand", std::time(0));
}
// reset seed and step once (itk::RandomPermutation may have used it)
randomGen->SetSeed(GetParameterInt("rand"));
randomGen->GetVariateWithClosedRange();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment