InsightSoftwareConsortium / InsightSoftwareConsortium/ITK
BUG: GDCMImageIO/ImageSeriesReader collapse multi-segment DICOM SEG objects to a single 3D volume
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 748
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 64
Description
## Summary
`GDCMImageIO` / `ImageSeriesReader` read a DICOM Segmentation Storage (SEG) object as a single 3D volume and have no concept of per-segment sub-stacks. When a SEG file contains **multiple segments** — which may have **different per-segment z-extents (frame counts)** — ITK collapses them into one 3D output, silently losing all but one segment's geometry/labeling.
This is a **structural limitation**, distinct from the single-bit decode defect tracked in #6641 (which is about pixel *values* on a single volume). It was raised by **@issakomi** on PR #6639.
## Steps to reproduce
1. Generate a multi-segment SEG (e.g. TotalSegmentator output, which uses [highdicom](https://github.com/ImagingDataCommons/highdicom)) containing ≥2 segments with differing z-extents.
2. Read it with `itk::ImageSeriesReader` + `GDCMImageIO`.
**Expected:** each segment recovered as its own labeled volume (or an API that exposes per-segment sub-stacks), as pydicom/highdicom-based readers do.
**Actual:** a single 3D volume; the additional segment(s) are dropped.
## Context
Raised in the PR #6639 review thread — https://github.com/InsightSoftwareConsortium/ITK/pull/6639#issuecomment-4976646767 — where @issakomi noted they can read all segments correctly via highdicom, while ITK IO outputs just one 3D file. Confirmed by the PR author as a real, separate, larger-scope limitation than the single-bit decode fix in that PR.
## Related
- #6641 — single-bit SEG mis-decode (0–255 bytes vs binary 0/1); different bug, same file family
- #6642 — highdicom cross-validation testbed proposal
- PR #6639 — single-bit contiguous decode + PixelSpacing multiplicity fix
Contributor guide
Research direction
Start with GDCMImageIO and ImageSeriesReader, then reproduce the issue using a multi-segment DICOM SEG with differing z-extents, such as TotalSegmentator output. Done means each segment is recovered as its own labeled volume, or the API exposes the per-segment sub-stacks without dropping segments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100