dgobbi / vtk-dicom

A set of classes for using DICOM in VTK.
BSD 3-Clause "New" or "Revised" License
259 stars 94 forks source link

Edge case where dicomdump reports incorrect element VR for series #195

Closed dgobbi closed 4 years ago

dgobbi commented 4 years ago

When dicomdump reads a DICOM series, sometimes an attribute is only present for some files in the series. In the specific case where the attribute is missing for the first image in the series, but present for some other images, dicomdump will report the VR as an empty string.

This can be seen with the "InConcatenationNumber" attribute of the series CT0071 CT0072 CT0073 CT0074_* in the DICOM multiframe data collection, since only CT0074_* have this attribute.

VR mismatch!  != US InConcatenationNumber
(0020,9162)  "InConcatenationNumber" : (multiple values)
  0001 [] (0 bytes) - from CT0071
  0002 [1] (2 bytes) - from CT0074_1
  0003 [2] (2 bytes) - from CT0074_2
  0004 [3] (2 bytes) - from CT0074_3
  0005 [4] (2 bytes) - from CT0074_4
  0006 [5] (2 bytes) - from CT0074_5
  0007 [6] (2 bytes) - from CT0074_6
  0008 [] (0 bytes) - from CT0072
  0009 [] (0 bytes) - from CT0073

Of course this series also has the problem that CT0074_1 through CT0074_6 all have an InstanceNumber of 1. Furthermore, I'm not certain they were meant to be part of the same series as CT0071 CT0072 CT0073. Notwithstanding the irregularity of the data, we still want dicomdump to report the VR correctly.

A related issue is that dicomdump reports missing attributes as empty. It has no syntax to denote that an attribute is missing from an image within a series.

dgobbi commented 4 years ago

Closed, fixed by commit 38149e85.