PLUNC Coordinate Systems

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

PLanUNC Coordinate Systems

Table of Content

1. The ideal machine....................................................................................................... 2


2. Machine coordinate system ........................................................................................ 2
3. Patient coordinate system ........................................................................................... 3
4. Beam coordinate system ............................................................................................. 5
5. Angles ......................................................................................................................... 5
6. Unit coordinate system ............................................................................................... 6
7. Filter coordinate system.............................................................................................. 7
8. Grid coordinate system ............................................................................................... 8
9. Image/Pixel coordinate system ................................................................................... 8
10. Registered Subimage coordinate system .................................................................... 9
11. View coordinate systems used in Anastruct Editor .................................................... 9
12. View coordinate systems used in xplandisp ............................................................. 10
13. Beam’s-Eye-View (BEV), XVIEW, YVIEW, and FreeView of the BEAM system12
14. Screen coordinate system.......................................................................................... 13
15. Transformation operators.......................................................................................... 13
16. Construction of a matrix from machine settings....................................................... 14
17. Derivation of machine settings from a matrix .......................................................... 15
18. References................................................................................................................. 17

January 2006
PLanUNC Coordinate Systems

PLUNC makes use of the following coordinate systems: Patient/Table-top,Beam, Unit,


Filter, Grid, Image, Registered subimage, various views, and Screen. Objects are defined
in one of these coordinate systems, and their coordinates may be transformed between
these systems to address task-specific needs using 4x4 transformation matrices.

1. The ideal machine


In order to handle a wide variety of conventions used by various therapy equipment
manufacturers for the labeling of gantry, collimator, and table angles, PLUNC defines its
coordinate systems and performs its calculations for an “ideal” machine, and then maps
the settings of the ideal machine to the conventions of a chosen treatment machine or
simulator as needed.
The ideal machine has only six motions. The gantry rotates around a horizontal axis
which passes through the isocenter, and the angle is 0° when the gantry is vertical and the
collimator is above the table. The collimator rotates around the beam central axis, and the
angle is 0° when the collimator is at the center of its excursion. The table rotates around a
vertical axis which passes through the isocenter, and the angle is 0° when the foot of the
table is pointed directly away from the gantry along its rotation axis. The machine is at its
rest position when all three rotations are at 0°, and the rotations can vary by ±180°. The
senses of the angles are in accordance with the definitions given later and illustrated in
Figure 3. In addition to the rotations, the table also has independent lateral, longitudinal,
and height motions.

2. Machine coordinate system


This system is not used directly in PLUNC, but provides a conceptual frame of reference
for defining other systems and for understanding inter-system transformations. It is fixed
with respect to the machine and has its origin at the isocenter. If the machine is in a fixed
position in the room, then the Machine system serves equally as a room-based frame of
reference.
This right-handed system is illustrated in Figure 1, as viewed looking toward the gantry:
xM axis is positive to the right.
yM axis is positive up.
zM axis is positive away from the gantry.

January 2006 2 of 17
PLanUNC Coordinate Systems

yM

xM

zM

Figure 1. The Machine coordinate system is a right-handed system centered at the isocenter and
fixed with respect to the machine.

3. Patient coordinate system


Since the patient is assumed to be attached to the treatment table in a reproducible way,
the system is also called a Table-top system. It is fixed with respect to the patient/table
combination.
This right-handed system is illustrated in Figure 2, as viewed from the foot of the table:
xP axis is positive to the right, and the origin is at lateral table center.
yP axis is positive up, and the origin is at tabletop.
zP axis is positive toward the foot of the table, and the origin is at an arbitrary patient-
specific level.

January 2006 3 of 17
PLanUNC Coordinate Systems

yB

xB

yP zB

xP

zP

Figure 2. The Patient coordinate system is a right-handed system centered at table lateral center,
table-top, and some patient-specific longitudinal landmark. It is fixed with respect to the
table/patient ensemble. The Beam coordinate system is a left-handed system centered at the radiation
source and fixed with respect to the collimator.
Note that the conventions for the coordinate system do not depend upon the patient’s
position or orientation. Consequently, as illustrated in the table below, the axes of the
Patient/Table coordinate system align differently with the patient as the patient
orientation changes.
Table 1. Patient alignment in PLUNC’s Patient/Table coordinate system.

Patient Patient alignment in various body orientations


