Skip to content

Use CalculateProductOfElements in Denoising, ImageStatistics, and IO tests#5541

Merged
thewtex merged 3 commits intoInsightSoftwareConsortium:mainfrom
N-Dekker:Use-CalculateProductOfElements
Oct 9, 2025
Merged

Use CalculateProductOfElements in Denoising, ImageStatistics, and IO tests#5541
thewtex merged 3 commits intoInsightSoftwareConsortium:mainfrom
N-Dekker:Use-CalculateProductOfElements

Conversation

@N-Dekker
Copy link
Contributor

@N-Dekker N-Dekker commented Oct 2, 2025

Replaced for loops with equivalent calls to Size::CalculateProductOfElements().

Most cases were found by the following regular expression:

^([ ]+)for .+\r\n\1{\r\n\1  .+\*= .+Size.+;\r\n\1}

Replaced a `for` loop with a call to `Size::CalculateProductOfElements()`.
Replaced a `for` loop with a call to `CalculateProductOfElements()`, in both
ImagePCADecompositionCalculator and ImagePCAShapeModelEstimator.
Replaced a `for` loop with a call to `CalculateProductOfElements()`, in each
of the three large image write/read tests.
@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module labels Oct 2, 2025
@N-Dekker
Copy link
Contributor Author

N-Dekker commented Oct 3, 2025

The ITK.Linux CI failures appear unrelated to this pull request:


Internal ctest changing into directory: /home/vsts/work/1/s-build/Testing/Temporary/ITKImageFeature
CMake Error: Unable to read from file 'itkHessianRecursiveGaussianFilterTest.txt': Can't lstat itkHessianRecursiveGaussianFilterTest.txt
Error creating tar while encoding file: /home/vsts/work/1/s-build/Testing/Temporary/ITKImageFeature/itkHessianRecursiveGaussianFilterTest.txt
...

@N-Dekker N-Dekker marked this pull request as ready for review October 3, 2025 08:56
@N-Dekker
Copy link
Contributor Author

N-Dekker commented Oct 3, 2025

/azp run ITK.Linux

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

🚀

@thewtex thewtex merged commit aac0b8e into InsightSoftwareConsortium:main Oct 9, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants