Hello,
I have a problem to get 16 bits pictures of Dicom files. The method getOutPutData of DcmImage gives back an error. How should I do ?
Otherwise, the getOutputData gives also an error while trying to get 8 bits rendering of a 16 bits Dicom file. Is there hier something special to do ?
Thanks a lot in advance !
DcmImage->GetOutPut in 16 bits
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 117
- Joined: Tue, 2004-11-02, 17:21
- Location: Oldenburg, Germany
- Contact:
There is an example in DCMTK's documentation (file dcmimage/docs/dcmimage.dox):
In order to get 16-bit pixel data, use an Uint16 pointer and pass (int)16 as a parameter to getOutputData.
Code: Select all
#include "diregist.h" /* required to support color images */
/* ... */
DicomImage *image = new DicomImage("test.dcm");
if (image != NULL)
{
if (image->getStatus() == EIS_Normal)
{
Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits per sample */));
if (pixelData != NULL)
{
/* do something useful with the pixel data */
}
} else
cerr << "Error: cannot load DICOM image (" << DicomImage::getString(image->getStatus()) << ")" << endl;
}
delete image;
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest