医站点医维基

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1036|回复: 1

[DCMTK] DCMTK简介八-dcmpstat程序库

[复制链接]

336

主题

410

回帖

2806

积分

管理员

积分
2806

热心会员推广达人优秀版主荣誉管理论坛元老

发表于 2015-12-4 21:10:01 | 显示全部楼层 |阅读模式
本帖最后由 medimage 于 2015-12-4 21:27 编辑

八、dcmpstat程序库
dcmpstat: 一个描述状态(presentation state)库和可用工具。This module contains classes that implement a high-level API for the DICOM Softcopy Grayscale Presentation State Storage SOP Class. It also contains various support classes that are used by DICOMscope, a free DICOM viewer that has been developed as a demonstrator for presentation states. See http://dicom.offis.de/dscope
主要接口:
--DVPresentationState: 一个灰度软拷贝描述状态。这个类管理着一个描述状态对象的数据结构。描述状态可以创建、读、写和更改。在dvpstat.h中定义。
--DVInterface: 这个接口类是用来帮助软拷贝描述状态浏览器工作的。这个类管理着数据库机制,允许开始和停止网络交互,并访问图像和描述状态。在dviface.h中定义。
--DVPSStoredPrint: the representation of a Stored Print object。在文件dvpssp.h中定义。
工具:
dcmmkcrv: Add 2D curve data to image
dcmmklut: Create DICOM look-up tables
dcmp2pgm: Read DICOM image and presentation state and render bitmap
dcmprscp: DICOM basic grayscale print management SCP
dcmprscu: Print spooler for presentation state viewer
dcmpschk: Checking tool for presentation states
dcmpsmk: Create DICOM grayscale softcopy presentation state
dcmpsprt: Read DICOM images and presentation states and render print job
dcmpsrcv: Network receive for presentation state viewer
dcmpssnd: Network send for presentation state viewer
举例:
--给一幅DICOM图像创建一个缺省的描述状态
DcmFileFormat infile;
DcmFileFormat outfile;
if (infile.loadFile("image.dcm").good())
{
DVPresentationState pstate; // presentation state handler
if (pstate.createFromImage(*infile.getDataset()).good())
{
    // serialize presentation state into DICOM data set structure
    if (pstate.write(*outfile.getDataset(), OFFalse).good())
    {
      // and write to file
      outfile.saveFile("gsps.dcm", EXS_LittleEndianExplicit);     
    }
}
}

--应用一个描述状态中的灰度变换管道给一幅DICOM图像
DcmFileFormat imagefile;
DcmFileFormat gspsfile;
if (imagefile.loadFile("image.dcm").good() &&
    gspsfile.loadFile("gsps.dcm").good())
{
DVPresentationState pstate; // presentation state handler
if (pstate.read(*gspsfile.getDataset()).good()) // parse gsps object
{
    // attach presentation state to image data
    if (pstate.attachImage(&imagefile, OFFalse).good())
    {
      const void *pixel; // pointer to pixel data, one byte per pixel
      unsigned long width;   // width of image bitmap
      unsigned long height; // height of image bitmap
      if (pstate.getPixelData(pixel, width, height).good())
      {
        /* do something useful with the pixel data */
      }
      pstate.detachImage(); // release connection between GSPS and image
    }
}
}

回复

使用道具 举报

1

主题

441

回帖

1100

积分

版主

积分
1100

热心会员推广达人优秀版主荣誉管理论坛元老

发表于 2016-5-22 21:33:48 | 显示全部楼层
看看高人有多高
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|关于我们|医维基|网站地图|Archiver|手机版|医疗之家 ( 沪ICP备2023001278号-1 )  

GMT+8, 2024-5-2 09:43 , Processed in 0.288284 second(s), 28 queries .

Designed by Medical BBS

快速回复 返回顶部 返回列表