Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1612 closed defect (fixed)

DICOM unsupported value type

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

Description

The following bug report has been submitted:
Platform:        Darwin-17.7.0-x86_64-i386-64bit
ChimeraX Version: 0.9 (2019-01-15)
Description
trying to open DICOM directory, different example and error than before
zip file of directory attached

Log:
> open /Users/meng/Desktop/startup.cxc

> alias nucrib car style nucleic x oval width 1.6 thick 1.6

> alias cylinders car style protein modeh tube rad 2 sides 24

> alias licorice car style protein modeh default arrows f x oval width 1 thick
1

> alias rib1 car style modeh def arrows t wid 2 thick 0.4; car style
(nucleic|strand) x rect

> alias reset view orient; view initial

> open presets.cxc

> camera ortho

> alias lungs vol all style solid; vol lev -902,0.6 lev -305,0.6 col #FF8080
col #FF8080

> alias airways2 vol all style solid btcorr t dimtransparent f; vol all lev
-742,0.0 lev -683,0.049 lev -481,0.25 lev -333,0.0 col 0,61,71 col 0,61,71 col
0,61,71 col 0,61,71

> alias aw2alpha vol all style solid btcorr t dimtransparent f; vol all lev
-742,0.0 lev -683,0.049 lev -481,0.25 lev -333,0.0 col 0,61,71,0 col
0,61,71,0.2 col 0,61,71,6.2 col 0,61,71,0

executed presets.cxc  
executed startup.cxc  
UCSF ChimeraX version: 0.9 (2019-01-15)  
How to cite UCSF ChimeraX  

> open /Users/meng/Desktop/11-06-2014-1-96508 format dicom

Traceback (most recent call last):  
File
"/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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.6/lib/python3.6/site-
packages/chimerax/core/commands/cli.py", line 2612, in run  
result = ci.function(session, **kw_args)  
File
"/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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.6/lib/python3.6/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.6/lib/python3.6/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.6/lib/python3.6/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.6/lib/python3.6/site-
packages/chimerax/core/io.py", line 457, 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.6/lib/python3.6/site-
packages/chimerax/map/volume.py", line 3411, 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.6/lib/python3.6/site-
packages/chimerax/map/volume.py", line 3042, in open_map  
verbose = kw.get('verbose'))  
File
"/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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.6/lib/python3.6/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.6/lib/python3.6/site-
packages/chimerax/map/data/dicom/dicom_grid.py", line 29, in dicom_grids  
d = DicomData(s)  
File
"/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/map/data/dicom/dicom_format.py", line 158, in __init__  
self.rescale_slope, self.rescale_intercept)  
File
"/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/map/data/dicom/dicom_format.py", line 239, in
numpy_value_type  
raise ValueError('Unsupported value type, bits_allocated = ', bits_allocated)  
ValueError: ('Unsupported value type, bits_allocated = ', 1)  
  
ValueError: ('Unsupported value type, bits_allocated = ', 1)  
  
File
"/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/map/data/dicom/dicom_format.py", line 239, in
numpy_value_type  
raise ValueError('Unsupported value type, bits_allocated = ', bits_allocated)  
  
See log for complete Python traceback.  
  




OpenGL version: 4.1 INTEL-10.36.22
OpenGL renderer: Intel Iris Pro OpenGL Engine
OpenGL vendor: Intel Inc.
File attachment: 11-06-2014-1-96508.zip

11-06-2014-1-96508.zip

Attachments (1)

11-06-2014-1-96508.zip (127.8 MB ) - added by Elaine Meng 7 years ago.
Added by email2trac

Change History (11)

by Elaine Meng, 7 years ago

Attachment: 11-06-2014-1-96508.zip added

Added by email2trac

comment:1 by Elaine Meng, 7 years ago

Component: UnassignedVolume Data
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionDICOM unsupported value type

comment:2 by Tom Goddard, 7 years ago

This DICOM has 1-bit data (just 0 and 1 values), possibly a mask. DICOM reader does not currently handle that.

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

Sorry, I’m not trying to find examples that don’t work, it just happens that every directory branch I try happens to have something objectionable in it!  

In this case, two of the subdirectories have lung scan DICOM stacks that ChimeraX can read, but the remaining subdirectories with “segmentation results” each contain a single DICOM file that has this unsupported value type.  This was part of study on the reproducibility of tumor-finding and measurement by different radiologists.  I guess the “segmentations” are the markups by the individual researchers.

comment:4 by Tom Goddard, 7 years ago

I can make segmentation masks open pretty easily. But right now I am seeing if I can get time series to open since I believe Dmitry mentioned heart MRI time series.

comment:5 by Tom Goddard, 7 years ago

Resolution: fixed
Status: assignedclosed

Ok, can read this segmentation DICOM file now. This took more work than expected because the 3D grid is in a single *.dcm file, a case that I had never seen before. Required learning a whole new facet of DICOM files, more than one 2D image can be in a file and the different images are called "frames". It is more and more apparent that the DICOM format is very complex and has many different ways of representing data, most of which ChimeraX cannot currently handle and will give an error.

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

Very interesting, now that I can actually explore the data.  The zipped folder contains 11 subdirectories/datasets, 2 repeat scans and 9 segmentations.  I used these commands (will also attach as cxc file in case you want to amuse yourself with this) to open the folder, set up display etc.:

open ~/Desktop/11* format dicom
name scans #1.3#1.10
name segs #1.1-2#1.4-9#1.11
vol scans show style solid region all step 1
vol scans app "Airways II" step 1 bright .2
vol segs show style surf region all level 1 step 1 trans .5
color #1.1 red
color #1.2 orange
color #1.4 gold
color #1.5 yellow
color #1.5 lime
color #1.6 green
color #1.7 cyan
color #1.8 dodger blue
color #1.9 blue
color #1.11 purple
view

Then it became evident that the repeat scans are not aligned, and that the segmentations all appear to be aligned with scan #1.3, not scan #1.10. (This zip folder is the data for just for one patient in the reproducibility study summarized here https://wiki.cancerimagingarchive.net/display/Public/RIDER+Lung+CT )

It may be a bug that the Model Panel has the scan models as selected no matter what.  However, I thought it was nice that if I select individual segmentation models using those checkboxes in the Model Panel, it is clearly highlighted in the  clump of all segmentations with a green outline.  To evaluate which scan was aligned with the segmentations, I could collectively hide/show all the segmentations with the name I defined: volume segs hide, volume segs show.

Resulting wishlist:
(1) Since the histograms are so useless for these segmentation models, depending on how frequent a DICOM use case they are, might be good to allow hiding or collapsing some of the histograms in Volume Viewer without closing or hiding their data.
(2) I wanted to rainbow the models in a single command, but rainbow only handles atomic models currently.


comment:7 by Elaine Meng, 7 years ago

Oh, looks like I can't attach a file without reopening the ticket, so never mind that. The previous comment shows all the commands anyway.

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

This particular example of segmentations may not be the most common way that segmentations are written in DICOM.  As far as I can tell, these particular files are ignored by Horos, and while 3D Slicer does recognize them as Modality: SEG upon import to Slicer’s internal DICOM database, subsequently attempting to load them into the Slicer viewer gives error messages "could not be loaded as a Scalar Volume.”

3D Slicer is apparently one of the major programs used to create and work with segmentations, and has various segmentation-associated menus and modules.  I will try to learn how to create a segmentation object in 3D Slicer and save it as DICOM (or otherwise find some DICOM segmentation examples that Slicer will read).

in reply to:  10 ; comment:9 by goddard@…, 7 years ago

Yeah, hard to know how much DICOM frames (multiple planes in one file) gets used and whether it is common for segmentations.  I thought the meta-data of this file said it was written by 3D Slicer.  At our next medical imaging meeting we might want to ask for segmentation and time series DICOM data so we can make sure we handle they files they are interested in.

in reply to:  11 ; comment:10 by Elaine Meng, 7 years ago

Update:  
(1) I had installed a handful of extensions using the Slicer extension manager.  These were recommended in a dialog when I imported the SEG DICOM files.  However I hadn’t quit and restarted before my previous loading attempt.  Now after I quit and restarted Slicer, the segmentations can be loaded!  I can see them (or at least one of them, hard to tell) in the image together with the CT scan data.

(2) I also created my own segmentation in Slicer but at least in the 4.10 release, but the only choice for saving the segmentation to file was NRRD format, and for exporting it to file was STL or OBJ.  I tried saving as NRRD and then reading back in, which works.

(3) although superimposed, I am not sure that the segmentations are in correct register with the scan data, i.e. they may be offset.  This example folder contained two scans and I don’t know which one Slicer is showing, or how to control it.


Note: See TracTickets for help on using tickets.