Machine Scale

A machine scale or coordinate system is a specific reference framework used in the context of machines or equipment. It provides a standardized way to define positions, orientations, and measurements within the machine or equipment.

Other examples of coordinate systems are Cartesian, Polar, and Spherical.

Within the context of pylinac and machines, we’re generally referring to IEC61217 or other systems defined by a manufacturer.

It is sometimes required to convert coordinate systems. An example is Dan Low’s Winston-Lutz paper, where the coordinate system must be corrected for the equations to work correctly. See here.

Converting scales

To convert the values from one machine scale to another, use the convert() function.

from pylinac.core.scale import convert, MachineScale

gantry = 0
coll = 90
couch = 45

new_gantry, new_coll, new_couch = convert(
    input_scale=MachineScale.Varian,
    output_scale=MachineScale.IEC61217,
    gantry=gantry,
    collimator=coll,
    rotation=couch,
)
class pylinac.core.scale.MachineScale(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Possible machine scales. Used for specifying input and output scales for conversion. The enum keys are conversion functions for each axis relative to IEC 61217

pylinac.core.scale.convert(input_scale: MachineScale, output_scale: MachineScale, gantry: float, collimator: float, rotation: float)[source]

Convert from one coordinate scale to another. Returns gantry, collimator, rotation.