diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h index e366877c970..68874af9efc 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h @@ -532,7 +532,7 @@ class ITK_TEMPLATE_EXPORT ImageRegistrationMethodv4 : public ProcessObject SetMetricSamplePoints(); SizeValueType m_CurrentLevel; - SizeValueType m_NumberOfLevels; + SizeValueType m_NumberOfLevels{ 0 }; SizeValueType m_CurrentIteration; RealType m_CurrentMetricValue; RealType m_CurrentConvergenceValue; diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx index 54c6a21cdc2..78ec3ed29da 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx @@ -99,7 +99,7 @@ ImageRegistrationMethodv4ProcessObject::SetNthOutput(0, transformDecorator); this->m_OutputTransform = transformDecorator->GetModifiable(); - // By default we set up a 3-level image registration. + // Default to a 3-level image registration: force the initialization of the ivars that depend on the number of levels. this->SetNumberOfLevels(3); this->m_ShrinkFactorsPerLevel.resize(this->m_NumberOfLevels);