我正在尝试使用 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# 用另一个字符串拆分字符串或在 .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>()
在最后一行中我只能再次获得剪切字符串。
希望您能帮助找到我做错了什么以及如何获得该项目的完整字符串。