DICOM images not rendered correctly.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
sacha

DICOM images not rendered correctly.

Post by sacha »

I have a DICOM image which, in the NIH's ImageJ viewer (http://en.wikipedia.org/wiki/ImageJ), displays as a bright object on a dark background. However, when I use ImageMagick 6.4.1 to convert this to another format, the result is inverted (i.e. dark object on a bright background).

I had the following exchange with the author of ImageJ:
> Hi Wayne,
>
> I heard back from my client, he's happy to release the image.
>
> It's ~10MB compressed with gzip. You can grab it here via anonymous ftp:
>
> ftp://ftp.ssl.co.uk/tmp/Alterpiece%20Panel.dcm.gz
>
> Much appreciated,
>
> Sacha.

Hi Sacha,

This image has an inverting LUT because the 0028,0004 tag (Photometric Interpretation) has a value of MONOCHROME1 (low values=bright, high values=dim).
> Thanks Wayne. I did see some java code that was sniffing the last character of this string to see if it was "1" in order to decide whether to invert it or not, but that seemed improbable.
>
> Just so I fully understand (and because I don't have a tool that I trust to give me the raw pixel data), is what's going on:
>
> a) the pixel data for the background has low values (bright) and the pixel data for the object has high values (dim), but ImageJ, rather than displaying the pixel data as-is, spots the MONOCHROME1 and inverts the LUT for aesthetic reasons? or
>
> b) the pixel data for the background has high values (dim) and the pixel data for the object has low values (bright), and ImageJ is displaying it as-is?

ImageJ is not altering the pixel values. Do a profile plot across the image and you will see that the background has high values.

> I'm trying to work out whether ImageMagick is faulty for rendering this file as a dim object on a bright background.

ImageMagick is not displaying the image correctly.
Is this in fact a fault in ImageMagick?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: DICOM images not rendered correctly.

Post by magick »

We have a patch for the problem you reported in ImageMagick 6.4.1-9 Beta available sometime tomorrow. In the mean-time try this:
  • convert image.dcm -negate image.png
Post Reply