dcm2jpg and wado jpeg problem - white background

130 views
Skip to first unread message

Thiago Henrique Busarello

unread,
Jul 19, 2019, 2:33:26 PM7/19/19
to dcm4che
When i export the study, some imagens has a white background. In DICOM format, she stay as a normal background (black).

In weasis, imported as a DICOM...

Weasis-normal-background.png


When exported using dcm2jpg tool...

ExportedJPEG-WhiteBackground.jpeg


The same happens when call WADO uri for image/jpeg type...

Wado-white-background.png

However, in the Weasis JPEG exporter, its works...


Weasis-JPEG-Exported.jpeg


DCM4CHEE ARC and TOOLS version 5.17.1

Weasis version 3.5.2

Images https://drive.google.com/file/d/15Q4kU4G-3g2hTycP6-gdPY4phhLJ4J9A/view?usp=sharing


Can someone help me?


Nicolas Roduit

unread,
Jul 21, 2019, 4:57:10 PM7/21/19
to dcm4che
The rendering is different in Weasis and dcm4chee. Fill a bug in dcm4che that seems to have a problem with the Monochrome1 type.

gunterze

unread,
Aug 4, 2019, 3:20:57 PM8/4/19
to dcm4che
It's caused by the fact, that the decompressed pixel values have values > 1023, which conflicts with

1286: (0028,0101) US #2 [10] BitsStored
1296: (0028,0102) US #2 [9] HighBit

dcm2jpg and wado jpeg apply a bitmask according the value of Bits Stored, which results in the white background. You get the same result with DCMTK's dcmj2pnm.
I am thinking about to implement an auto-correction of the value of Bits Stored on decompression of lossy compressed images.

gunterze

unread,
Aug 4, 2019, 3:39:11 PM8/4/19
to dcm4che
According DICOM PS3.5: Valid Values of Pixel Data Related Attributes for JPEG Lossy Transfer Syntaxes using Standard Photometric Interpretations, Bits Stored must be either 8 or 12 - and can't be 10 - for JPEG Extended Transfer Syntax. So I will just set

BitsStored = 12
HighBit = 11

on decompression of JPEG Extended compressed images with BitsStored > 8.
Reply all
Reply to author
Forward
0 new messages