Page 1 of 1

identify.exe and convert.exe crashes on DICOM image

Posted: 2007-11-27T14:00:42-07:00
by erhhung
I have a DICOM X-ray image that I'd like to convert into JPEG with ImageMagick. However, both identify.exe and convert.exe on Windows (version 6.3.6 10/29/07 Q8) crash after a few seconds of processing. I tried converting the .dcm file with the popular freeware ezDICOM, and have no problem, so I believe the file is fine.

Code: Select all

identify.exe -format "%m %w %h %z %r" DICOM.dcm
convert.exe DICOM.dcm -thumbnail 160x120 -colorspace RGB DICOM.jpg
I know there is a more recent release (6.3.7), but I haven't read about any discussion saying that the DICOM reader has been enhanced in any way. Can someone on the development team take a look at this file and tell me what I can do?

The 4.5 MB file I used can be found here:
http://home.comcast.net/~erhhung/temp/DICOM.dcm

Thanks
Erhhung

Re: identify.exe and convert.exe crashes on DICOM image

Posted: 2007-11-27T14:33:57-07:00
by magick
We have a patch for the problem you reported. Your image contains a JPEG image that is most likely lossless because an exception is thrown: Unsupported JPEG process: SOF type 0xc3. Lossless JPEG requires a patch to the JPEG delegate library. The Windows version of ImageMagick does not include this patch.

Re: identify.exe and convert.exe crashes on DICOM image

Posted: 2007-11-27T17:36:21-07:00
by erhhung
Thanks for the diagnosis. Ok, I have read in other forum messages that lossless JPEGs are not supported and a patch to the delegate library must be done. So, is this patch going to make it into the standard/official Windows build for the next release? (it seems that a new release is posted every month or so). I can wait a little while until the fix is officially distributed, but if there's no plan for this, then I guess I'll have to investigate how to apply this patch.

Re: identify.exe and convert.exe crashes on DICOM image

Posted: 2007-11-27T17:43:24-07:00
by magick
We have no plans to apply the JPEG lossless patch to the ImageMagick Windows distribution.

Re: identify.exe and convert.exe crashes on DICOM image

Posted: 2007-11-27T18:52:19-07:00
by erhhung
Just for my curiosity, what is the reasoning behind not including the patch, if it would obviously fix a bug with converting DICOM images (it does seem that many DICOM systems output embedded lossless JPEG images). Is it too much effort for the benefit, it's not a priority among too many to-do's, there's a legal issue including the patch for Windows, etc. Thanks.

Re: identify.exe and convert.exe crashes on DICOM image

Posted: 2007-11-29T17:26:31-07:00
by erhhung
I have tried downloading the IPG's libjpeg-6b source code as well as the ljpeg-6b patch for lossless JPEG support, but I'm having a hard time trying to compile the source files on a Windows VS2005 dev environment as it's all geared towards running configure and make on a Unix machine. I also couldn't get Makefile.vc and jconfig.vc files working in my environment, so I'm wondering if anyone has already done this and can make the patched JPEG delegate DLL available somewhere.

I assume the replacement DLL replaces "CORE_RL_jpeg_.dll"?

Thanks.