DCMTK  Version 3.6.2
OFFIS DICOM Toolkit
dcmsr: a structured reporting library and utility apps

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

The main interface classes are:

Here are some further classes that are useful when implementing SR templates:

Currently, the following SR templates are implemented (see notes for details):

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 (further details can be found in the mkreport source file):

DSRDocument document;
document.setPatientName("Doe^John");
/* ... */
/* ... */
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:

/* ... */
if (codePtr != NULL)
codePtr->setCode("113000", "DCM", "Of Interest");
/* ... */
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);
}
/* ... */

In addition, there are specific DSRDocumentTree::addContentItem() and DSRDocumentTree::addChildContentItem() methods that expect a pointer to a newly created DSRDocumentTreeNode instance.

The final example shows how to deal with SR templates, e.g. when creating a DICOM Structured Report that is based on TID 1500 (Measurement Report):

report.setLanguage(CID5000_Languages::English);
report.getObservationContext().addPersonObserver("Doe^Jane", "Some Organization");
/* ... */
TID1500_MeasurementReport::TID1411_Measurements &measurements = report.getVolumetricROIMeasurements();
measurements.setActivitySession("1");
measurements.setTrackingIdentifier("aorta reference region");
/* ... */
DSRDocument document;
document.setPatientName("Last Name^First Name");
/* ... */
if (document.setTreeFromRootTemplate(report).good())
else
cerr << "Error: cannot set template content as document tree" << endl;


Generated on Mon Jul 17 2017 for DCMTK Version 3.6.2 by Doxygen 1.8.13