第一范文网 - 专业文章范例文档资料分享平台

dcmtk程序包简介

来源:用户分享 时间:2025/5/15 16:55:08 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

OFCondition status = fileformat.loadFile(\if (status.good()) {

OFString patientsName;

if (fileformat.getDataset()->findAndGetOFString(DCM_PatientsName, patientsName).good()) {

cout << \} else

cerr << \} else

cerr << \--创建一个DICOM dataset数据集,并保存为文件 char uid[100];

DcmFileFormat fileformat;

DcmDataset *dataset = fileformat.getDataset();

dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage); dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));

dataset->putAndInsertString(DCM_PatientsName, \/* ... */

dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength); OFCondition status = fileformat.saveFile(\if (status.bad())

cerr << \

--如何为多个文件创建一般目的的DICOMDIR DicomDirInterface dicomdir;

OFCondition status = dicomdir.createNewDicomDir(); if (status.good()) {

while ( /* there are files */ )

dicomdir.addDicomFile( /* current filename */ ); status = dicomdir.writeDicomDir(); if (status.bad())

cerr << \} else

cerr << \------------------------------------------------------------ 四、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(\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 << \<< endl; }

delete image;

五、dcmimage程序包

dcmimage模块为dcmimgle模块提供对彩色图像的支持。对单色图像的支持由dcmimgle提供,对JPEG压缩图像的支持由dcmjpeg模块支持。

主要接口类:

--DicomImage: 在dcmimgle中已介绍。 工具:

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

--载入一幅DICOM单帧图像(单色或彩色),并显示其像素数据。 #include \/* required to support color images */ /* ... */

DicomImage *image = new DicomImage(\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 << \<< endl; }

delete image;

搜索更多关于: dcmtk程序包简介 的文档
dcmtk程序包简介.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c3xkyn3wonn1emx02t1ol_2.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top