Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Let elx::ConjugateGradientFRPR override ITK's FRPROptimizer #1118

Merged
merged 1 commit into from
May 14, 2024

Conversation

N-Dekker
Copy link
Member

elx::ConjugateGradientFRPR member functions GetValueAndDerivative and LineOptimize did originally override the corresponding virtual member functions of ITK's FRPROptimizer. This property was broken by a change in the signature of those ITK member functions: ITK commit InsightSoftwareConsortium/ITK@a088a95, "PERF: Changed to pass by reference for faster performance", 2008-04-23

This commit restores those "overrides", by adjusting the signature of the elx::ConjugateGradientFRPR member functions, in accordance with those ITK member functions.

Bug found by macos-12/clang compiler warnings, like:

warning: 'elastix::ConjugateGradientFRPR::GetValueAndDerivative' hides overloaded virtual function [-Woverloaded-virtual]

Note: These two elx::ConjugateGradientFRPR member functions don't seem to be tested at the CI, currently.

`elx::ConjugateGradientFRPR` member functions GetValueAndDerivative and LineOptimize did originally override the corresponding virtual member functions of ITK's FRPROptimizer. This property was broken by a change in the signature of those ITK member functions: ITK commit InsightSoftwareConsortium/ITK@a088a95, "PERF: Changed to pass by reference for faster performance", 2008-04-23

This commit restores those "overrides", by adjusting the signature of the `elx::ConjugateGradientFRPR` member functions, in accordance with those ITK member functions.

Bug found by macos-12/clang compiler warnings, like:

> warning: 'elastix::ConjugateGradientFRPR::GetValueAndDerivative' hides overloaded virtual function [-Woverloaded-virtual]

Note: These two `elx::ConjugateGradientFRPR` member functions don't seem to be tested at the CI, currently.
Comment on lines -170 to +171
virtual void
GetValueAndDerivative(ParametersType p, double * val, ParametersType * xi);
void
GetValueAndDerivative(ParametersType & p, double * val, ParametersType * xi) override;
Copy link
Member Author

Choose a reason for hiding this comment

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

@mstaring @stefanklein This might be a serious bug fix, at least if ConjugateGradientFRPR is still a relevant optimizer. Because of an ITK update back in 2008, ConjugateGradientFRPR did not properly override ITK's FRPROptimizer member functions anymore. (Note that this functionality is untested anyway.)

@N-Dekker
Copy link
Member Author

While it may or may not be an important bug fix, I think it must be merged anyway!

@N-Dekker N-Dekker merged commit 34bdc3b into main May 14, 2024
7 of 8 checks passed
@N-Dekker N-Dekker deleted the Let-elxConjugateGradientFRPR-override-ITK branch May 14, 2024 15:12
@stefanklein
Copy link
Member

stefanklein commented May 14, 2024 via email

N-Dekker added a commit that referenced this pull request May 16, 2024
Following ITK commit InsightSoftwareConsortium/ITK@c701410, June 14, 2011, which modified the signature of `ImageSource::SplitRequestedRegion`.

Similar to pull request #1118 commit 34bdc3b "BUG: Let `elx::ConjugateGradientFRPR` override ITK's FRPROptimizer"

Bug found by macos-12/clang `-Woverloaded-virtual` warnings.
N-Dekker added a commit that referenced this pull request May 16, 2024
Adjusted `ParabolicErodeDilateImageFilter::SplitRequestedRegion` to ensure that its signature matches `ImageSource::SplitRequestedRegion` (again). Following ITK commit InsightSoftwareConsortium/ITK@c701410, June 14, 2011, which modified the signature of `ImageSource::SplitRequestedRegion`, by replacing signed with unsigned integers.

Similar to pull request #1118 commit 34bdc3b "BUG: Let `elx::ConjugateGradientFRPR` override ITK's FRPROptimizer"

Note: This commit changes the behavior (restoring the originally intended behavior), because `ParabolicErodeDilateImageFilter::SplitRequestedRegion` does avoid the current dimension (`m_CurrentDimension`), when setting the `splitAxis`.

Bug found by macos-12/clang `-Woverloaded-virtual` warnings.
N-Dekker added a commit that referenced this pull request May 17, 2024
Adjusted `ParabolicErodeDilateImageFilter::SplitRequestedRegion` to ensure that its signature matches `ImageSource::SplitRequestedRegion` (again). Following ITK commit InsightSoftwareConsortium/ITK@c701410, June 14, 2011, which modified the signature of `ImageSource::SplitRequestedRegion`, by replacing signed with unsigned integers.

Similar to pull request #1118 commit 34bdc3b "BUG: Let `elx::ConjugateGradientFRPR` override ITK's FRPROptimizer"

Note: This commit changes the behavior (restoring the originally intended behavior), because `ParabolicErodeDilateImageFilter::SplitRequestedRegion` does avoid the current dimension (`m_CurrentDimension`), when setting the `splitAxis`.

Bug found by macos-12/clang `-Woverloaded-virtual` warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants