Skip to content

STYLE: Remove VTK 8 and VTK 5 branches from examples - #488

Merged
hjmjohnson merged 2 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:enh-remove-vtk8-branches
Sep 16, 2026
Merged

hjmjohnson merged 2 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:enh-remove-vtk8-branches

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Removes the VTK 8 and VTK 5 branches from the examples. ITK's VtkGlue requires VTK 9.1, so none of them can run. Addresses dzenanz's review comment on #481.

Review comment

#481 (comment)

What changed

CMake (57 files):

  • Remove the include(${VTK_USE_FILE}) branches.
  • Remove the _vtk_prefix component prefix.
  • Call vtk_module_autoinit without a version guard.

C++ (13 files):

  • Keep the SetInputData code path.
  • Remove the SetInput branches.
  • Remove the vtkVersion.h includes, which only served those checks.

The change is repo-wide rather than Bridge-only. The same dead branches
also exist in Core, Filtering, Registration, Segmentation, and Remote.

Local verification

Built against ITK main with VtkGlue on and VTK 9.6, on macOS arm64. The
build had 0 failures.

  • 57 of the 60 touched examples produced a binary.
  • Remote/WikiExamples (2 examples) is not built: the module is off.
  • ConnectedComponentsInImage is commented out on main with a TODO.

Tests matching the touched examples ran 59 of 60 passing. The one failure
is ConvolveImageWithKernelTestPython, which failed on import itk. That
comes from the local Python environment, and the test's directory is not
changed here.

pre-commit run --all-files passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S5zzoU6yyUwdLEvjM2s6iS

ITK's VtkGlue requires VTK 9.1, so the VTK_VERSION VERSION_LESS
"8.90.0" branches can never be taken. Drop the VTK_USE_FILE includes
and the _vtk_prefix component prefix, and call vtk_module_autoinit
unconditionally.

Suggested in review of InsightSoftwareConsortium#481.
With VTK 9.1 required, the VTK_MAJOR_VERSION <= 5 SetInput branches
are dead. Keep the SetInputData path and drop the vtkVersion.h
includes that only served those checks.
@github-actions github-actions Bot added area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Remotes Issues affecting the Remote module area:Segmentation Issues affecting the Segmentation module area:Registration Issues affecting the Registration module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Style Style changes: no logic impact (indentation, comments, naming) area:Bridge Issues affecting the Bridge module area:Nonunit Issues affecting the Nonunit module language:C++ Changes to C++ examples labels Sep 15, 2026
@hjmjohnson
hjmjohnson marked this pull request as ready for review September 15, 2026 20:23

@dzenanz dzenanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good on a glance.

@hjmjohnson
hjmjohnson merged commit 32bf48a into InsightSoftwareConsortium:main Sep 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Bridge Issues affecting the Bridge module area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Nonunit Issues affecting the Nonunit module area:Registration Issues affecting the Registration module area:Remotes Issues affecting the Remote module area:Segmentation Issues affecting the Segmentation module language:C++ Changes to C++ examples type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Style Style changes: no logic impact (indentation, comments, naming)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants