# Energy layers in a scanning beam proton treatment plan viewed in SlicerRT

**URL:** <https://discourse.slicer.org/t/energy-layers-in-a-scanning-beam-proton-treatment-plan-viewed-in-slicerrt/27990>\
**Category:** Support\
**Tags:** slicerrt\
**Created:** [February 22, 2023, 10:30pm UTC](https://discourse.slicer.org/t/energy-layers-in-a-scanning-beam-proton-treatment-plan-viewed-in-slicerrt/27990 "2023-02-22T22:30:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alema](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@alema](https://discourse.slicer.org/u/alema)\
**Post date:** [February 22, 2023, 10:30pm UTC](https://discourse.slicer.org/t/energy-layers-in-a-scanning-beam-proton-treatment-plan-viewed-in-slicerrt/27990/1 "2023-02-22T22:30:22Z")

</div>

Hello,

Is information about “energy layers” available in SlicerRT? In SlicerRT (version 1.0.0 running as an extension to 3D Slicer 5.2.1 on Linux), I see only one table (corresponding to one energy layer) with x and y positions and the weights of the scanning beam. The original RT plan created using Varian Eclipse uses at least 20 energy layers, each containing x and y positions and weights.

I’m new to SlicerRT, so it may be my fault that I don’t know how to display the tables. I aim to extract information about the scanning beam and use it in the Monte Carlo simulation code Topas.

Thank you,  
Alexandr

---

<div class="post-metadata">

**Author:** ![alema](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@alema](https://discourse.slicer.org/u/alema)\
**Post date:** [February 24, 2023, 6:45pm UTC](https://discourse.slicer.org/t/energy-layers-in-a-scanning-beam-proton-treatment-plan-viewed-in-slicerrt/27990/2 "2023-02-24T18:45:19Z")

</div>

In the end, I extracted the ScanSpot\_PositionMap\_MetersetWeights tables via Pydicom. For a given field, SlicerRT shows only one of the tables. IMHO, the feature to view all of them (one table for one energy layer) is not implemented in SlicerRT.

Alexandr

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [February 25, 2023, 3:34pm UTC](https://discourse.slicer.org/t/energy-layers-in-a-scanning-beam-proton-treatment-plan-viewed-in-slicerrt/27990/3 "2023-02-25T15:34:37Z")

</div>

Dear Alexandr,

Scan spot position map is a dynamic sequence for a RTBeam in a RTPlan.

If you have a dynamic beam with multiple control points in your plan, and the plan with the beam was loaded successfully, you can use `Sequences` module.

1. After successful loading, select module `Sequences` in `Sequences` subsection;  

2. Select required sequence browser for a particular beam;

3. Change `Control point` index for desired value;

4. In subject hierarchy click on ScanSpot\_PositionMap table to get different values for each control point.

Lack of good documentation is a real issue indeed.

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [February 25, 2023, 5:57pm UTC](https://discourse.slicer.org/t/energy-layers-in-a-scanning-beam-proton-treatment-plan-viewed-in-slicerrt/27990/4 "2023-02-25T17:57:58Z")

</div>

If you need a `Nominal Beam Energy` parameter for each control point, or the first value if energy is fixed, that information is unavailable from GUI.

---

<div class="post-metadata">

**Author:** ![alema](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@alema](https://discourse.slicer.org/u/alema)\
**Post date:** [February 27, 2023, 5:23pm UTC](https://discourse.slicer.org/t/energy-layers-in-a-scanning-beam-proton-treatment-plan-viewed-in-slicerrt/27990/5 "2023-02-27T17:23:11Z")

</div>

Dear Mikhail,

Thank you for the information. I’ve checked that SlicerRT and the code below provide the same values. That is what I need.

```auto
import pydicom
import pandas as pd

dRN = pydicom.dcmread("RN.Plan1.dcm")

iIbs = 2 # Sequence browser index in SlicerRT - 1
iIcps = 48 # Control point in SlicerRT

np = dRN.IonBeamSequence[iIbs].IonControlPointSequence[iIcps].NumberOfScanSpotPositions
xv = dRN.IonBeamSequence[iIbs].IonControlPointSequence[iIcps].ScanSpotPositionMap[0::2]
yv = dRN.IonBeamSequence[iIbs].IonControlPointSequence[iIcps].ScanSpotPositionMap[1::2]
wt = dRN.IonBeamSequence[iIbs].IonControlPointSequence[iIcps].ScanSpotMetersetWeights
ScanSpotTable = pd.DataFrame({'x': xv, 'y': yv, 'weight': wt})

print('Energy = {} MeV'.format(dRN.IonBeamSequence[iIbs].IonControlPointSequence[iIcps].NominalBeamEnergy))
print(ScanSpotTable)

```

Output:

```auto
Energy = 63.259 MeV
      x y weight
0 -14.0 -21.0 0.058259
1 -28.0 -14.0 0.068364
2 -21.0 -14.0 0.038700
3 -14.0 -14.0 0.155363
4 -7.0 -7.0 0.075061
5 -14.0 -7.0 0.039275
6 -21.0 -7.0 0.097907
7 -14.0 0.0 0.110739

```
