Skip to content

Commit

Permalink
Merge pull request #14 from diedrim/sampling_seed
Browse files Browse the repository at this point in the history
set seed before SamplingPercentage for registration
  • Loading branch information
ste93ste authored Apr 19, 2024
2 parents 1d052da + d0f4022 commit ccafc44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gems/kvlRegisterImages.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ void RegisterImages<TransformationType, MetricType>
optimizer->SetScalesEstimator(scalesEstimator);
}

//Could be skipped if we don't need to test
constexpr int randomNumberGeneratorSeed = 121213;
registration->MetricSamplingReinitializeSeed(randomNumberGeneratorSeed);

//Set sampling strategy
typename RegistrationType::MetricSamplingStrategyType samplingStrategy = RegistrationType::RANDOM;
registration->SetMetricSamplingStrategy(samplingStrategy);
registration->SetMetricSamplingPercentage(m_SamplingPercentage);

//Could be skipped if we don't need to test
constexpr int randomNumberGeneratorSeed = 121213;
registration->MetricSamplingReinitializeSeed(randomNumberGeneratorSeed);


//Add the observer
CommandIterationUpdate::Pointer observer = CommandIterationUpdate::New();
Expand Down

0 comments on commit ccafc44

Please sign in to comment.