pyRadPlan.geometry package#

Submodules#

pyRadPlan.geometry.lps module#

get_gantry_rotation_matrix(gantry_angle)[source]#

Calculate the rotation matrix for gantry.

Represents an active, counter-clockwise rotation Matrix for Gantry around z with pre-multiplication of the matrix (R*x).

Parameters:

gantry_angle (ArrayType) – The angle of gantry rotation in degrees.

Returns:

The rotation matrix.

Return type:

ArrayType

Notes

Gantry rotation is physically an active rotation of a beam vector around the target / isocenterin the patient coordinate system

The LPS system is right-handed, where the gantry rotates counter-clockwise around the z-axis and the couch rotates counter-clockwise around the y-axis. The gantry rotation is an active rotation of a beam vector around the target/isocenter in the patient coordinate system.

get_couch_rotation_matrix(couch_angle)[source]#

Calculate the rotation matrix for the couch.

Parameters:

couch_angle (ArrayType) – The angle of couch rotation in degrees.

Returns:

The rotation matrix.

Return type:

ArrayType

Notes

The LPS system is right-handed, where the gantry rotates counter-clockwise around the z-axis and the couch rotates counter-clockwise around the y-axis. The gantry rotation is an active rotation of a beam vector around the target/isocenter in the patient coordinate system.

get_beam_rotation_matrix(gantry_angle, couch_angle)[source]#

Calculate the rotation matrix for gantry and couch angles.

Represents active, counter-clockwise rotation for couch around y with pre-multiplication of the matrix (R*x)

Parameters:
  • gantry_angle (ArrayType) – The angle of gantry rotation in degrees.

  • couch_angle (ArrayType) – The angle of couch rotation in degrees.

Returns:

The 3x3 rotation matrix.

Return type:

ArrayType

Notes

Couch rotation is physically a passive rotation of the patient system around the beam target point / isocenter

The LPS system is right-handed, where the gantry rotates counter-clockwise around the z-axis and the couch rotates counter-clockwise around the y-axis. The gantry rotation is an active rotation of a beam vector around the target/isocenter in the patient coordinate system.

Examples

>>> get_beam_rotation_matrix(90, 45)
array([[ 0.        , -0.70710678,  0.70710678],
       [ 1.        ,  0.        ,  0.        ],
       [ 0.        ,  0.70710678,  0.70710678]])