Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ class ITK_TEMPLATE_EXPORT ImageRegistrationMethodv4 : public ProcessObject
SetMetricSamplePoints();

SizeValueType m_CurrentLevel;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to move all of these ivar initializations here?

Copy link
Copy Markdown
Member Author

@jhlegarreta jhlegarreta Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a style change. I used the initialization list to fix the bug because the initialization trend that is being pushed in the code base is that one. IMHO best would be to propose the style change you propose in a separate PR. I could do a separate commit within this PR, but I prefer the bug to be fixed and merged as soon as possible.

I also realize that the implementation file contains method documentation blocks. Following the previous comment, best would be to do a separate PR to address that.

Anybody is welcome to contribute with them.

SizeValueType m_NumberOfLevels;
SizeValueType m_NumberOfLevels{ 0 };
SizeValueType m_CurrentIteration;
RealType m_CurrentMetricValue;
RealType m_CurrentConvergenceValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ImageRegistrationMethodv4<TFixedImage, TMovingImage, TTransform, TVirtualImage,
this->ProcessObject::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);
Expand Down