Skip to content

Commit 3bac4ac

Browse files
committed
ENH: Run itkSimpleImageRegistrationTest fully in Debug builds
The test reduced the affine and deformable optimizers to a single iteration when NDEBUG was undefined, a 2013 stopgap for Debug wall time. A one-iteration registration stops at near-identity and tests nothing useful, and its output required a Debug-only baseline. That baseline was itkSimpleImageRegistrationTest.3.nii, dropped as stale when the baselines were regenerated for the JointHistogramMutualInformation fix in PR #6569. Since then every Debug build that runs these tests has failed them: corista.kitware Ubuntu-22.04-gcc11.4-TBB-Debug, ryzenator.kitware Windows11-VS2022-Static-DebugTBB, RogueResearch19 Mac27.x-AppleClang-dbg-arm64, and the SimpleITK itk-coverage nightly. ITK's own Azure Debug job excludes the RUNS_LONG label, so PR CI never ran them. Using the full iteration counts makes the Debug result bit-identical to Release, so the existing baselines cover both and no Debug-only baseline can go stale again. Measured on gcc 13.3 x86_64: the pair takes 44 s wall under ctest -j2 (42 s + 44 s serial), against 5 s for the one-iteration form.
1 parent 07382b5 commit 3bac4ac

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,7 @@ PerformSimpleImageRegistration(int argc, char * argv[])
225225
{
226226
itkGenericExceptionMacro("Error dynamic_cast failed");
227227
}
228-
#ifdef NDEBUG
229228
affineOptimizer->SetNumberOfIterations(std::stoi(argv[6]));
230-
#else
231-
affineOptimizer->SetNumberOfIterations(1);
232-
#endif
233229
affineOptimizer->SetDoEstimateLearningRateOnce(false); // true by default
234230
affineOptimizer->SetDoEstimateLearningRateAtEachIteration(true);
235231
affineOptimizer->SetScalesEstimator(scalesEstimator1);
@@ -293,11 +289,7 @@ PerformSimpleImageRegistration(int argc, char * argv[])
293289

294290
auto optimizer = GradientDescentOptimizerv4Type::New();
295291
optimizer->SetLearningRate(1.0);
296-
#ifdef NDEBUG
297292
optimizer->SetNumberOfIterations(std::stoi(argv[7]));
298-
#else
299-
optimizer->SetNumberOfIterations(1);
300-
#endif
301293
optimizer->SetScalesEstimator(scalesEstimator);
302294
optimizer->SetDoEstimateLearningRateOnce(false); // true by default
303295
optimizer->SetDoEstimateLearningRateAtEachIteration(true);

0 commit comments

Comments
 (0)