pydicom_PIL.py cant handle DICOM files that have multiple window width and center setting

Created on 15 Mar 2017  路  3Comments  路  Source: pydicom/pydicom

Some DICOM file may have multiple window width and center setting, like ["400","40"] ["400","400"]. And this will cause pydicom_PIL.get_PIL_image to throw "MultiValued cant minus Float" exception

Difficulty-Medium bug needs contributor

All 3 comments

I've added the issue to the legacy_code repo for when the contrib gets removed

Got it to work by placing this in theget_LUT_value method:

if type(window) is MultiValue: 
       window = window[0] 
if type(level) is MultiValue: 
       level = level[0]

Make sure to also put from dicom.multival import MultiValue at the top of the file.

contrib folder moved to its own repo, issue created there instead.

@liamnaks, do you mind copying your comment over too?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tboutelier picture tboutelier  路  12Comments

DavidBord picture DavidBord  路  14Comments

Alex97schmid-zeiss picture Alex97schmid-zeiss  路  3Comments

astrofrog picture astrofrog  路  14Comments

vsoch picture vsoch  路  13Comments