Remove local type aliases of IteratorWithIndex in *.hxx files#5839
Merged
hjmjohnson merged 3 commits intoInsightSoftwareConsortium:mainfrom Feb 27, 2026
Conversation
Made it easier to figure out when an iterator "with index" is being used.
Made it easier to figure out when an iterator "with index" is being used.
Made it easier to figure out when an iterator "with index" is being used.
Using Notepad++, Replace in Files, doing:
Find what: ^[ ]+ using (\w+) = (Image\w+IteratorWithIndex<\w+>);\r\n(.*?[^\w])\1
Replace with: $3$2
(*) Regular expression
[v] . matches newline
dzenanz
approved these changes
Feb 26, 2026
Member
dzenanz
left a comment
There was a problem hiding this comment.
Mild approval. Reservation: this sometimes makes the iterator declaration span multiple lines.
Contributor
Author
Thanks @dzenanz As far as I can see, it only happens a few times that these iterator declaration span multiple lines. Most cases still fit on a line. Other mitigating factors:
|
hjmjohnson
approved these changes
Feb 27, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Made it easier to figure out when an iterator "with index" is being used.
Using Notepad++, Replace in Files, doing:
BinomialBlurImageFilter and CheckerBoardImageFilter were adjusted manually.
Note: it appears that some filters accidentally use an iterator "with index", while they should have used a different iterator type, for performance reasons. Such possible mistakes should be easier to spot when it is directly obvious from the iterator variable declarations that those iterators are "with index".
When reviewing, it might be helpful to ignore whitespace changes: https://github.com/InsightSoftwareConsortium/ITK/pull/5839/changes?w=1