Hi David ,
PyMedPhys’ MLC + Jaw fluence approach assumes that there is only one set of jaws (no backup jaws). It was designed with the Elekta Agility in mind. Are you wanting to be able to utilise the backup jaws on the Varian or is that not an issue?
The first example within the docs gives an idea of how one might provide some raw MLC and jaw positions:
https://docs.pymedphys.com/lib/ref/metersetmap.html#api
I’ll copy the example in below for ease:
>>> import numpy as np
>>> import pymedphys
>>>
>>> leaf_pair_widths = (5, 5, 5) # The widths of the leaves on the bank
>>> max_leaf_gap = 10 # The max distance between opposing leaves
>>> mu = np.array([0, 2, 5, 10]) # MU for each control point
>>> mlc = np.array([ # MLC positions for each control point
... [
... [1, 1],
... [2, 2],
... [3, 3]
... ],
... [
... [2, 2],
... [3, 3],
... [4, 4]
... ],
... [
... [-2, 3],
... [-2, 4],
... [-2, 5]
... ],
... [
... [0, 0],
... [0, 0],
... [0, 0]
... ]
... ])
>>> jaw = np.array([ # Jaw positions for each control point
... [7.5, 7.5],
... [7.5, 7.5],
... [-2, 7.5],
... [0, 0]
... ])
>>>
>>> grid = pymedphys.metersetmap.grid( # The grid to calculate over
... max_leaf_gap=max_leaf_gap, leaf_pair_widths=leaf_pair_widths)
>>> grid['mlc']
array([-5., -4., -3., -2., -1., 0., 1., 2., 3., 4., 5.])
>>>
>>> grid['jaw']
array([-8., -7., -6., -5., -4., -3., -2., -1., 0., 1., 2., 3., 4.,
5., 6., 7., 8.])
>>>
>>> metersetmap = pymedphys.metersetmap.calculate(
... mu, mlc, jaw, max_leaf_gap=max_leaf_gap,
... leaf_pair_widths=leaf_pair_widths)
>>> pymedphys.metersetmap.display(grid, metersetmap)
>>>
>>> np.round(metersetmap, 1)
array([[0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ],
[0. , 0. , 0. , 0.3, 1.9, 2.2, 1.9, 0.4, 0. , 0. , 0. ],
[0. , 0. , 0. , 0.4, 2.2, 2.5, 2.2, 0.6, 0. , 0. , 0. ],
[0. , 0. , 0. , 0.4, 2.4, 2.8, 2.5, 0.8, 0. , 0. , 0. ],
[0. , 0. , 0. , 0.4, 2.5, 3.1, 2.8, 1. , 0. , 0. , 0. ],
[0. , 0. , 0. , 0.4, 2.5, 3.4, 3.1, 1.3, 0. , 0. , 0. ],
[0. , 0. , 0.4, 2.3, 3.2, 3.7, 3.7, 3.5, 1.6, 0. , 0. ],
[0. , 0. , 0.4, 2.3, 3.2, 3.8, 4. , 3.8, 1.9, 0.1, 0. ],
[0. , 0. , 0.4, 2.3, 3.2, 3.8, 4.3, 4.1, 2.3, 0.1, 0. ],
[0. , 0. , 0.4, 2.3, 3.2, 3.9, 5.2, 4.7, 2.6, 0.2, 0. ],
[0. , 0. , 0.4, 2.3, 3.2, 3.8, 5.4, 6.6, 3.8, 0.5, 0. ],
[0. , 0.3, 2.2, 3. , 3.5, 4. , 5.1, 7.5, 6.7, 3.9, 0.5],
[0. , 0.3, 2.2, 3. , 3.5, 4. , 4.7, 6.9, 6.7, 3.9, 0.5],
[0. , 0.3, 2.2, 3. , 3.5, 4. , 4.5, 6.3, 6.4, 3.9, 0.5],
[0. , 0.3, 2.2, 3. , 3.5, 4. , 4.5, 5.6, 5.7, 3.8, 0.5],
[0. , 0.3, 2.2, 3. , 3.5, 4. , 4.5, 5.1, 5.1, 3.3, 0.5],
[0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ]])