Imagemagick: Mogrify doesnt export DICOM correctly in Win and Mac

Created on 8 Jan 2019  路  5Comments  路  Source: ImageMagick/ImageMagick

Hey there!

I'm using Mogrify to convert DICOM files to PNG files. It works well in Linux, and allow me import the file inside Blender:

https://www.youtube.com/watch?v=1iAgBCOOft0

The problem is that I have to do it works on Windows and Mac OS X, and in the two OS I had the same problem: Mogrify generates only a gray image, instead the CT-Scan color information.

img0078

The file I'm trying to convert is this: https://drive.google.com/file/d/1QLsvtMXWsrXJYJXAyKAOIGrKWYr63PLI/view?usp=sharing

The DICOM file was created exporting from Slicer 3D (GDCM libs).

Thanks for the attention and a big hug!

All 5 comments

Your image is nearly totally gray according to Imagemagick identify -verbose. EXIFTOOL shows - PhotometricInterpretation : MONOCHROME2. So also grayscale. I can get some detail, but still gray by doing:

convert IMG0078.dcm -auto-level IMG0078.png

img0078

But I have no idea if that is correct.

Hi @fmw42 !

Thanks for answer! This file was exported from this original data file: https://drive.google.com/file/d/1YLNLNoOUC9ZKfS_OzOA6oTrMuaehQhSP/view?usp=sharing

I open it ans the result was this:

img0078

I think the problem is with the file I used like reference, because it was created from Linux. I imported other CT-Scan and Mogrify works well! I imported it in Windows and Mac and exported it from Slicer, like the example I attached here. So, probably the problem is the GDCM library I used originally in Linux.

Thank you very much!

Using your original file, I can reproduce your result on IM 7.0.8.23 Q16 Mac OSX with

`magick IMG0078.dcm -auto-level result.png

tmp
`

So I think your issue is with your other tool. I do not think it is a bug in Imagemagick.

For one image, you are better off using magick and not magick mogrify. Use the latter if you have to process all files in a directory.

Hi @fmw42 !

It work perfectly on Mac! Now I`ll test on Windows.

Thank you very much!

Working perfectly in the three OS!
Thank you @fmw42 !

Was this page helpful?
0 / 5 - 0 ratings