Skip to content

COMP: IO modules publicly depend on ImageIOBase#6070

Open
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
hjmjohnson:fix-io-module-public-depends
Open

COMP: IO modules publicly depend on ImageIOBase#6070
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
hjmjohnson:fix-io-module-public-depends

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Move ITKIOImageBase from PRIVATE_DEPENDS to DEPENDS for 4 IO modules whose public headers #include "itkImageIOBase.h" or inherit from ImageIOBase: DCMTK, GE, LSM, and the Philips REC module.

Follows the same fix applied to VTK in #5850. With PRIVATE_DEPENDS, downstream projects that consume these modules' public headers may not receive the transitive include paths and link targets for ITKIOImageBase.

Header analysis confirming public dependency

Each module was verified to have public headers that directly reference ITKIOImageBase types:

  • DCMTK: itkDCMTKImageIO.h includes itkImageIOBase.h, DCMTKImageIO inherits from ImageIOBase
  • GE: itkGE4ImageIOFactory.h, itkGE5ImageIOFactory.h, itkGEAdwImageIOFactory.h include itkImageIOBase.h
  • LSM: itkLSMImageIOFactory.h includes itkImageIOBase.h
  • Philips REC: itkPhilipsRECImageIO.h includes itkImageIOBase.h, inherits from ImageIOBase

Not included: ITKIOCSV — its public headers do not reference any IOImageBase types. Its PRIVATE_DEPENDS ITKIOImageBase may be vestigial or only needed for module infrastructure, and warrants separate investigation.

Local build verification
  • Configure: passed (ITK 6.0.0, CMake 3.26.6, Ninja, macOS)
  • Build: 1145 incremental targets, 0 errors
  • Tests: 4/4 IO module tests passed (GE, LSM; DCMTK and Philips REC are EXCLUDE_FROM_DEFAULT)
  • Generated module configs verified: ITKIOImageBase appears in PUBLIC_DEPENDS and TRANSITIVE_DEPENDS
  • gersemi pre-commit check: passed

DCMTK, GE, LSM, and PhilipsREC have public headers that
#include itkImageIOBase.h or inherit from ImageIOBase, making
ITKIOImageBase a genuine public dependency. Move it from
PRIVATE_DEPENDS to DEPENDS so downstream consumers receive
the transitive include paths and link targets.

Follows the same pattern as the VTK fix in PR InsightSoftwareConsortium#5850.
@github-actions github-actions bot added type:Compiler Compiler support or related warnings area:IO Issues affecting the IO module labels Apr 15, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 15, 2026

Greptile Summary

Promotes ITKIOImageBase from PRIVATE_DEPENDS to DEPENDS in four IO modules (DCMTK, GE, LSM, PhilipsREC) whose public headers directly include itkImageIOBase.h or inherit from ImageIOBase, following the same pattern applied to VTK in #5850. All four header inclusions were confirmed in the actual public include files, and the GE module correctly drops its now-empty PRIVATE_DEPENDS block.

Confidence Score: 5/5

Safe to merge — all four changes are correct, minimal, and verified against actual public headers.

Every changed module was confirmed to have public headers that directly include itkImageIOBase.h or inherit from ImageIOBase. The fix is consistent with the precedent set by #5850 for the VTK module. No regressions are introduced; other modules (GDCM, NIFTI, HDF5) already had ITKIOImageBase in DEPENDS and are unaffected.

No files require special attention.

Important Files Changed

Filename Overview
Modules/IO/DCMTK/itk-module.cmake Moves ITKIOImageBase from PRIVATE_DEPENDS to DEPENDS; correct because itkDCMTKImageIO.h publicly includes itkImageIOBase.h.
Modules/IO/GE/itk-module.cmake Moves ITKIOImageBase from PRIVATE_DEPENDS to DEPENDS and removes the now-empty PRIVATE_DEPENDS block; correct because all three GE factory headers publicly include itkImageIOBase.h.
Modules/IO/LSM/itk-module.cmake Moves ITKIOImageBase to DEPENDS while keeping ITKTIFF in PRIVATE_DEPENDS; correct because itkLSMImageIOFactory.h publicly includes itkImageIOBase.h.
Modules/IO/PhilipsREC/itk-module.cmake Moves ITKIOImageBase to DEPENDS while keeping ITKZLIB in PRIVATE_DEPENDS; correct because itkPhilipsRECImageIO.h publicly includes itkImageIOBase.h and inherits ImageIOBase.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before["Before (PRIVATE_DEPENDS)"]
        D1[ITKIODCMTK] -.->|private| B[ITKIOImageBase]
        G1[ITKIOGE] -.->|private| B
        L1[ITKIOLSM] -.->|private| B
        P1[ITKIOPhilipsREC] -.->|private| B
    end

    subgraph After["After (DEPENDS)"]
        D2[ITKIODCMTK] -->|public| B2[ITKIOImageBase]
        G2[ITKIOGE] -->|public| B2
        L2[ITKIOLSM] -->|public| B2
        P2[ITKIOPhilipsREC] -->|public| B2
    end

    subgraph Impact
        C[Downstream consumers] -->|now receive transitive| B2
        note["Public headers include itkImageIOBase.h\nor inherit from ImageIOBase"]
    end
Loading

Reviews (2): Last reviewed commit: "COMP: IO modules publicly depend on Imag..." | Re-trigger Greptile

@hjmjohnson hjmjohnson marked this pull request as draft April 15, 2026 16:36
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run ITK.Windows

@hjmjohnson hjmjohnson marked this pull request as ready for review April 15, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:IO Issues affecting the IO module type:Compiler Compiler support or related warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant