DCMTK: dcmimage: adds support for color images to dcmimgle

DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
dcmimage: adds support for color images to dcmimgle

This module contains classes to access and render DICOM color images. Support for monochrome images is provided by the module dcmimgle. Support for JPEG compressed images is provide by the module dcmjpeg.

The main interface class is:

- DicomImage (from module dcmimgle)

# Tools

This module contains the following command line tools:

- dcm2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF or BMP
- dcmquant: Convert DICOM color images to palette color
- dcmscale: Scale DICOM images

# Examples

The following example shows how to load a DICOM single-frame image (monochrome or color) and render its pixel data:

#include "dcmtk/dcmimage/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;
DicomImage
Interface class for dcmimgle/dcmimage module.
Definition dcmimage.h:56
DicomImage::getOutputData
const void * getOutputData(const int bits=0, const unsigned long frame=0, const int planar=0)
render pixel data and return pointer to internal memory buffer.
Definition dcmimage.h:420
DicomImage::getStatus
EI_Status getStatus() const
get current status information
Definition dcmimage.h:200
DicomImage::getString
static const char * getString(const EI_Status status)
convert status code to status string
EIS_Normal
@ EIS_Normal
normal, no error
Definition diutils.h:226

Generated on for DCMTK Version 3.7.0 by Doxygen 1.16.1