【发布时间】:2017-10-13 11:30:11
【问题描述】:
我正在尝试使用 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>() 我只能再次得到剪切字符串。
希望您能帮助找到我做错了什么以及如何获取该项目的完整字符串。
【问题讨论】: