DCMTK Create a Mammography CAD SR Document

 

Howto: Create a Mammography CAD SR Document

Here's an example that shows how to start from scratch:

Source Code

 

#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmsr/dsrdoc.h"
#include "dcmtk/dcmdata/dcfilefo.h"
 
int main(int /*argc*/, char * /*argv*/ [])
{
  DSRDocument *doc = new DSRDocument();
  if (doc != NULL)
  {
    doc->createNewDocument(DSRTypes::DT_MammographyCadSR);
 
    doc->setPatientsName("Last Name^First Name");
    doc->setPatientsSex("O");
    doc->setManufacturer("OFFIS e.V.");
    doc->setReferringPhysiciansName("Last Name^First Name");
 
    doc->getTree().addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
    doc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("111036", "DCM", "Mammography CAD Report"));
    doc->getTree().getCurrentContentItem().setTemplateIdentification("4000","DCMR"); 
 
    doc->getTree().addContentItem(DSRTypes::RT_hasConceptMod, DSRTypes::VT_Code, DSRTypes::AM_belowCurrent); 
    doc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("121049", "DCM", "Language of Content Item and Descendants"));
    doc->getTree().getCurrentContentItem().setCodeValue(DSRCodedEntryValue("eng","ISO639_2","English"));
 
    doc->getTree().addContentItem(DSRTypes::RT_hasConceptMod, DSRTypes::VT_Code, DSRTypes::AM_belowCurrent); 
    doc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("121046", "DCM", "Country of Language"));
    doc->getTree().getCurrentContentItem().setCodeValue(DSRCodedEntryValue("US","ISO3166_1","UNITED STATES"));
 
    doc->getTree().goUp();
 
    doc->getTree().addContentItem(DSRTypes::RT_contains, DSRTypes::VT_Container); 
    doc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("111028", "DCM", "Image Library"));
 
    /* proceed with adding content items according to TID 4000 ... */
 
    DcmFileFormat *fileformat = new DcmFileFormat();
    DcmDataset *dataset = NULL;
    if (fileformat != NULL)
      dataset = fileformat->getDataset();
    if (dataset != NULL)
    {
      if (doc->write(*dataset).good())
        fileformat->saveFile("mamcadsr.dcm", EXS_LittleEndianExplicit);
    }
    delete fileformat;
  }
  delete doc;
 
  return 0; 
}

 Dump

The resulting output (from dsrdump) looks like this:

 

Mammography CAD SR Document

Patient            : Last Name^First Name (O)
Referring Physician: Last Name^First Name
Manufacturer       : OFFIS e.V.
Completion Flag    : PARTIAL
Verification Flag  : UNVERIFIED
Content Date/Time  : 20080710 175805

<CONTAINER:(111036,DCM,"Mammography CAD Report")=SEPARATE>  # TID 4000 (DCMR)
  <has concept mod CODE:(121049,DCM,"Language of Content Item and Descendants")=(eng,ISO639_2,"English")>
    <has concept mod CODE:(121046,DCM,"Country of Language")=(US,ISO3166_1,"UNITED STATES")>
  <contains CONTAINER:(111028,DCM,"Image Library")=SEPARATE> 


Note:

 

Detailed Description

Interface class for 'dcmsr' (DICOM Structured Reporting Documents).

This class supports reading, writing, creation, printing and rendering of DICOM Structured Reporting (SR) documents. The list of supported SOP classes is available in file "dsrtypes.h".

 

 

------------------------------------------------------------------

柳北风儿

http://qimo601.iteye.com

转载:http://support.dcmtk.org/wiki/dcmtk/howto/mammocadsr

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值