coordinate supine supine prone prone
system axes head-first feet-first head-first feet-first
+xP axis left right right left
+yP axis anterior anterior posterior posterior
+zP axis inferior superior inferior superior

Also the xP and yP axes are chosen to lie in the nominal transverse plane of the patient that
is familiar to practicing dosimetrists. Since the system is fixed to the patient/table
combination it is invariant under table rotation and translation. Thus a point in the patient
has unique coordinates in the Patient frame of reference. The origin of the Patient system
is pointedly chosen to be easily locatable clinically. Given the Patient coordinates of a
point, the physical location of that point in the patient can readily be determined

January 2006 4 of 17
PLanUNC Coordinate Systems

clinically. This is a crucial component of any practical treatment design and delivery
system.

4. Beam coordinate system


This system is fixed with respect to the collimator and has its origin at the radiation
source. With the machine in its rest position, this left-handed system is illustrated in
Figure 2, as viewed from the foot of the table:
xB axis is positive to the right.
yB axis is positive toward the back of the gantry.
zB axis is positive toward the isocenter.

The left-handed system is consistent with a popular convention for viewing


transformations in computer graphics, and is the convenient coordinate system for
describing the Beam’s Eye View (BEV) later in the document.
Another advantage of this system is that the zB coordinate for any point on the central ray
is also its distance from the source. The use of the source as the coordinate origin
obviates (for most purposes) the need to track machine SAD (Source-to-Axis-Distance)
as a separate datum.

5. Angles
The sense of the table, gantry, and collimator rotations, as illustrated in Figure 3, are as
follows:

-zB

θc

θg

zM
yP

θt
Figure 3. The three machine rotations are defined as counterclockwise with respect to positive axes of
corresponding coordinate systems. The table angle (θt) is counterclockwise around yM. It is zero when
the table longitudinal axis is parallel to the zM axis and the foot of the table is away from the gantry.
The gantry angle (θg) is counterclockwise around zM. It is zero when the head is straight up as
illustrated. The collimator angle (θc) is counterclockwise around –zB. It is zero when the collimator is
at the center of its excursion.

January 2006 5 of 17
PLanUNC Coordinate Systems

Table angle (θt) is the counterclockwise angle of the +zP axis with its rest position as
viewed from +yP. When viewed from the rest position of the table’s foot, a positive table
rotation causes the table foot to move to the right.
In comparison to the “ideal” machine’s sense of table rotation, for an actual treatment
machine, if a positive table rotation is related to the table foot moving to the left, this
machine is deemed to have a negative sense in table rotation.
Gantry angle (θg) is the counterclockwise angle of the beam central axis with the vertical
at the isocenter as viewed from the +zM axis. When viewed from the rest position of the
table’s foot, a positive gantry rotation causes the gantry head to move to the left.
In comparison to the “ideal” machine’s sense of gantry rotation, for an actual treatment
machine, if a positive gantry rotation is related to the head moving to the right, this
machine is deemed to have a negative sense in gantry rotation.
Collimator angle (θc) is the counterclockwise angle of +yB with its rest position as viewed
from –zB axis. If an actual machine considers a positive Collimator angle in the opposite
direction, it is deemed to have a negative sense in collimator rotation.
PLUNC is supplied with a Siemens machine that has:
gantry_sense = -1
table_sense = -1
collimator_sense = 1

6. Unit coordinate system


Like the Beam system, the Unit system is also fixed with respect to the collimator. This
right-handed system, as illustrated in Figure 4, can be obtained from the Beam system by
shifting the origin from the source to the isocenter, and taking the xB axis as the xU axis,
the -zB axis as the yU axis, and the -yB axis as the zU axis.

yB

xB
zB
yU
xU

zU

Figure 4. The Unit coordinate system is a right-handed system centered at the isocenter and fixed
with respect to the collimator.

January 2006 6 of 17
PLanUNC Coordinate Systems

7. Filter coordinate system


This system is fixed with respect to the filter itself. A filter, be it a wedge or a custom
compensator, is defined as a collection of prisms in PLUNC. The decision was made that
prisms are defined as polygons in x-y and translated along z, since this is the easiest way
to describe a wedge with prisms.
As illustrated in Figure 5 for an exemplary wedge,
xF axis is positive towards the thin end of the polygon.
yF axis is positive towards the base plate.
zF axis is perpendicular to xF and yF, and forms a right-handed system.

