From d0f4022ef5f948d2fbacef7bbbd7a6f7e46dd346 Mon Sep 17 00:00:00 2001 From: merdi Date: Fri, 19 Apr 2024 11:39:07 +0200 Subject: [PATCH] set seed before SamplingPercentage for registration --- gems/kvlRegisterImages.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gems/kvlRegisterImages.hxx b/gems/kvlRegisterImages.hxx index 95b5271..4917e06 100644 --- a/gems/kvlRegisterImages.hxx +++ b/gems/kvlRegisterImages.hxx @@ -170,15 +170,15 @@ void RegisterImages 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();