Page 1 of 1

Magick++ for RLE-encoded DICOM and colored DICOM

Posted: 2010-01-19T10:22:35-07:00
by L F
Hello!

I'm using Magick++ a long time to create thumbnails from DICOM-images and found some bugs in current 6.5.9 version.

1) ImageMagick shows "depth=16" when configuring. But for usual DICOM-files with photometric=RGB reading of red/green/blue quantums returns data with 8 bits per pixel (at least for tested DICOM-files that have [bits allocated]=8 ). Previously used rather old version of Magick++ returned correct result, i.e. data with 16-bits depth independent from DICOM settings. Is it a new behaviour or a bug?

2) Magick++ gives "Segmentation fault (core dumped)" for using method "read" of object Image if the input file is RLE-encoded DICOM with one frame only. For multi-framed RLE-encoded DICOMs Magick++ doesn't fail.

Does a workaround exist for this issue?
Thanks in advance.

Re: Magick++ for RLE-encoded DICOM and colored DICOM

Posted: 2010-01-19T13:04:55-07:00
by magick
1) ImageMagick shows "depth=16" when configuring. But for usual DICOM-files with photometric=RGB reading of red/green/blue quantums returns data with 8 bits per pixel (at least for tested DICOM-files that have [bits allocated]=8 ). Previously used rather old version of Magick++ returned correct result, i.e. data with 16-bits depth independent from DICOM settings. Is it a new behaviour or a bug?
ImageMagick reports the depth of the image its reads. If the DICOM image is 8-bits it is stored internally at 16 but exported at 8. You can always set the depth with image.depth().
2) Magick++ gives "Segmentation fault (core dumped)" for using method "read" of object Image if the input file is RLE-encoded DICOM with one frame only. For multi-framed RLE-encoded DICOMs Magick++ doesn't fail.
RLE support is new. Can you post a URL or send us a PM to an RLE-encoded DICOM with one frame only. We'll get a patch into ImageMagick 6.5.9-1 Beta within a day or two to fix this problem.

Re: Magick++ for RLE-encoded DICOM and colored DICOM

Posted: 2010-01-19T13:52:37-07:00
by L F
Thanks a lot for depth explanation!

About RLE: is there some other way of uploading or maybe I can email an example (size is less than 100K)? There is no public sites in this organization. Also there is one more issue - no colors in Image read from RLE, possibly color map is not read from RLE-DICOM when photometric is "PALETTE COLOR".

Thanks.

Re: Magick++ for RLE-encoded DICOM and colored DICOM

Posted: 2010-01-19T13:55:04-07:00
by magick
See if you can attach an image as a private-message to this account. We do not provide uploading services. There are plenty of free sites on the Net that allow you to post images for later download.

Re: Magick++ for RLE-encoded DICOM and colored DICOM

Posted: 2010-01-27T08:48:21-07:00
by L F
As I can see the sent private message with link to 1-framed image came nowhere. Possibly it will work here?
The link to image is: http://uploading.com/files/dm618d9e/rle_1_frame.dcm/

Re: Magick++ for RLE-encoded DICOM and colored DICOM

Posted: 2010-01-27T13:28:21-07:00
by magick
ImageMagick 6.5.9-0, the current release, reads your DICOM image but seems to produce incorrect results. We're investigating the problem now.

Re: Magick++ for RLE-encoded DICOM and colored DICOM

Posted: 2010-01-28T09:27:06-07:00
by L F
It's interesting. I've checked again, on Fedora 12 (both 32 and 64-bits) IM 6.5.9-0 gives for code:

#include <Magick++.h>
Image fileIn;
string file_name="........";
cout<<"start"<<endl;
fileIn.read(file_name);
cout<<"read"<<endl;
fileIn.modifyImage();
cout<<"modify"<<endl;

result:
start
Segmentation fault (core dumped)

Maybe "Image" should be somehow initialized to read RLE ?
By the way, if you meant incorrect result for gray bars in the top of the image, it's ok (just some private info was wiped). But colors are really lost for any (1- or multi-framed) RLE if they have photometric not RGB but for example PALETTE COLOR.

Thanks.