The origin of the system is at the center of the filter’s xF and zF dimensions, and the
border between the base plate and the wedge in its yF dimension.

yF yF

xF
zF
zF xF

yF xF

zF

Figure 5. The Filter coordinate system for an exemplary wedge is a right-handed system centered at
the center in the x and z dimensions and the border between the base plate and the wedge in the y
dimension.
The Filter system can also be considered fixed with respect to the collimator since filters
generally are attached to and rotate with the collimator. Definite transformation matrices
are used to relate the filters from their own definition systems to the Beam system.
See the filter files in the MACHINES directory for the various wedges and the
transformation matrices associated with them when they are used in different orientations
in the treatment units. It needs to be pointed out that, due to the symmetrical nature of a
wedge along the zF axis, either a right-handed or a left-handed Filter system is acceptable
in PLUNC for a specific wedge orientation.
For a custom compensator in PLUNC, yF is chosen to be anti-parallel to zB, xF is anti-
parallel to xB , and zF is anti-parallel to yB. The origin of this left-handed system, after
transformed to the Beam system, is on the beam’s central axis at the distance where the
wedge slot is. The transformation matrix of the custom compensator is provided in the
filter file of each unit.

January 2006 7 of 17
PLanUNC Coordinate Systems

8. Grid coordinate system


The 3D Grid system is fixed with respect to the Patient system, and has the same origin
and axes as the Patient system does. So the Grid-to-Patient or the Patient-to-Grid
transformation matrix is an identity matrix.
The 3D grid has step-size of 0.5 cm in all three dimensions, and it starts and ends just one
step beyond the extent of all anastructs.
See src/xvsim/gi.cxx for alloc_ana_stuff() function that constructs the 3D dose grid, and
see src/dose/libphoton/compute_dose.cxx for compute_dose() function that fills the 3D
dose grid.
The 2D Grid is a cross-section of the 3D Grid for the view plane chosen by the user for
the main view of the xplandisp window. The defintion of this view is described later in
this document in Section 12. The 2D grid also has 0.5 cm step-size in its two dimensions.
See the following related functions for the computation of the 2D dose grid:
xv_options_cb() in src/libplandisp/xv_options.cxx, xv_knob_cb() in src/libplandisp
/xv_knob_cb.cxx, new_grid_slicer() in src/libplan/grid_slicer.cxx, and
compute_partial_dose_2d() and compute_z_view_doses() in
src/libplandisp/xplandisp.cxx.

9. Image/Pixel coordinate system


This system is fixed with respect to the image scan, where
xI is 0-indexed, and positive to the right of the image.
yI is 0-indexed, and positive to the bottom of the image.
The origin (xI = 0 and yI = 0) is the upper left pixel of the image.

Each scan is given a z-position in the Patient system, and the scans are sorted in the
ascending order of this parameter.

Scans are conceived as being collections of samples. Each pixel has a corresponding size
in cm, and the size of the imaged area in each dimension is the total number of pixels
minus 1 multiplied by the pixel-size in that dimension.
To establish the Image/Pixel to Patient transformation, the following conventions are
adopted:
xP = 0 correlates to xI = (xdimension -1)/2.0. For a scan with an even number of pixels, xI
has a fractional part of 0.5. For instance, the xP = 0 is found in a 256 x 256 image at xI
=127.5, which is midway between pixels 127 and 128.
"table_height" is defined as the number of pixels above the bottom of the image that the
top of the table is seen. yP = 0 is at table-top in the Patient system, which correlates to
yI = (ydimension -1- table_height). For example, if the table height for a 256 x 256 image
is 25, yP = 0 occurs at yI = 230.0.
The zP = 0 can have any fractional pixel value since it is not constrained to lie in a sample
plane.

January 2006 8 of 17
PLanUNC Coordinate Systems

In case of scans viewed always from the foot of the table, no matter whether the patient is
feet-first or head-first, supine or prone, xI always maps directly to xP and yI always maps
inversely to yP, both with a scaling factor of the pixel-size.
In case of scans viewed always from the feet of the patient in the image, for a head-first
patient, supine or prone, xI maps directly to xP and yI maps inversely to yP, both with a
scaling factor of the pixel-size. In contrast, for a feet-first patient, supine or prone, both xI
and yI map inversely to xP and yP, respectively, also with the scaling factor of the pixel-
size.
The program dicom converts patient images from dicom format to the plan_im format
used in PLUNC. See src/plan_im/dicom2plan_im.cxx for the construction of
pixel_to_pat_TM matrix.

10. Registered Subimage coordinate system


This system is defined in the same way as the Image/Pixel coordinate system is, but with
respect to the scans of the registered subimage. A transformation matrix that contains the
amount of translation and rotation is used to associate the registered subimage to the base
image in the Patient system. See its formation in src/libplandisp/xplandisp.cxx and
xv_knob_cb.cxx.

11. View coordinate systems used in Anastruct Editor


The anastruct editor of PLUNC uses three kinds of cross-sectional views (transverse,
sagittal, and coronal views) to display image scans, anastruct contours, and beam
outlines. These are planes that are normal to the Patient system’s z axis, x axis, and y axis,
respectively. As illustrated in Figure 6, each view type is associated with a 2D
coordination system with its origin at the intersection of the three planes, and its axes
aligned with the two Patient system axes parallel with the view plane.
The transverse view is oriented to look at the patient from the foot of the table, resulting
in the positive xP axis pointing to the viewer’s right and the positive yP axis pointing up.
The sagittal view has the positive zP axis pointing to the viewer’s right and the positive yP
axis pointing up, as if the viewer looks along the positive xP axis.
The coronal view has the positive xP axis pointing to the viewer’s right and the negative
zP axis pointing up, as if the viewer looks down at the patient from above along the -yP
axis.

January 2006 9 of 17
PLanUNC Coordinate Systems

Aligned with +yP

Aligned with +xP

Intersection of the three view planes

Transverse View

Aligned with +yP Aligned with -zP

Aligned with +zP Aligned with +xP

Sagittal View Coronal View

Figure 6. View coordinate systems used in Anastruct Editor are 2D systems centered at the
intersection of the view planes and fixed with respect to the selected image scans.
See src/libana_edit/image_draw.cxx for routines that transform and draw the anastructs
and beams, and those that draw the images.

12. View coordinate systems used in xplandisp


Three mutually orthogonal view planes, namely the main view, xview, and yview, in the
Patient system are used in xplandisp to display parallel projections of images and the
interested treatment planning objects. The point where the three planes intersect is the
origin of the 3D space, as well as the origin of the 2D coordinate system associated with
each view. The x axis, in each view, points to the right, and the y axis points up.
Associated with the view is a scalar value determining where along the plane-normal
coordinate axis the view plane is located in Patient system.
Once the main view coordinate system is chosen for the Patient system, the xview
coordinate system is always formed by looking towards the +xmv axis and mapping the xxv
axis directly to the –zmv axis and yxv axis directly to the ymv axis. Similarly, the yview
coordinate system is always formed by looking towards the +ymv axis and mapping the xyv
axis directly to the xmv axis and the yyv axis directly to the -zmv axis.
The main view, whose distances to the nearer and farther depth clipping planes are set to
be 0, is equivalent to a cross-sectional view. It is used to show image scans (one slice at a
time by shifting the origin to different zmv) and the projected outline of the other treatment
planning objects, including the beams, anastructs, compensators, points, and isodose

January 2006 10 of 17
PLanUNC Coordinate Systems

curves. The xview and yview have a predefined and finite distances to the clipping planes.
They are used to show the projected outline of beams, anastructs, compensators, and
points.
Illustrated in Figure 7 are the three standard views predefined for the main view that
correspond to the transverse, sagittal, and coronal view of the Patient system. The
corresponding xview and yview are also illustrated.
Transverse view of the Saggital view of the Coronal view of the
Patient system in the Patient system in the Patient system in the
main view of xplandisp main view of xplandisp main view of xplandisp
ymv (+yP ) ymv (+yP ) ymv (-zP )

main view
(mv)
xmv (+xP ) xmv (-zP ) xmv (+xP )

zmv (+zP ) zmv (+xP ) zmv (+yP )

yxv (+yP ) yxv (+yP ) yxv (-zP )

xview
(xv)

xxv (-zP ) xxv (-xP ) xxv (-yP )

zxv (+xP ) zxv (-zP ) zxv (+xP )

yyv (-zP ) yyv (-xP ) yyv (-yP )

yview
(yv)

xyv (+xP ) xyv (-zP ) xyv (+xP )

zyv (+yP ) zyv (+yP ) zyv (-zP )

Figure 7. Three predefined orthogonal views for the main view of xplandisp and the corresponding
views in xview and yview of xplandisp.
The transverse view of the Patient system as viewed in the main view has the +xP axis
being the +xmv axis, the +yP axis being the +ymv axis, and slices are ordered from small zP
to large zP.

January 2006 11 of 17
PLanUNC Coordinate Systems

The sagittal view has the -zP axis being the +xmv axis, the +yP axis being the +ymv axis, and
slices are ordered from small xP to large xP.
The coronal view has the +xP axis to be the +xmv axis, the -zP axis to be the +ymv axis, and
slices are ordered from small yP to large yP.
The origin of the main view can be set at any point in the Patient system by selecting the
right scan containing that point and placing that point at the origin of the xmv and ymv axis.
The positive rotation of main view are defined as the xmv and ymv axes rotates
counterclockwise viewed from the +zmv axis. This is equivalent to clockwise rotation of
the objects in the view while the axes stay in place. The rotation alters the orientation of
the xmv and ymv axes with respect to the Patient system, and therefore provides a new view
plane for the xview and yview as defined by the relationship described earlier.
The positive rotation of xview or yview is similarly defined. A combination of rotation in
any or all of the three views yields a view of the patient’s image and the treatment
planning objects from any desired direction and at any plane of the user’s choice.
Due to the fact that the rotation in 3D space is not a commutative operation, in order to
revert to the initial view after performing rotations (with or without translations) in
multiple views the operations must be carried out in the exact reverse order by the same
amount in the opposite direction.
See src/libplandisp/xplandisp.cxx for the functions that implement the construction of the
above mentioned views.

13. Beam’s-Eye-View (BEV), XVIEW, YVIEW, and FreeView of the BEAM


system
The BEV is the perspective projection view from the origin of the BEAM system to a
plane at the distance of SAD along the +zB axis. The center of the view plane is the
machine’s isocenter. The +xBEV axis, aligned with the +xB axis, points from the left to right
in the view plane. The +yBEV axis, aligned with the +yB axis, points from the bottom to the
top in the view plane. The BEV is used to display the digitally reconstructed radiograph
(DRR), beam intensity map, and/or the various treatment planning objects.
In addition to the BEV, two mutually orthogonal view planes are used in PLUNC to
display the parallel projection of the treatment planning objects in the xBEV or the yBEV
direction, respectively. The view that looks towards the +xBEV axis, denoted as XVIEW in
this document and PLUNC, has its center at the isocenter, the +xXVIEW is aligned with the
+yB axis, and the +yXVIEW is aligned with the -zB axis. The view that looks along the +yBEV
axis, denoted as YVIEW in this document and PLUNC, has its center at the isocenter, the
+xYVIEW is aligned with the +xB axis, and the +yYVIEW is aligned with the -zB axis. The
outline of beams, anastructs, and compensators, and the points are displayed in this two
views. Note that the current beam always points from the top to the bottom in the
XVIEW and YVIEW, along the +zB axis.
These three view systems are fixed with respect to the current beam of choice. Any
machine motion, namely the rotation of the gantry, the table, or the collimator, or the
lateral, longitudinal, or height shift of the table, that changes the relationship between the
Beam system and the Patient system will alter the content of the view. On the other hand,

January 2006 12 of 17
PLanUNC Coordinate Systems

a desired amount of rotation or displacement in the XVIEW or the YVIEW may require a
certain combination of gantry, table and collimator angles and the table height, latitudinal
and longitudinal positions that is not always obvious to the user. PLUNC automatically
determines the correct setting of the machine’s six degrees of freedom that corresponds to
the exact chosen views of the user’s.
FreeView also displays the parallel projection of the treatment planning objects, but it is
not entirely fixed with respect to the current beam. The center of the view is at the
isocenter, the +yFreeView axis, which is aligned with the +yB axis, points up and the +xFreeView
axis points to the right on the screen. The normal of this view plane rotates
counterclockwise around the -yB axis to allow the viewing of the treatment planning
objects from different directions perpendicular to yB. When the normal is at 0°, FreeView
displays the same view as the BEV, but in parallel projection.
See src/xvsim/Fl_View_Window.cxx for compute_view_matrix() function and other
functions for construction of the above mentioned views.

14. Screen coordinate system


PLUNC uses the Screen coordinate system to show the objects in the various kinds of
views on the physical display console. This 2D system is measured in pixels rather than
in centimeters. The origin of this system is the upper left corner of the window. The +xS
axis points to the right and the +yS axis points down.
When displaying the various views mentioned above on the screen, the x axis of the
views maps directly to the xS axis and the y axis of the views maps inversely to the yS
axis. The position of the view’s origin in the Screen system determines which part of the
view will appear on the screen, and where.
See src/xvsim/Fl_View_Window.cxx for compute_view_matrix() function and
Fl_View_Window::draw() function and src/xplandisp/xplandisp.cxx for
compute_xplandisp_matrix() function for details of rendering the various views to the
screen.

15. Transformation operators


PLUNC uses an 1x4 vector to uniquely represent a point in a 3D or 2D coordinate
system.
A point in a 3D system is denoted as: P = [ P[ x] P[ y ] P[ z ] 1.0] , and a point in a 2D
system is denoted as: P = [ P[ x] P[ y ] 0.0 1.0] .
A 4x4 matrix is used to uniquely represent the relationship between two coordinate
systems. Only the first three columns are required for complete specification, but use of
the 4x4 matrix offers some computational advantages.
The translation operator [T(t)] where t[x], t[y], and t[z] are positive in the translation of
the objects in the positive direction of their corresponding axes in a coordinate system is
described as

January 2006 13 of 17
PLanUNC Coordinate Systems

 1.0 0.0 0.0 0.0


 0.0 1.0 0.0 0.0
[T (t )] =  .
 0.0 0.0 1.0 0.0
 
t[ x] t[ y ] t[ z ] 1.0 
A translation of the coordinate system is equivalent to a negative translation of the
objects in the system.
[ ]
The rotation operators [R x (θ )] , R y (θ ) , and [Rz (θ )] where θ is positive in the clockwise
rotation of the objects in a coordinate system are given by
1.0 0.0 0.0 0.0
0.0 cos θ − sin θ 0.0
[ R x (θ )] =  ,
0.0 sin θ cos θ 0.0
 
0.0 0.0 0.0 1.0 

 cos θ 0.0 sin θ 0.0


 0.0 1.0 0.0 0.0
[ R y (θ )] =  ,
− sin θ 0.0 cos θ 0.0
 
 0.0 0.0 0.0 1.0 

cos θ − sin θ 0.0 0.0


 sin θ cos θ 0.0 0.0
[ R z (θ )] =  .
 0.0 0.0 1.0 0.0
 
 0.0 0.0 0.0 1.0 
A counterclockwise rotation of a coordinate system is equivalent to a clockwise rotation
of the objects in the coordinate system.
The scale operator [S(s)] is described as
 s[ x] 0.0 0.0 0.0
 0.0 s[ y ] 0.0 0.0
[ S ( s )] =  .
 0.0 0.0 s[ z ] 0.0
 
 0.0 0.0 0.0 1.0 
See Support/lib3d/update_mat.cxx for matrix operations mentioned in this section.

16. Construction of a matrix from machine settings


The desired treatment geometry is conventionally provided in terms of the required
gantry angle, collimator angle, table kickout angle, and the table height, latitudinal
position, and longitudinal position. In the computer-based systems for treatment
geometry management, an alternative approach is to specify the patient/beam geometry
primarily as a transformation matrix that gives the coordinates of a point in the beam in
Patient coordinates [BP] or coordinates of a point in the patient in Beam coordinates

January 2006 14 of 17
PLanUNC Coordinate Systems

[PB]. Since [PB] is the inverse of [BP], specification of either is sufficient. These
matrices uniquely contain the information of the machine settings.
The construction of a Beam to Patient transform from machine settings involves a
straightforward concatenation of the three translations and three rotations as follows.
(1) Form the transformation matrix representing translation along the three Patient
system axis. This places the Beam coordinate origin at the isocenter in Patient
coordinates, IP.
 1 .0 0 .0 0 .0 0 .0 
 0 .0 1 .0 0 .0 0.0
[M 0 ] = 
 0 .0 0 .0 1 .0 0 .0 
 
 − I P [ x ] − I P [ y ] − I P [ z ] 1 .0  .
(2) Represent table angle as a counterclockwise rotation of the patient around the +y axis:
[ M 1 ] = [ M 0 ][ R y (−θ t )]
.
(3) Represent gantry angle as a counterclockwise rotation of the coordinate system
around the +z axis:
[ M 2 ] = [ M 1 ][ R z (θ g )]
.
(4) Represent collimator angle as an additional counterclockwise rotation of the
coordinate system around its +y axis:
[ M 3 ] = [ M 2 ][ R y (θ c )]
.
(Note that this completes the transformation from Patient to Unit coordinates.)

(5) Complete the transformation to Beam coordinates.

This involves translating the origin from the isocenter to the source position, rotating
to properly orient the y and z axes, and scaling the z axis by -1 to achieve the left-
handed Beam system:
 π 
[ PB] = [ M 3 ][T ([0.0 − SAD 0.0] R x (− )[ S ([1.0 1.0 − 1.0])]
 2  .
(6) Form the Beam to Patient transform by inverting the Patient to Beam transform:
[ BP] = [ PB] −1 .

See src/xvsim/reconcile.cxx for semi_reconcile() function in BEAM_TO_TM mode for


the above mentioned operations.

17. Derivation of machine settings from a matrix


The information contained in the [BP] matrix, with a few restricting assumptions, is
sufficient to derive the machine setup instructions following the method described below.
Computation of the table positions is equivalent to computing the position of the
isocenter in Patient coordinates (IP):
I P = [0.0 0.0 SAD 1.0][BP ] .

January 2006 15 of 17
PLanUNC Coordinate Systems

Computation of table and gantry angles (θt and θg of Figure 8) begins with computation
of the source position in Patient coordinates. This is accomplished by transformation of
the Beam coordinate origin to Patient coordinates:
S P = [0.0 0.0 0.0 1.0][BP ] .

yP
yP'

source(SP)
θg
xP
isocenter(I P)
xP'
θt

zP'
zP

Figure 8. This figure demonstrates the decomposition of a vector from the isocenter to the source (IS)
in Patient coordinates. The gantry angle is the angle between IS and the translated yP axis, yP΄. The
table angle is the angle between the projection of IS onto the xP΄- zP΄ plane and the translated xP axis,
xP΄. In the figure, θg is approximately -45° and θt is approximately 45°.

The vector from IP to SP can be projected onto a plane parallel to the xP-zP plane, the
xP΄-zP΄ plane. The table angle is computed as the angle which the ray from
[I P [ x]I P [ y]I P [ z ]] to [S P [ x]I P [ y ]I P [ z ]] makes with the line through IP and parallel to the
xP axis, xP΄. The gantry angle is computed as the angle which the ray from IP to SP makes
with the vertical line through IP and parallel to the yP axis, yP΄.
For most positions of the radiation source with respect to the isocenter, there are exactly
two possible combinations of table and gantry rotations. The solution can be forced to be
unique by the quite reasonable limitation of table angle to ±90°.
When the gantry is straight up and down, i.e., θg is 0° or ±180°, the collimator position is
uniquely defined only if the table angle is chosen first. In these positions, coincident
rotation of the table and collimator through the same (magnitude) angle will result in the
same [BP]. In general, the computation of the collimator angle goes as follows:

(1) Compute a partial Beam to Patient transform, [BPpart] from the five machine positions
just determined (that is, assuming θc is 0°). This is done following the method
described in Section 16.
(2) Form a vector along the x axis of the collimator in Beam coordinates and transform it
to Patient coordinates using [BPpart].
(3) Transform the vector back to beam coordinates using the current [PB].
(4) Compute θc as the angle between the original vector and the computed one.

January 2006 16 of 17
PLanUNC Coordinate Systems

See src/xvsim/reconcile.cxx for semi_reconcile() function in TM_TO_BEAM mode for


the above mentioned operations.

18. References
G. W. Sherouse, “Coordinate transformation as a primary representation of radiotherapy
beam geometry,” Med. Phys. 19(1), 175-179, (1992)
G. W. Sherouse, “Reply to Comments by Ladyka and Dickof on “Coordinate
transformation as a primary representation of radiotherapy beam geometry” by G. W.
Sherouse [Med. Phys. 19(1), 175-179 (1992)],” Med. Phys. 20(3), 651-652, (1993)

January 2006 17 of 17

You might also like