ENH: Reimplement GDCMSeriesFileNames on gdcm::IPPSorter/Scanner (drop deprecated SerieHelper)#6469
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
19dc745 to
0e85890
Compare
|
@malaterre I have been looking at removing the "SerieHelper" dependency that is only kept around for ITK (according to the GDCM comments for SerieHelper). Your insights into the implications of the proposed change would be helpful. |
…twareConsortium#6467) Pin the observable contract of itk::GDCMSeriesFileNames before migrating its backend off the deprecated gdcm::SerieHelper onto gdcm::Scanner + gdcm::IPPSorter: single-series enumeration / grouping, geometric ordering that reconstructs a valid uniformly-spaced volume, GetInputFileNames returning the first series, and the Recursive flag controlling descent (which must be set before SetInputDirectory triggers the scan). These tests are backend-agnostic and must remain green across the swap.
Replace the deprecated gdcm::SerieHelper backend ("DO NOT USE ... temporary
solution for ITK migration from GDCM 1.x to 2.x") with the supported modern
API: gdcm::Directory for enumeration, gdcm::Scanner for series grouping, and
gdcm::IPPSorter for geometric (ImagePositionPatient on the slice normal)
ordering.
Behavior preserved on the in-tree suite (all 89 ITKIOGDCM tests pass,
including the series-reader and direction-cosine tests) and pinned by the
GDCMSeriesFileNames characterization tests added in the previous commit:
single-series enumeration / grouping, geometric ordering, GetInputFileNames
returning the first series, Recursive descent.
Intentional behavior changes:
- IPPSorter is strict: duplicate-IPP and gantry-tilt acquisitions FAIL to
sort; the input order is then left unchanged rather than fabricated.
Whether these need first-class support (and whether SerieHelper's permissive
strategy was correct) is tracked for discussion in InsightSoftwareConsortium#6468.
- AddSeriesRestriction now refines the series identifier (the documented and
example intent, e.g. "0008|0021"), instead of delegating to SerieHelper's
largely-inert file restriction list.
Part of InsightSoftwareConsortium#6467.
0e85890 to
50dfb13
Compare
|
@greptileai re: the P2 "LoadSequences/LoadPrivateTags are silently dead" (outside-diff comment) — addressed in |
|
Thanks for the pointer to
Documenting them as intentional no-ops rather than either silently dropping behavior or fabricating emulation is the right call. The |
Reimplement
itk::GDCMSeriesFileNameson the supported modern GDCM API (gdcm::Directory+gdcm::Scanner+gdcm::IPPSorter), dropping the deprecatedgdcm::SerieHelper. Part of #6467.Why
gdcm::SerieHelperis documented by GDCM as deprecated backward-compat code — "DO NOT USE this class, it is only a temporary solution for ITK migration from GDCM 1.x to GDCM 2.x … Instead see ImageHelper or IPPSorter." This PR movesGDCMSeriesFileNamesto the supported API.What changed
gdcm::Directory(enumerate, honoring Recursive) →gdcm::Scanner(group by SeriesInstanceUID + detail tags; the series identifier replicatesSerieHelper::CreateUniqueSeriesIdentifier) →gdcm::IPPSorter(geometric ImagePositionPatient-on-normal ordering). Lazy parse with aTimeStampcache, so repeatedGetSeriesUIDs/GetFileNames/GetInputFileNamescalls no longer re-scan.GetInputFileNamesreturns the first series, Recursive descent. Green on both backends.Intentional behavior changes
AddSeriesRestrictionnow refines the series identifier (the documented and example intent, e.g."0008|0021"), instead of delegating to SerieHelper's largely-inert file-restriction list.Testing
All 89 ITKIOGDCM tests pass locally (series-reader, direction-cosine, compliance suites).
pre-commit run --all-filesclean. The vendoredgdcm::SerieHelperis untouched (still used by GDCM's own code); a follow-up may remove it once upstream GDCM drops it.