Skip to content

COMP: Switch IOTransformDCMTK test from GDCMImageIO to DCMTKImageIO#6456

Open
hjmjohnson wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:fix-iodcmtk-use-dcmtkimageio
Open

COMP: Switch IOTransformDCMTK test from GDCMImageIO to DCMTKImageIO#6456
hjmjohnson wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:fix-iodcmtk-use-dcmtkimageio

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Switch itkDCMTKTransformIOResampleTest from GDCMImageIO/GDCMSeriesFileNames
to DCMTKImageIO/DCMTKSeriesFileNames now that ITKIODCMTK is in ITK proper
(PR #6310). Removes the unused ITKIOGDCM test dependency.

Resolves #6309

Baseline regeneration

DCMTKSeriesFileNames sorts slices by InstanceNumber (0020,0013) rather than
ImagePositionPatient, so the resampled output has different geometry from the
old GDCM-generated baseline (origin_z −12.5 vs −49.5, spacing_z 0.626 vs 1.0).
Baseline regenerated from DCMTKImageIO output; comparison reports 0 image error.
New CID uploaded to ITKTestingData (commit cb41220 on gh-pages).

@github-actions github-actions Bot added type:Compiler Compiler support or related warnings type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:IO Issues affecting the IO module labels Jun 16, 2026
@hjmjohnson hjmjohnson marked this pull request as ready for review June 16, 2026 22:56
@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Switches itkDCMTKTransformIOResampleTest from GDCMImageIO/GDCMSeriesFileNames to DCMTKImageIO/DCMTKSeriesFileNames, removing the now-unnecessary ITKIOGDCM test dependency. The baseline image is regenerated because DCMTKSeriesFileNames orders slices by InstanceNumber rather than ImagePositionPatient, producing different output geometry.

  • itk-module.cmake: ITKIOGDCM dropped from TEST_DEPENDS; ITKIODCMTK (already listed) provides the new dependency.
  • itkDCMTKTransformIOResampleTest.cxx: All substituted API calls (SetInputDirectory, GetInputFileNames, GetSeriesUIDs) exist on DCMTKSeriesFileNames, and the DCMTK metadata-dictionary key format ("GGGG|EEEE") is confirmed to match GDCM's, so the 0020|0052 lookup is safe.
  • content-links.manifest: New baseline CID registered; the entry has an extra space that should be one (see inline comment).

Confidence Score: 4/5

Safe to merge; only finding is a cosmetic double-space in one manifest line.

The substitution is straightforward: every GDCM API call has a direct DCMTK equivalent with matching signatures, the metadata key format is confirmed identical between both IO backends, and the itk-module.cmake dependency list is correct. The only issue is the extra space in the manifest entry, which is harmless to the build and test infrastructure but inconsistent with the rest of the file.

Testing/Data/content-links.manifest — double-space in the new entry.

Important Files Changed

Filename Overview
Modules/IO/IOTransformDCMTK/itk-module.cmake Removes ITKIOGDCM from TEST_DEPENDS; ITKIODCMTK (already present) covers the new DCMTKImageIO/DCMTKSeriesFileNames requirement.
Modules/IO/IOTransformDCMTK/test/itkDCMTKTransformIOResampleTest.cxx GDCMImageIO/GDCMSeriesFileNames replaced with DCMTKImageIO/DCMTKSeriesFileNames; all three used methods (SetInputDirectory, GetInputFileNames, GetSeriesUIDs) are present in the DCMTK API, and the metadata key format is identical between both IO implementations.
Modules/IO/IOTransformDCMTK/test/Baseline/DicomTransformResampledMovingOutputBaseline.mha.cid CID updated to match the DCMTK-resampled baseline; expected given DCMTKSeriesFileNames sorts by InstanceNumber rather than ImagePositionPatient, yielding different geometry.
Testing/Data/content-links.manifest New CID registered for the regenerated baseline; entry has two spaces instead of one between the CID and the path, inconsistent with every other line in the file and with what upload.py writes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[itkDCMTKTransformIOResampleTest] --> B[DCMTKSeriesFileNames\nGetInputFileNames / GetSeriesUIDs]
    B --> C[ImageSeriesReader\nSetImageIO DCMTKImageIO]
    C --> D[fixedReader / movingReader Update]
    D --> E[DCMTKImageIO MetaDataDictionary\nFrameOfReferenceUID lookup]
    E --> F[DCMTKTransformIO\nSetFrameOfReferenceUID]
    F --> G[TransformFileReader Update x2]
    G --> H[ResampleImageFilter\nfixed to moving]
    H --> I[ImageFileWriter\nresampledMovingOutput]
    I --> J[Baseline comparison\nDicomTransformResampledMovingOutputBaseline.mha]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[itkDCMTKTransformIOResampleTest] --> B[DCMTKSeriesFileNames\nGetInputFileNames / GetSeriesUIDs]
    B --> C[ImageSeriesReader\nSetImageIO DCMTKImageIO]
    C --> D[fixedReader / movingReader Update]
    D --> E[DCMTKImageIO MetaDataDictionary\nFrameOfReferenceUID lookup]
    E --> F[DCMTKTransformIO\nSetFrameOfReferenceUID]
    F --> G[TransformFileReader Update x2]
    G --> H[ResampleImageFilter\nfixed to moving]
    H --> I[ImageFileWriter\nresampledMovingOutput]
    I --> J[Baseline comparison\nDicomTransformResampledMovingOutputBaseline.mha]
Loading

Reviews (1): Last reviewed commit: "COMP: Switch IOTransformDCMTK test from ..." | Re-trigger Greptile

Comment thread Testing/Data/content-links.manifest Outdated
itkDCMTKTransformIOResampleTest used GDCMImageIO/GDCMSeriesFileNames to
read DICOM series because DCMTKImageIO was not in ITK proper at the time
the test was written.  PR InsightSoftwareConsortium#6310 ingested ITKIODCMTK; switch the test to
use the same reader as the rest of the module.

DCMTKSeriesFileNames sorts slices by InstanceNumber rather than
ImagePositionPatient, so the output geometry differs from the GDCM
baseline.  The baseline has been regenerated from DCMTKImageIO output;
image content is verified identical (0 error).

Resolves InsightSoftwareConsortium#6309
@hjmjohnson hjmjohnson force-pushed the fix-iodcmtk-use-dcmtkimageio branch from b364926 to 5508aab Compare June 17, 2026 00:09
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 type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IOTransformDCMTK example uses GDCM fallback; verify DCMTKImageIO MetaDataDictionary path works end-to-end

1 participant