Error Winston-Lutz analysis - max RMS errors bug

Hello,

I’ ve encountered a bug in the WL code.
When evaluating the results for the max RMS deviation (it doesn’ t matter which axis), I noticed it was sometimes inconsistent with the deviations plots.
Here an example:

The max RMS deviation from the results is actually only the second max RMS deviation.
This error appears every time the actual max RMS deviation for a specific axis is on the Gantry0Col0Couch0 image (the Axis.REFERENCE image).

The bug is in the code that calculated the max deviations:

def axis_rms_deviation(self, axis: Axis = Axis.GANTRY, value: str = ‘all’) → Union[Iterable, float]:
“”"The RMS deviations of a given axis/axes.

Parameters

Thanks Gloria, I will look into this today and put a fix in pylinac as needed.