Skip to content

ENH: Add namespace to ITK autoload symbol#14

Draft
blowekamp wants to merge 1 commit intoSlicer:slicer-v5.4.5-2025-11-19-f51594afrom
blowekamp:itk_namespace_itkLoad
Draft

ENH: Add namespace to ITK autoload symbol#14
blowekamp wants to merge 1 commit intoSlicer:slicer-v5.4.5-2025-11-19-f51594afrom
blowekamp:itk_namespace_itkLoad

Conversation

@blowekamp
Copy link
Copy Markdown

The ITK plugin system autoload libraries and checks for a defined symbol. Update this expected symbol to use the namespace. The load function is now defined as: ITK_LOAD_FUNCTION_NAME

@blowekamp
Copy link
Copy Markdown
Author

@dzenanz @lassoan Symbols in Slicer for the MRML IO will also need to be updated.

Partially addresses Slicer/Slicer#8947

Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Mostly looks good.

Comment thread Modules/Core/Common/src/itkNamespace.h.in Outdated
@lassoan
Copy link
Copy Markdown

lassoan commented Jan 13, 2026

It looks good to me, too. Could you get the change in ITK so that we can backport it from there?

@jcfr does it look good to you, too?

The ITK plugin system autoloads libraries and checks for a defined
symbol. Update this expected symbol to use the namespace. The load
function is now defined as: ITK_LOAD_FUNCTION_NAME
@blowekamp blowekamp force-pushed the itk_namespace_itkLoad branch from ee13552 to 855c950 Compare January 13, 2026 20:17
@blowekamp
Copy link
Copy Markdown
Author

It looks good to me, too. Could you get the change in ITK so that we can backport it from there?

@jcfr does it look good to you, too?

It could me merged into the current ITK namespace change for one commit for the namespace changes. Unfortunately this current change has hardcoded slicer_itk namespace and is not suitable for being push upstream yet. I am not familiar with the history of this issue and PR in details enough.

ruffsl added a commit to ruffsl/Slicer that referenced this pull request Mar 17, 2026
Slicer's ITK fork (slicer-v5.4.5-2025-11-19) carries 6 patches beyond
upstream ITK 5.4.5 that add APIs not available in system ITK:

- AxesReorder enum on NrrdImageIO for 5D NRRD support (upstream in ITK
  master via InsightSoftwareConsortium/ITK#5476, but not in any 5.4.x
  release). vtkITKImageSequenceReader.cxx uses AxesReorder extensively
  (60+ call sites), making conditional compilation impractical. System
  ITK becomes feasible once ITK 5.5 releases with AxesReorder included.
- Custom ITK namespace (slicer_itk) to avoid symbol conflicts when
  SimpleITK/ITK Python wheels are loaded alongside Slicer
  (Slicer#8947, Slicer/ITK#14 — draft, not yet suitable for
  upstream). This would remain the only blocker after ITK 5.5 and is
  optional unless loading external ITK Python packages.

DCMTK must also revert to superbuild-managed: with ITK built by the
superbuild, its bundled DCMTK would conflict with a system DCMTK at
the symbol level (undefined references to OFConsole::instance() et al).
System DCMTK only works cleanly with system ITK via
ITK_USE_SYSTEM_DCMTK=ON in the slicerItk override.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants