dcmsr: a structured report library and utility apps

This module contains classes to read, write, create, modify, access, print and render DICOM Structured Reporting documents (formerly Supplement 23). The list of supported SOP classes is provided in DSRTypes::E_DocumentType.

The main interface classes are:

Tools

This module contains the following command line tools:

Examples

The following example shows how to load a DICOM Structured Report and render its content in HTML format:

DcmFileFormat fileformat;
OFCondition status = fileformat.loadFile("test.dcm");
if (status.good())
{
  DSRDocument document;
  status = document.read(*fileformat.getDataset());
  if (status.good())
  {
    status = document.renderHTML(cout);
    if (status.bad())
      cerr << "Error: cannot render SR document (" << status.text() << ")" << endl;
  } else
    cerr << "Error: cannot read SR document (" << status.text() << ")" << endl;
} else
  cerr << "Error: cannot load DICOM file (" << status.text() << ")" << endl;

The following example shows how to create a DICOM Structured Report and save it to a file (see mkreport source file for details):

DSRDocument document;
document.setPatientName("Doe^John");
/* ... */
document.getTree().addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
document.getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue(/* some code */));
document.getTree().addContentItem(DSRTypes::RT_hasObsContext, DSRTypes::VT_Code, DSRTypes::AM_belowCurrent);
/* ... */
DcmFileFormat fileformat;
OFCondition status = document.write(*fileformat.getDataset())
if (status.good())
{
  status = fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit);
  if (status.bad())
    cerr << "Error: cannot save DICOM file (" << status.text() << ")" << endl;
} else
  cerr << "Error: cannot write SR document (" << status.text() << ")" << endl;

Alternatively, many properties of the document tree can be accessed and modified directly as the following example shows:

DSRDocument document(DSRTypes::DT_KeyObjectDoc);
/* ... */
document.getTree().addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
DSRCodedEntryValue *codePtr = document.getTree().getCurrentContentItem().getConceptNamePtr();
if (codePtr != NULL)
  codePtr->setCode("113000", "DCM", "Of Interest");
/* ... */
document.getTree().addContentItem(DSRTypes::RT_contains, DSRTypes::VT_Image);
DSRImageReferenceValue *imagePtr = document.getTree().getCurrentContentItem().getImageReferencePtr();
if (imagePtr != NULL)
{
  imagePtr->setValue(DSRImageReferenceValue(UID_UltrasoundMultiframeImageStorage, /* image UID */));
  imagePtr->setPresentationState(DSRCompositeReferenceValue(UID_GrayscaleSoftcopyPresentationStateStorage, /* GSPS UID */));
  imagePtr->getFrameList().addItem(2);
  imagePtr->getFrameList().addItem(5);
}
/* ... */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1