Skip to content

COMP: Add itkImageRegionConstIteratorWithIndex.h include for ITK6 compat#6

Open
hjmjohnson wants to merge 1 commit into
CSIM-Toolkits:mainfrom
hjmjohnson:itk6-add-iterator-header
Open

COMP: Add itkImageRegionConstIteratorWithIndex.h include for ITK6 compat#6
hjmjohnson wants to merge 1 commit into
CSIM-Toolkits:mainfrom
hjmjohnson:itk6-add-iterator-header

Conversation

@hjmjohnson
Copy link
Copy Markdown

Add #include "itkImageRegionConstIteratorWithIndex.h" to BVeR/BVeR.cxx so the extension builds against ITK upstream main (v6 prep).

Why this is needed

ITK upstream main has trimmed transitive includes. BVeR.cxx:185 uses itk::ImageRegionConstIteratorWithIndex but did not include its declaring header directly. Under ITK 5.x this was transitively pulled in via one of the other ITK includes; under ITK main this fails:

BVeR.cxx:185:14: error: 'ImageRegionConstIteratorWithIndex' is not a member of 'itk'; did you mean 'ImageLinearConstIteratorWithIndex'?

Adding the explicit include is fully backward compatible with ITK 5.x (the header has always existed under that name).

Tracking

Part of the Slicer ITK upstream-main (v6) transition tracked at
Slicer/Slicer#9149. The same
transitive-include cleanup pattern was fixed in Slicer/Slicer core (2 sites)
and ANTsX/ANTs master (Utilities/itkSurfaceImageCurvature.h).

ITK upstream main (v6 prep) has trimmed transitive includes. BVeR.cxx uses
`itk::ImageRegionConstIteratorWithIndex` but did not include its declaring
header directly; under ITK 5.x the header was transitively pulled in via
one of the other ITK includes, but ITK upstream main now produces:

  BVeR.cxx:185:14: error: 'ImageRegionConstIteratorWithIndex' is not a member of 'itk'

Add the explicit include. Backward compatible with ITK 5.x (the header has
always existed under that name).
@hjmjohnson hjmjohnson marked this pull request as ready for review May 11, 2026 13:50
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

Successfully merging this pull request may close these issues.

1 participant