Skip to content

ENH: Order DCMTKSeriesFileNames using first valid slice orientation - #6464

Merged
dzenanz merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:dcmtk-series-geometric-ordering
Jun 18, 2026
Merged

dzenanz merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:dcmtk-series-geometric-ordering

Conversation

@hjmjohnson

@hjmjohnson hjmjohnson commented Jun 17, 2026 •

Copy link
Copy Markdown
Member

Robustness follow-up to the DCMTKSeriesFileNames geometric ordering: derive the slice normal from the first slice that actually carries an ImageOrientationPatient, not just the first globbed file.

Rebased onto current main. The core ordering fix originally in this PR (f2c3bc0) already merged via #6456, so this PR is now reduced to the two greptile P2 refinements that were not in that merge.

What remains in this PR

Net diff vs main: 2 files, +14/−3. The ordering GTest passes; pre-commit run --all-files is clean.

@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots 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 17, 2026
@hjmjohnson
hjmjohnson marked this pull request as ready for review June 17, 2026 20:48
@greptile-apps

This comment was marked as resolved.

@hjmjohnson

Copy link
Copy Markdown
Member Author

@dzenanz @thewtex This PR needs to be reviewed, and finalized before the next two DCMTK PR's can pass. The DCMTK series handling needed to be made more like GDCM to ensure tests were consistent across both GDCM and DCMTK. Derivatives of the test infrastructure are part of completing a long outstanding #2735 bad behaviors.

The geometric slice ordering (added via PR InsightSoftwareConsortium#6456 for issue InsightSoftwareConsortium#6463) derived
the slice normal from headers.front() alone. If the first file returned by
the directory glob lacks ImageOrientationPatient (e.g. a localizer or a
corrupt slice that sorted first), geometric ordering was silently suppressed
for the entire series. Scan for the first slice carrying a valid orientation
instead.

Also correct the regression-test comment to cite issue InsightSoftwareConsortium#6463 rather than the
downstream PR InsightSoftwareConsortium#6456.

Addresses the greptile review on PR InsightSoftwareConsortium#6464.
@hjmjohnson
hjmjohnson force-pushed the dcmtk-series-geometric-ordering branch from 76f7eff to 9169745 Compare June 18, 2026 00:35
@github-actions github-actions Bot removed the type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots label Jun 18, 2026
@hjmjohnson hjmjohnson changed the title BUG: Order DCMTKSeriesFileNames slices geometrically like GDCM ENH: Order DCMTKSeriesFileNames using first valid slice orientation Jun 18, 2026
@hjmjohnson

Copy link
Copy Markdown
Member Author

Sorry, I tried to split a branch with several commits into two PRs, then they diverged a bit.

@hjmjohnson

Copy link
Copy Markdown
Member Author

Status update — rebased onto current main, scope reduced.

The core ordering fix originally in this PR (f2c3bc0) already merged via #6456, which was stacked on this branch. After rebasing onto main, that commit dropped out as already-merged, so this PR now contains only the two greptile P2 refinements that did not ride along in #6456.

What this PR now is (net +14/−3, 2 files)

Was CONFLICTING; now MERGEABLE (91697457c70). pre-commit run --all-files clean; the ordering GTest passes locally. CI is re-running on the new HEAD.

@dzenanz
dzenanz merged commit f71b113 into InsightSoftwareConsortium:main Jun 18, 2026
21 checks passed
@hjmjohnson
hjmjohnson deleted the dcmtk-series-geometric-ordering branch August 22, 2026 15:15
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:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances 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.

2 participants