Magick++ for RLE-encoded DICOM and colored DICOM

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
L F

Magick++ for RLE-encoded DICOM and colored DICOM

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
L F

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

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
L F

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

Post 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/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
L F

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

Post 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.
Post Reply