Skip to content

Parser don't close correctly an undefined length sequence #181

@ianholing

Description

@ianholing

Sequence with undefined length, with one Item with defined length inside, tries to find an item delimitation item (fffe,e00d) to close the sequence, when it is not necessary according to NEMA. (http://dicom.nema.org/dicom/2013/output/chtml/part05/sect_7.5.html - Table 7.5-2)

...
(0023,1074) SL 0 # 4, 1 NumberOfUpdatesToHeader
(0023,107d) SS 0 # 2, 1 IndicatesIfStudyHasCompleteInfo
(0023,1080) SQ (Sequence with undefined length #=1) # u/l, 1 Unknown Tag & Data
(fffe,e000) na (Item with explicit length #=4) # 40, 1 Item
(0040,0000) UL 28 # 4, 1 GenericGroupLength
(0040,0255) LO (no value available) # 0, 0 PerformedProcedureTypeDescri
ption
(0040,2016) LO [^] # 2, 1 PlacerOrderNumberImagingServ
iceRequest
(0040,2017) LO [^] # 2, 1 FillerOrderNumberImagingServ
iceRequest
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
(0025,0010) LO [CREATOR_0001] # 12, 1 PrivateCreator
(0025,1006) SS 19 # 2, 1 LastPulseSequenceUsed
(0025,1007) SL 29 # 4, 1 ImagesInSeries
(0025,1010) SL 0 # 4, 1 LandmarkCounter
(0025,1011) SS 29 # 2, 1 NumberOfAcquisitions
...
(0040,0244) DA [20200302] # 8, 1 PerformedProcedureStepStartDate
(0040,0245) TM [165045] # 6, 1 PerformedProcedureStepStartTime
(0040,0253) SH [8321.1234567895] # 16, 1 PerformedProcedureStepID
(0040,0254) LO [RM HAND LEFTA] # 14, 1 PerformedProcedureStepDescriptio
n
(0040,0275) SQ (Sequence with undefined length #=1) # u/l, 1 RequestAttributesSequence
(fffe,e000) na (Item with undefined length #=3) # u/l, 1 Item
(0040,0007) LO [RM HAND] # 8, 1 ScheduledProcedureStepDescri
ption
(0040,0009) SH [87654321] # 8, 1 ScheduledProcedureStepID
(0040,1001) SH [MR] # 2, 1 RequestedProcedureID
(fffe,e00d) na (ItemDelimitationItem) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
(0043,0010) LO [CREATOR_0001] # 12, 1 PrivateCreator
(0043,1001) SS 4 # 2, 1 BitmapOfPrescanOptions
(0043,1002) SS 17 # 2, 1 GradientOffsetInX
(0043,1003) SS -33 # 2, 1 GradientOffsetInY
...

The parser don't stop at TAG (0023,1080) it just follow adding data to the sequence until other item delimitation item appears (fffe,e00d) as you can see in the screenshot:

image

The result is that all TAGs between the first sequence (0023,1080) and the second sequence (0040,0275) weren't parsed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions