Repository navigation
BUG: Read private series restriction tags from the file, not the scanner - #7152
Open
hjmjohnson wants to merge 1 commit into
Open
hjmjohnson wants to merge 1 commit into
hjmjohnson wants to merge 1 commit into
Conversation
Member
Author
|
/azp run ITK.Linux.Python |
hjmjohnson
force-pushed
the
gdcm-series-restriction-private-tags
branch
3 times, most recently
from
November 11, 2026 14:33
3128bbd to
1be751b
Compare
Member
Author
|
/azp run ITK.Linux.Python |
2 similar comments
Member
Author
|
/azp run ITK.Linux.Python |
Member
Author
|
/azp run ITK.Linux.Python |
hjmjohnson
marked this pull request as ready for review
November 11, 2026 22:46
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found.
|
This was referenced Nov 16, 2026
GDCMSeriesFileNames::AddSeriesRestriction() with a private tag, such as the vendor diffusion b-value tags (0019|100c, 0043|1039) that DWI tools use to split sub-volumes, made GetSeriesUIDs() throw: An invalid logic behavior occurred: Tags.find( t ) != Tags.end() gdcm::Scanner::AddTag() discards any tag without a dictionary VR, which includes every private tag, and Scanner::GetValue() then asserts on it. ITK 5.4 read these values with gdcm::StringFilter on each file. Add only dictionary tags to the scanner. Read the rest from each file, with their private creators so implicit VR files resolve, through Reader::ReadSelectedTags() and StringFilter. The GDCM headers this needs warn on gdcm::PrivateTag's implicit copy constructor, so suppress that one warning around the GDCM includes.
hjmjohnson
force-pushed
the
gdcm-series-restriction-private-tags
branch
from
November 18, 2026 12:18
1be751b to
ee90899
Compare
Member
Author
|
Force-push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GDCMSeriesFileNames::AddSeriesRestriction()with a private tag madeGetSeriesUIDs()throw a GDCM assertion (Tags.find( t ) != Tags.end()) after thegdcm::Scannerrewrite in #6469. Private tags are now read from each file, with their private creators, throughgdcm::StringFilter, asgdcm::SerieHelperdid in ITK 5.4, so they refine series again in explicit and implicit VR files.Root cause
gdcm::Scanner::AddTag()discards any tag whose dictionary VR isINVALID, which includes every private tag, with only a GDCM warning.BuildSeriesMap()then callsScanner::GetValue()for that tag, which asserts. In ITK 5.4,gdcm::SerieHelper::CreateUniqueSeriesIdentifier()read every restriction tag withgdcm::StringFilter::ToString()on the fully read file, so private tags worked.Found through
dcm_classifier, which restricts on vendor diffusion tags (GE0043|1039, Siemens0019|100c, Philips2001|1003, and others) to split DWI sub-volumes. On ITKmain, every call to its study classifier throws.Change and tests
Tags with a dictionary VR still go through the scanner. The others are read per file with
Reader::ReadSelectedTags()andStringFilter, only when such a tag was requested.For a private tag, its private creator
(gggg,00xx)is read too. Without it,StringFiltercannot find the element's VR in an implicit VR file and returns an empty string, so the restriction would silently stop splitting the series.Identifiers are built in the same tag order as before.
Including
gdcmStringFilter.h/gdcmDicts.hcompilesgdcm::PrivateDict::AddDictEntry, which copiesgdcm::PrivateTag(user-provided copy assignment, implicit copy constructor) and warns under clang-Wdeprecated-copy-with-user-provided-copyand GCC-Wdeprecated-copy. That one warning is suppressed around this file's GDCM includes.itkGDCMImageIO.cxxavoids it only becauseitkImageIOBase.his included first; upstream GDCM still lacks the copy constructor. The clang branch was verified locally; CI is the first executor of the GCC branch.New tests vary the GE b-value
(0043,1039)that theDicomSeriesfixture carries under its(0043,0010)creator, alternating two values across the slices:SeriesRestrictionOnPrivateTagsRefinesSeries(explicit VR little endian copies)SeriesRestrictionOnPrivateTagsInImplicitVRFiles(implicit VR little endian copies)Each expects two series covering every file, and checks that a private tag absent from every file
(2001,1003)leaves the grouping unchanged. Both throw onmain; the implicit VR test finds one series instead of two if the creator is not read. All 39ITKGDCMImageIOGTestDrivertests pass locally at this head (macOS arm64, AppleClang), with no compiler warnings in the touched files.