Skip to content

COMP: Use itk::IOComponentEnum and include vnl_svd.h for ITK 6 - #1294

Merged
Sunderlandkyl merged 1 commit into
PlusToolkit:masterfrom
hjmjohnson:comp-itk6-legacy-io-component
Oct 2, 2026
Merged

Sunderlandkyl merged 1 commit into
PlusToolkit:masterfrom
hjmjohnson:comp-itk6-legacy-io-component

Conversation

@hjmjohnson

Copy link
Copy Markdown
Contributor

Builds PlusLib against an ITK 6 that has ITK_LEGACY_REMOVE on. Two changes, both valid on ITK 5.4 as well. Continues the ITK 6 compatibility work in #1279, #1280, #1282, and #1283.

What breaks and why

itk::ImageIOBase::IOComponentType is a legacy alias, compiled out when
ITK_LEGACY_REMOVE is defined. ITK declares that option as

cmake_dependent_option(ITK_LEGACY_REMOVE "..." OFF "NOT ITK_WRAPPING" ON)

so any ITK built with wrapping enabled forces it ON, and the alias disappears.
itk::IOComponentEnum is the namespace-scope name; it exists in ITK 5.4 and
ITK 6 alike, aliasing CommonEnums::IOComponent.

vnl_svd was used in vtkPlusProbeCalibrationOptimizerAlgo.cxx without
including its header; it arrived transitively through an ITK header. ITK 6
trimmed those includes, so the file now includes <vnl/algo/vnl_svd.h>
directly.

Verification

Built against ITK main (6.0.0.20260907) with ITK_WRAP_PYTHON=ON, VTK 9.6,
macOS arm64: 0 failed targets, 10 libraries.

Before the change the same tree failed 16 compiles, all on the removed alias,
then 1 on the missing vnl_svd include.

Not built against ITK 5.4 here, but itk::IOComponentEnum is present in that
release and an explicit include is always valid, so neither change is
version-specific.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S5zzoU6yyUwdLEvjM2s6iS

ITK removes itk::ImageIOBase::IOComponentType when ITK_LEGACY_REMOVE is
ON, which ITK forces whenever it is built with wrapping enabled. The
namespace-scope itk::IOComponentEnum is present in both ITK 5.4 and
ITK 6, so this spelling builds against either.

vtkPlusProbeCalibrationOptimizerAlgo used vnl_svd without including it,
relying on an ITK header to pull it in transitively; ITK 6 no longer
does. Include it directly.
@hjmjohnson
hjmjohnson marked this pull request as ready for review September 16, 2026 15:01
@Sunderlandkyl
Sunderlandkyl merged commit 754f16b into PlusToolkit:master Oct 2, 2026
9 checks passed
hjmjohnson added a commit to hjmjohnson/itk_forest_build_testbed that referenced this pull request Oct 23, 2026
PlusLib master uses itk::ImageIOBase::IOComponentType, which ITK removes
whenever ITK_LEGACY_REMOVE is on -- and ITK forces that on for any build
with wrapping enabled. It also uses vnl_svd without including it. Both
are fixed in PlusToolkit/PlusLib#1294, in review.

Declare fork_remote/fork_url/fork_ref for PlusLib and (re)base its
worktree on that branch, the same way Plastimatch and ANTs already do.
Delete the three keys when #1294 merges; the dispatch is a no-op once
they are gone.
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.

2 participants