Skip to content

Comments

Remove GoToBegin() calls on local ImageRegionIteratorWithIndex variables#5736

Merged
dzenanz merged 2 commits intoInsightSoftwareConsortium:mainfrom
N-Dekker:Remove-GoToBegin-calls-ImageRegionIteratorWithIndex
Jan 21, 2026
Merged

Remove GoToBegin() calls on local ImageRegionIteratorWithIndex variables#5736
dzenanz merged 2 commits intoInsightSoftwareConsortium:mainfrom
N-Dekker:Remove-GoToBegin-calls-ImageRegionIteratorWithIndex

Conversation

@N-Dekker
Copy link
Contributor

The Iterator(image, region) constructors of ImageRegionIteratorWithIndex and ImageRegionConstIteratorWithIndex do already
initialize the iterator at the begin of its region.

The `ImageRegionConstIteratorWithIndex(image, region)` constructor does already
initialize the iterator at the begin of its region.
The `ImageRegionIteratorWithIndex(image, region)` constructor does already
initialize the iterator at the begin of its region.
@github-actions github-actions bot added area:Filtering Issues affecting the Filtering module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Numerics Issues affecting the Numerics module labels Jan 21, 2026
@N-Dekker N-Dekker marked this pull request as ready for review January 21, 2026 15:30
@N-Dekker
Copy link
Contributor Author

I think we can ignore the failure of ITK.macOS.Arm64 / macOS-x86_64-rosetta (pull_request)

https://open.cdash.org/tests/2361124478 just reports a failure of vnl_test_hungarian_algorithm, which is unrelated to this PR:

Test: vnl_test_hungarian_algorithm (Failed)
Build: macOS-Build21214248983-Remove-GoToBegin-calls-ImageRegionIteratorWithIndex (GitHub.InsightSoftwareConsortium/ITK) on 2026-01-21 14:57:18
Repository revision: bac2cd3fe04cd8a1f237f68ef466cabd3d55432f

@dzenanz dzenanz merged commit 4427670 into InsightSoftwareConsortium:main Jan 21, 2026
15 of 17 checks passed
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Feb 15, 2026
Reduced the scope of the local `inputIt` variable in `GenerateDataForLabels()`,
by moving its declaration into the _init-statement_ of its `for` loop. Following
C++ Core Guidelines, Jul 8, 2025 "Declare names in for-statement initializers
and conditions to limit scope",
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#res-cond

Removed the `inputIt.GoToBegin()` call, following pull request
InsightSoftwareConsortium#5736
commit f10bd8f
"STYLE: Remove GoToBegin() calls on ImageRegionIteratorWithIndex"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Feb 15, 2026
Reduced the scope of the local `inputIt` variable in `GenerateDataForLabels()`,
by moving its declaration into the _init-statement_ of its `for` loop. Following
C++ Core Guidelines, Jul 8, 2025 "Declare names in for-statement initializers
and conditions to limit scope",
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#res-cond

Removed the `inputIt.GoToBegin()` call, following pull request
InsightSoftwareConsortium#5736
commit f10bd8f
"STYLE: Remove GoToBegin() calls on ImageRegionIteratorWithIndex"
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:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants