Picket and fence MLCArrangement offset


I’ m implementing the MLC positioning test by using the picket and fence module in pylinac.
Anyway, I notice that the offset value in the MLCArrangement should be used for asymmetric arrangements.
Anyway, in the code it looks like it does the same as the sag adjustment, setting an offset in the direction perpendicular to the MLC movement, instead of the direction of the MLC movement:
It does move the MLC centers:

self.centers =
self.widths =
rolling_edge = 0
for leaf_num, width in leaf_arrangement:
self.centers += np.arange(start=rolling_edge + width / 2, stop=leaf_num * width + rolling_edge + width / 2,
rolling_edge = self.centers[-1] + width / 2
self.widths += [width] * leaf_num
self.centers = [c - np.mean(self.centers) + offset for c in self.centers]

Is there any way to set an analysis offset in the same direction of the MLC?


I found the solution, I can apply:


before pf.analyze

Glad you found a solution. I’ve not had a request to move the image along the axis of movement before. Is this to correct for sag or something else?