Hi James and hi to all fellow pylinac users,
I’m currently working heavily with the WL module in Pylinac and was wondering on how to correctly name the couch angles. I use an Elekta linac + iView to acquire the EPID images. As James already mentioned in his documentation, the iView doesn’t log couch coordinates in the DICOM tags of the acquired EPID images and one has to edit the tags on its own. The DICOM coordinate system is the IEC coordinate system, which indicates a rotation towards the B-side of the treatment room as positive couch angle 0°-90° (imagine you are looking from the foot of the table toward the gantry and rotate the table to your right side). A rotation of the couch towards the A-side (your left side) is then considered as angles 360°-270°.
However a manual calculation with pen and paper left me with the following definition for the transformation of CAX2BB distance from EPID to couch-fixed / patient-fixed (James’ x=right-left, y=down-up, z=cranio-caudal definition) stereotactic coordinate system, when using the IEC coordinate system:
dist_x_epid = (bb_x - cax_x)
dist_y_epid = (bb_y - cax_y)
consider the couch angle in the IEC definition: couch_angle_iec
cax2bb_RL = dist_x_epid * cos(couch_angle_iec) + dist_y_epid * sin(couch_angle_iec)
cax2bb_CC = dist_x_epid * sin(couch_angle_iec) - dist_y_epid * cos(couch_angle_iec)
(since cax2bb_CC=bb_z_offset=-cax2bb_vector.y under gantry 0°)
Looking at the function cax2bb_vector(self) in the source one is left with the following definition in pylinac:
cax2bb_RL = dist_x_epid * cos(couch_angle_pylinac) - dist_y_epid * sin(couch_angle_pylinac)
cax2bb_CC = -dist_x_epid * sin(couch_angle_pylinac) - dist_y_epid * cos(couch_angle_pylinac)
(since cax2bb_CC=bb_z_offset=-cax2bb_vector.y under gantry 0°)
This would indicate that the couch angles should be named according to these examples:
couch_angle_iec = 40 => couch_angle_pylinac = 320 (used for naming the DICOM files acquired with iView)
couch_angle_iec = 350 => couch_angle_pylinac = 10 (used for naming the DICOM files acquired with iView)
couch_angle_iec = 270 => couch_angle_pylinac = 90 (used for naming the DICOM files acquired with iView)
couch_angle_iec = 13 => couch_angle_pylinac = 347 (used for naming the DICOM files acquired with iView)
with
couch_angle_iec = DICOM standard / IEC
couch_angle_pylinac = pylinac convention
I would be very glad, if someone which uses Elekta iView images may update on how they name their couch angles to be interpreted in the right way by pylinac.