DCMTK
Version 3.6.1 20120515
OFFIS DICOM Toolkit
|
This module contains classes to read, write, create, modify and access various DICOM Radiation Therapy (RT) objects.
The main interface classes are:
This module contains the following command line tools:
The following example shows how to load an RT Dose file and output the patient's name:
DcmFileFormat fileformat; OFCondition status = fileformat.loadFile("rtdose.dcm"); if (status.good()) { DRTDoseIOD rtdose; status = rtdose.read(*fileformat.getDataset()); if (status.good()) { OFString patientName; status = rtdose.getPatientName(patientName); if (status.good()) { cout << "Patient's Name: " << patientName << endl; } else cerr << "Error: cannot access Patient's Name (" << status.text() << ")" << endl; } else cerr << "Error: cannot read RT Dose object (" << status.text() << ")" << endl; } else cerr << "Error: cannot load DICOM file (" << status.text() << ")" << endl;
The following example shows how to load an RT Plan file, change the patient's name and save it to a new file:
DcmFileFormat fileformat; OFCondition status = fileformat.loadFile("rtplan.dcm"); if (status.good()) { DRTPlanIOD rtplan; status = rtplan.read(*fileformat.getDataset()); if (status.good()) { status = rtplan.setPatientName("Doe^John"); if (status.good()) { fileformat.clear(); status = rtplan.write(*fileformat.getDataset()); if (status.good()) { status = fileformat.saveFile("rtplan_new.dcm"); if (status.bad()) cerr << "Error: cannot save DICOM file (" << status.text() << ")" << endl; } else cerr << "Error: cannot write RT Plan object (" << status.text() << ")" << endl; } else cerr << "Error: cannot change Patient's Name (" << status.text() << ")" << endl; } else cerr << "Error: cannot read RT Plan object (" << status.text() << ")" << endl; } else cerr << "Error: cannot load DICOM file (" << status.text() << ")" << endl;