本帖最后由 medimage 于 2015-12-4 21:23 编辑
四、dcmimgle程序库
dcmimgle是一个图像处理库和可用的工具模块,它包括了对DICOM单色图像的访问和显示。对颜色图像的支持由dcmimage模块提供,对JPEG压缩图像的支持由dcmjpeg模块支持。 主要接口类: --DicomImage: 为dcmimgle/dcmimage模块提供接口类。主要目的是图像显示。在dcmimage.h中定义。 --DiDisplayFunction: Class to handle hardcopy and softcopy device characteristics file and manage display LUTs (for calibration). 在didispfn.h中定义。
可用工具: --dcmdspfn: Export standard display curves to a text file --dcod2lum: Convert hardcopy characteristic curve file to softcopy format --dconvlum: Convert VeriLUM files to DCMTK display files 举例: --载入一幅DICOM单帧单色图像,并显示其像素数据。 DicomImage *image = new DicomImage("test.dcm"); if (image != NULL) { if (image->getStatus() == EIS_Normal) { if (image->isMonochrome()) { image->setMinMaxWindow(); Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits */)); if (pixelData != NULL) { /* do something useful with the pixel data */ } } } else cerr << "Error: cannot load DICOM image (" << DicomImage::getString(image->getStatus()) << ")" << endl; } delete image; |