Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1662 closed defect (fixed)

DICOM key error bitsAllocated

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Volume Data Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Narrowed down the problem with the head/neck study. Within the attached folder (zip), the subdirectories with "RT Plan"in their names cause the problems. The "RT Dose" and other subdirs seem to be read OK.

from Log:

open 02-20*4 format dicom
Summary of feedback from opening 02-20-2000-522-26564
notes Missing PixelSpacing, using value 1, /Users/meng/Desktop/02-20-2000-522-26564/4-RT Dose - fx1hetero-4.5.1/000000.dcm
Missing PixelSpacing, using value 1, /Users/meng/Desktop/02-20-2000-522-26564/6-RT Dose - fx2hetero-4.5.2/000000.dcm
Missing PixelSpacing, using value 1, /Users/meng/Desktop/02-20-2000-522-26564/8-RT Dose - totalhetero-4.5.3/000000.dcm
Traceback (most recent call last):

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/cmd_line/tool.py", line 252, in execute

cmd.run(cmd_text)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2615, in run

result = ci.function(session, kw_args)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/open.py", line 41, in open

from_database=from_database, ignore_cache=ignore_cache, kw))

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/open.py", line 117, in open

models = handle_unknown_kw(session.models.open, paths, format=format, name=name, kw)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/open.py", line 62, in handle_unknown_kw

return f(*args, kw)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/models.py", line 598, in open

session, filenames, format=format, name=name, kw)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/io.py", line 456, in open_multiple_data

models, status = open_func(session, paths, mname, kw)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/map/volume.py", line 3450, in open_map_format

return open_map(session, stream, name=name, format=format, kw)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/map/volume.py", line 3066, in open_map

verbose = kw.get('verbose'))

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/map/data/fileformats.py", line 141, in open_file

data = module.open(apath, kw)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/map/data/dicom/init.py", line 20, in open

return dicom_grids(paths, log = log, verbose = verbose)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/map/data/dicom/dicom_grid.py", line 24, in dicom_grids

d = DicomData(s)

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/map/data/dicom/dicom_format.py", line 354, in init

self.value_type = numpy_value_type(attrsBitsAllocated, attrsPixelRepresentation,

KeyError: 'BitsAllocated'

KeyError: 'BitsAllocated'

File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/map/data/dicom/dicom_format.py", line 354, in init
self.value_type = numpy_value_type(attrsBitsAllocated, attrsPixelRepresentation,

See log for complete Python traceback.

Attachments (1)

02-20-2000-522-26564.zip (32.5 MB ) - added by Elaine Meng 7 years ago.

Change History (9)

by Elaine Meng, 7 years ago

Attachment: 02-20-2000-522-26564.zip added

in reply to:  2 comment:1 by Elaine Meng, 7 years ago

Forgot to mention that perhaps RT Dose and RT Plan imagesets should also (like segmentations) be associated with a scan imageset, since presumably they were developed based on the patient's scan (RT = radiotherapy) and would often be painted onto its slices or superimposed in 3D.  Just another thing to think about...

in reply to:  3 ; comment:2 by Elaine Meng, 7 years ago

From messing around in Slicer, apparently the RT Dose depends on or is associated with the RT Plan somehow.  When I tried to load just the dose data, it asked to open the corresponding plan.  Also when I tried to load just the RTSTRUCT it asked to open the corresponding CT data.  (apparently RTSTRUCT is another type of overlay on the scan, like SEG).  Sigh, there is a lot to learn about DICOM, even just the major topics like these modality types.

comment:3 by Tom Goddard, 7 years ago

This data set has 8 subdirectories as listed below. The RTStruct data is of DICOM type RT Structure Set Storage and contains non-image contour data delimiting regions of interest. The RT Plan directories contains non-image data about beam treatment parameters. The RT Dose directories contain image data indicating how much radiation dose is supposed to be delivered to each voxel.

1-CTs from rtog conversion-564.2
2-RTStruct from rtog conversion-564.3
3-RT Plan excerpt - fx1hetero-4.4.1
4-RT Dose - fx1hetero-4.5.1
5-RT Plan excerpt - fx2hetero-4.4.2
6-RT Dose - fx2hetero-4.5.2
7-RT Plan excerpt - totalhetero-4.4.3
8-RT Dose - totalhetero-4.5.3

in reply to:  5 comment:4 by Elaine Meng, 7 years ago

Although both Slicer and Horos import the folder attached to this ticket without error messages into their DICOM databases, there is a separate step to “load” into the viewer in Slicer, so that’s when I find out about the dependencies.  Also, while Slicer displays these data right away as colored-blob overlays when the files they depend on are also loaded, Horos does not.  Horos just shows black and white stripes for everything but the CT image stack (RTPLAN, RTSTRUCT, RTDOSE).  There may well be a way to show them in Horos too, but I haven’t figured it out.

comment:5 by Tom Goddard, 7 years ago

I don't think we are going to try to draw schematics of beam treatments in ChimeraX right now, so we can't handle RT Plan. It would be cool to show the contour data (tracing the brain stem in this data set), but would require a good bit of new code which would generate a surface type model rather than a volume. The DICOM reader is opening the RT Dose data since it is image data, but it currently is not properly aligned or associated with the CT scan. Getting proper alignment and association (as a separate channel) will take some work.

in reply to:  7 comment:6 by Elaine Meng, 7 years ago

Understood.  Would be nicer if it could just give a message and skip over them instead of failing to load all the dicoms in the directory tree, but I don’t know how much work it would be to get that behavior.

comment:7 by Tom Goddard, 7 years ago

Resolution: fixed
Status: assignedclosed

I made the DICOM reader warn about and ignore these dicom files it does not handle (RT Plan, RT Structure Set Storage".

Also the RT Dose files were not properly aligned with the CT so I fixed that. Now all the DICOMS use the patient coordinate system so alignment should be better in general between related dicom series.

I'm taking a look out of curiosity at the RT Structure Set Storage which defines 18 regions of interest (brainstem, larynx, ...) using contours drawn on 2d planes in different colors. This is a type of segmentation data and may be of wide interest.

(3006, 0020) Structure Set ROI Sequence 18 item(s) ----
(3006, 0022) ROI Number IS: "1"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'Brainstem'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "2"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'Brainstem exp'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "3"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'CTV'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "4"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'CTV56'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "5"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'CTV63'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "6"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'GTV'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "7"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'LARYNX'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "8"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'Mandible'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "9"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'oral tongue'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "10"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'PAROTID_LT'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "11"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'PAROTID_RT'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "12"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'PTV56'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "13"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'PTV63'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "14"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'PTV70'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "15"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'rind'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "16"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'SKIN'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "17"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'SPINAL_CORD'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'


(3006, 0022) ROI Number IS: "18"
(3006, 0024) Referenced Frame of Reference UID UI: 1.3.6.1.4.1.22213.2.26564.1
(3006, 0026) ROI Name LO: 'SPINL_CRD_PRV'
(3006, 0036) ROI Generation Algorithm CS: 'MANUAL'

in reply to:  9 comment:8 by Elaine Meng, 7 years ago

Yes, at least from looking at Slicer plugins and tutorials, it seems that RTSTRUCT and SEG are two ways of storing segmentation information.
Note: See TracTickets for help on using tickets.