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

AdvancedImageToImageMetric, AdvancedMeanSquaresImageToImageMetric estimating min and max twice, redundantly #1047

Open
N-Dekker opened this issue Feb 16, 2024 · 0 comments

Comments

@N-Dekker
Copy link
Member

Both AdvancedImageToImageMetric::Initialize() and AdvancedImageToImageMetric::InitializeLimiters() use ComputeImageExtremaFilter to estimate the minimum and the maximum pixel value of the fixed and the moving image. Now the first member function also calls the second one, indirectly, causing the expensive ComputeImageExtremaFilter to be executed more than necessary.

Looking back at commit 592608c (January 15, 2018), it looks like it it that way already for a while:

this->m_FixedImageTrueMax = computeFixedImageExtrema->GetMaximum();
this->m_FixedImageTrueMin = computeFixedImageExtrema->GetMinimum();

this->m_FixedImageTrueMax = computeFixedImageExtrema->GetMaximum();
this->m_FixedImageTrueMin = computeFixedImageExtrema->GetMinimum();

While AdvancedMeanSquaresImageToImageMetric::Initialize() also calling AdvancedImageToImageMetric::Initialize():

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

No branches or pull requests

1 participant