-
-
Notifications
You must be signed in to change notification settings - Fork 726
Add itk::MakeIndexRange functions and use them
#5812
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
Merged
thewtex
merged 7 commits into
InsightSoftwareConsortium:main
from
N-Dekker:MakeIndexRange
Feb 19, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1a3f4ba
ENH: Add `itk::MakeIndexRange` functions, to ease creating an IndexRange
N-Dekker 7d9584d
STYLE: Use MakeIndexRange in GTest unit tests
N-Dekker cd30320
STYLE: Replace OnlyIndex iterators in RegistrationMethod with IndexRange
N-Dekker 7aa5f26
STYLE: Use MakeIndexRange in BSplineInterpolationWeightFunction
N-Dekker 444fa9f
STYLE: Use `MakeIndexRange(index, size)` in SobelOperator
N-Dekker 44b44bd
STYLE: Use MakeIndexRange in Smoothing filters
N-Dekker 3a00f63
STYLE: Use MakeIndexRange in ContourExtractor2DImageFilter
N-Dekker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,7 +145,11 @@ class ITK_TEMPLATE_EXPORT ContourExtractor2DImageFilter | |
| using InputRealType = typename NumericTraits<InputPixelType>::RealType; | ||
|
|
||
| /** Ranges and iterators for regions */ | ||
| using RegionIndexRange = ImageRegionIndexRange<InputImageType::ImageDimension>; | ||
| #ifndef ITK_FUTURE_LEGACY_REMOVE | ||
| using RegionIndexRange ITK_FUTURE_DEPRECATED( | ||
| "Please use `itk::ImageRegionIndexRange` or `itk::MakeIndexRange` directly!") = | ||
| ImageRegionIndexRange<InputImageType::ImageDimension>; | ||
| #endif | ||
|
Comment on lines
-148
to
+152
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears that this nested |
||
| using RegionRange = ImageRegionRange<InputImageType>; | ||
| using RegionConstRange = ImageRegionRange<const InputImageType>; | ||
|
|
||
|
|
||
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of these simple
MakeIndexRangefunctions, I think we might as well add similar functionality by using CTAD (class template argument deduction). But we had discussion about CTAD before. It might sometimes be risky to use CTAD (looking at Arthur O'Dwyer's blog). And it might sometimes cause compiler warnings (warning: 'T' may not intend to support class template argument deduction [-Wctad-maybe-unsupported]). So maybe we should just stick with such simpleMakefunctions 🤷