dcmrt: 放射線治療ライブラリとユーティリティアプリ群
このモジュールには、各種の DICOM 放射線治療(RT)オブジェクトを読み書き・生成・変更・参照するためのクラスが含まれます。これらのクラスは、公式の DocBook/XML 版 DICOM 規格から自動生成されています。
主なインターフェースクラスは次のとおりです。
- DRTDoseIOD
- DRTImageIOD
- DRTPlanIOD
- DRTStructureSetIOD
- DRTTreatmentSummaryRecordIOD
- DRTIonPlanIOD
- DRTIonBeamsTreatmentRecordIOD
この低レベルインターフェースをより扱いやすくするため、よく使う機能を提供する手書きのクラスもいくつか用意されています。
それらのクラスは次のとおりです。
ツール
このモジュールには次のコマンドラインツールが含まれます。
例
次の例は、RT Dose ファイルを読み込み、患者名を出力する方法を示します。
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;
次の例は、RT Dose ファイルを読み込み、スケール済みの線量画像にアクセスする方法を示します。
DRTDose rtdose;
OFCondition status = rtdose.loadFile("rtdose.dcm");
if (status.good())
{
const unsigned int frame = 0;
OFVector
status = rtdose.getDoseImage(doseImage, frame);
if (status.good())
{
OFVector
for (int y = 0; y < doseImage.getDoseImageHeight(); ++y)
{
for (int x = 0; x < doseImage.getDoseImageWidth(); ++x)
{
double value = *it++;
/ do something useful with the dose image pixel /
}
}
} else
cerr << "Error: cannot read RT Dose image (" << status.text() << ")" << endl;
} else
cerr << "Error: cannot load RT Dose object (" << status.text() << ")" << endl;
次の例は、RT Plan ファイルを読み込み、患者名を変更して新しいファイルに保存する方法を示します。
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;
既知の問題
このモジュールのクラスの多くは機械可読版の DICOM 規格から自動生成されており、RT オブジェクトでは同じシーケンス属性を場所ごとに異なる内容で「再利用」することが知られています。そのため、一部のサブシーケンスでは定義の誤りに起因する問題がまだ残っている可能性があります。たとえば、Referenced Beam Sequence (300C,0004) と Referenced SOP Sequence (0008,1199) は、まだ完全には正しく扱えていない可能性のある候補です。