how to write the pixal data back to DCMImage object?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
qs5d
Posts: 6
Joined: Thu, 2005-04-28, 14:53

how to write the pixal data back to DCMImage object?

#1 Post by qs5d »

I want to get the pure image data (no header information at all) from a dicom image, then do some image processing work, then write the image data back to dicom format. First, I created a DCMFileformat object, then I get the dataset, from the dataset I get the DicomImage, then I use the following to get the pixel data:
Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits per sample */));

But I don't know how write the processed pixel data back to DicomImage object. I tried to searched the dcmimage class, dcmimgle class, I didn't find anything like writing or putting pixel data back to dicomimage object.

Thank you very much.

Qingling

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 »

First of all, the main purpose of class DicomImage (and module dcmimgle/dcmimage) is visualization, i.e. getOutputData() returns transformed and not original pixel data which might not be what you want (see FAQ #24 for details).

This also explains why there is no way to feed the processed pixel data back into the DicomImage object. Currently, you have to do this manually using the appropriate DcmDataset::putAndInsertXXX() methods (see FAQ #34 for details).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest