gpt4 book ai didi

java - 如何使用pixelmed(java)访问嵌套序列中的dicom属性?

转载 作者:行者123 更新时间:2023-12-01 12:55:41 25 4
gpt4 key购买 nike

我需要访问 BeamSequence 属性内每个 ControlPointSequence 属性内的所有 GantryAngle 值。

这是嵌套的快速可视化

Beam Sequence
...
Control Point Sequence
Gantry Angle
...
...
Control Point Sequence
Gantry Angle
...
...
Control Point Sequence
Gantry Angle
...

如何使用 pixelmed 访问每个龙门角度图书馆?

编辑:

感谢 cnellar 的帮助,这就是最终的工作

private ArrayList<Double> getAngles( SequenceAttribute beamSequence ) {
ArrayList<Double> n = new ArrayList<Double>();

Iterator is = beamSequence.iterator();
while (is.hasNext()) {
SequenceItem item = (SequenceItem)is.next();
if (item != null) {
AttributeList itemList = item.getAttributeList();
if (itemList != null) {
SequenceAttribute ctrlPoint = (SequenceAttribute)itemList.get( TagFromName.ControlPointSequence );
//System.out.print(ctrlPoint);
Iterator is1 = ctrlPoint.iterator();
while (is1.hasNext()) {
SequenceItem item1 = (SequenceItem)is1.next();
if (item1 != null) {
AttributeList itemList1 = item1.getAttributeList();
if (itemList1 != null) {

Attribute gantry_angle = itemList1.get( TagFromName.GantryAngle );
if(gantry_angle!=null)
n.add(gantry_angle.getSingleDoubleValueOrDefault(0));


}
}

}



}
}
}
return n;

}

最佳答案

我期望类似的东西:

private double[] getAngles( SequenceAttribute beamSequence ) {

Iterator is = beamSequence.iterator();
while (is.hasNext()) {
SequenceItem item = (SequenceItem)is.next();
if (item != null) {
AttributeList itemList = item.getAttributeList();
if (itemList != null) {
Attribute ctrlPoint = itemList.get( TagFromName.ControlPointSequence );

// Do the same sifting through this sequence to get your gantry angle
// and add it to your list of values.
}
}
}

关于java - 如何使用pixelmed(java)访问嵌套序列中的dicom属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23921995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com