我試圖在fo-dicom的dicom文件中獲得一串放射療法計劃。對你來說似乎並不那麼難,但我因爲找不到正確的命令而陷入困境。如何用fo-dicom獲取dicom項目的完整字符串元素?
我正在過濾計劃,例如爲Leaf/Jaw Positions
。在VS調試模式下顯示的字符串值爲「-35 // 35」,我也可以在我的DICOM編輯器中找到它。但輸出只給了我值-35。我的代碼就像
var Leaf = file.Dataset.Get<Dicom.DicomSequence>(Dicom.DicomTag.BeamSequence).Items[0].
Get<Dicom.DicomSequence>(Dicom.DicomTag.ControlPointSequence).Items[0].
Get<Dicom.DicomSequence>(Dicom.DicomTag.BeamLimitingDevicePositionSequence).Items[0].
Get<string>(Dicom.DicomTag.LeafJawPositions);
因此,我只獲得提到的第一個值。通過將最後的Get<string>()
更改爲Get<Dicom.DicomElement>()
或其他調試守望組件,我可以再次看到整個字符串,但無法打印。
我擡頭這裏C# Split A String By Another String或Easiest way to split a string on newlines in .NET?我嘗試了與編輯我的代碼
string Leaf = file.Dataset.Get<Dicom.DicomSequence>(Dicom.DicomTag.BeamSequence).Items[0].
Get<Dicom.DicomSequence>(Dicom.DicomTag.ControlPointSequence).Items[0].
Get<Dicom.DicomSequence>(Dicom.DicomTag.BeamLimitingDevicePositionSequence).Items[0].
Get<Dicom.DicomElement>(Dicom.DicomTag.LeafJawPositions);
但string
是不能接受Dicom.DicomElement
作爲一個字符串,並與Get<string>()
在上線我只得到再次剪切字符串。
希望你能幫助找到我做錯了什麼地方,以及如何獲得這個項目的完整字符串。
謝謝您的回答。它工作得很好。 – Booma