medimage 发表于 2015-12-4 21:10:01

DCMTK简介八-dcmpstat程序库

本帖最后由 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 imagedcmmklut: Create DICOM look-up tablesdcmp2pgm: Read DICOM image and presentation state and render bitmapdcmprscp: DICOM basic grayscale print management SCPdcmprscu: Print spooler for presentation state viewerdcmpschk: Checking tool for presentation statesdcmpsmk: Create DICOM grayscale softcopy presentation statedcmpsprt: Read DICOM images and presentation states and render print jobdcmpsrcv: Network receive for presentation state viewerdcmpssnd: Network send for presentation state viewer举例:--给一幅DICOM图像创建一个缺省的描述状态DcmFileFormat infile;DcmFileFormat outfile;if (infile.loadFile("image.dcm").good()){DVPresentationState pstate; // presentation state handlerif (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 handlerif (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    }}}

dentaldev 发表于 2016-5-22 21:33:48

看看高人有多高
页: [1]
查看完整版本: DCMTK简介八-dcmpstat程序库