<< Back to the main page

Constructing DICOM dataset

DICOM dataset can be easily constructed by inserting tags into an empty dataset or populating an existing one:

DcmDataset dataset;

dataset.setTagValue("MediaStorageSOPClassUID", "1.2.840.10008.");
dataset.setTagValue("MediaStorageSOPInstanceUID", "");
dataset.setTagValue("StudyInstanceUID", "");
dataset.setTagValue("SeriesInstanceUID", "");
dataset.setTagValue("SOPClassUID", "1.2.840.10008.");
dataset.setTagValue("SOPInstanceUID", "");
dataset.setTagValue("PatientId", "BJ750315");
dataset.setTagValue("PatientName", "Brown^John");
dataset.setTagValue("PatientSex", "M");
dataset.setTagValue("PatientBirthDate", QDate(1975, 3, 15));

Another way to populate a dataset is by using modules. Modules are sets of tags grouped logically in a single object:

DcmDataset dataset;

DcmModulePatient patient;


Modules contain mandatory tags well as optional tags. One may call isValid() method of a module object to check that all mandatory tags has been defined.

©2012 by Arthur Benilov

Project Web Hosted by