bug in DiMono1Image::createScale ?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
jcarnulfo
Posts: 3
Joined: Wed, 2005-04-06, 14:38
Location: France

bug in DiMono1Image::createScale ?

#1 Post by jcarnulfo »

i try to create a clipped version of a DICOM image, the clip starting and ending outside the image, but with a vali intersection. For example the image is a tall rectangle of 512x1812, and my clip is a wide rectangle of 1812x512 is the middle.

I use the DcmImage::createClippedImage method, but it returns an image with all pixels set to 0.

I traced into the code and found out that in DiMono1Image::createScale, the left and top positions of my clip is casted to Uint16:

DiImage *image = new DiMono1Image(this, OFstatic_cast(Uint16, left_pos), OFstatic_cast(Uint16, top_pos), ...);

which will trigger a condition inside scaleData (in discalet.h) to call fillPixel.

If i fix the cast to Sint16 in DiMono1Image::createScale, then it works fine. scaleData will call clipBorderPixel and I get my clipped image with borders.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Thank you for the bug report and suggested fix. I will add a patch to the current development version.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest