How visualize dicom images?
Moderator: Moderator Team
How visualize dicom images?
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!
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
How to visualize dicom images?
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?
what do I do?
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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).
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).
How to visualize dicom images?
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, ;
img=new FXPPMImage(getApp(),(const unsigned char*)buffer,IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP);
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, ;
img=new FXPPMImage(getApp(),(const unsigned char*)buffer,IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP);
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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".
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".
How to visualize dicom images?
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.
thanks!
[MODERATOR] Obfuscated email addresses.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
how to visualize dicom images ?
I sent the dicom image.
thanks!
thanks!
How to visualize dicom images?
you was right!. thank you!.
Who is online
Users browsing this forum: No registered users and 1 guest