How visualize dicom images?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

How visualize dicom images?

#1 Post by nobnet »

I'm trying to show dicom images in a FOX widget. I don't get it. I already converted for pgm but the method getOutputData generate strange values.help!

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 »

In order to help we would need more details on your problem. What do you mean by "strange values"?

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

How to visualize dicom images?

#3 Post by nobnet »

I use the function getoutputdata to generate my image, I had to convert to format pgm, but when I show the image, it is cloudy and its pixel have strange values, therefore, that pixels aren't the same of original image.
what do I do?

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

#4 Post by Jörg Riesmeier »

Of course, you do not get "original" pixel data using getOutputData(). This method applies the complete grayscale transformation pipeline to images. The main purpose of the class DicomImage is visualization. See also FAQ #24.

If you still think that there's a bug in DCMTK, please send your test image by email to dicom/at/offis/dot/de and describe what you did (e.g. which command line options of "dcm2pnm" you've used).

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

How to visualize dicom images?

#5 Post by nobnet »

I only repeated your example below and the image was cloudy. I don't know what I do!:

typedef unsigned char Uchar;
DicomImage *image = new DicomImage(file.text());
DcmItem *m;
const int width = (int)(image->getWidth());
const int height = (int)(image->getHeight());
char header[32];
// create PGM header
sprintf(header, "P5\n%i %i\n255\n", width, height);
const int offset = strlen(header);
const unsigned int length = width * height + offset;
// create output buffer for DicomImage class
//typedef unsigned long int Uint;
Uint8 *buffer = new Uint8[length];

//copy PGM header to buffer
OFBitmanipTemplate<Uint8>::copyMem((const Uint8 *)header, buffer, offset);
//if(EC_Normal==(m->findAndGetUint16Array(DCM_PixelData,buffer,( unsigned long*)length )));
//cout<<"merda";

image->getOutputData((void *)(buffer+offset ),length, 8);
img=new FXPPMImage(getApp(),(const unsigned char*)buffer,IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP);

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

#6 Post by Jörg Riesmeier »

I don't know what you mean by "cloudy". Nevertheless, did you already try to specify an appropriate VOI window, e.g. by using setMinMaxWindow(), before calling getOutputData()?

If this does not work I can only repeat what I already wrote: "please send your test image by email to dicom/at/offis/dot/de".

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

How to visualize dicom images?

#7 Post by nobnet »

I already sent but my english is bad. I wanted to write opaque or dark and without contrast when I wrote cloudy. I sent to the e-mail riesmeier/at/offis/dot/de and dicom/at/offis/dot/de, I don't know if I sent right.

thanks!

[MODERATOR] Obfuscated email addresses.

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

#8 Post by Jörg Riesmeier »

You did sent an EXE file but no DICOM image. Nevertheless, first you should try to specify an appropriate VOI window as described above.

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

how to visualize dicom images ?

#9 Post by nobnet »

I sent the dicom image.

thanks!

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

How to visualize dicom images?

#10 Post by nobnet »

you was right!. thank you!.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest