PLUNC Coordinate Systems
PLUNC Coordinate Systems
PLUNC Coordinate Systems
Table of Content
January 2006
PLanUNC Coordinate Systems
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.
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.
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.
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
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
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
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.
January 2006 9 of 17
PLanUNC Coordinate Systems
Transverse 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.
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 )
xview
(xv)
yview
(yv)
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.
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.
January 2006 13 of 17
PLanUNC Coordinate Systems
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.)
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 .
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
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