get.line {espadon} | R Documentation |
The get.line
function calculates the value of the points
of a volume vol
along an axis in any direction.
get.line(
vol,
origin = c(0, 0, 0),
orientation = c(1, 0, 0),
grid = seq(-100, 100, 1),
interpolate = TRUE
)
vol |
"volume" class object. |
origin |
Vector of x, y, z coordinates belonging to the line to extract.
If |
orientation |
Directing vector of the line in the |
grid |
Vector, representing the curvilinear coordinates on the line to extract. |
interpolate |
Boolean, default to |
Returns a dataframe, composed of the columns $x
, $y
, $z
,
representing the coordinates of the points where the values are taken in
vol
volume, the column $s
representing the curvilinear abcissa,
and the column $value
representing values along $s
.
# loading of toy-patient objects (decrease dxyz and increase beam.nb for
# better result)
step <- 4
patient <- toy.load.patient (modality = "rtdose", roi.name = "",
dxyz = rep (step, 3), beam.nb = 3)
D <- patient$rtdose[[1]]
# Dose at maximum dose
origin <- get.xyz.from.index (which.max (D$vol3D.data), D)
display.plane (bottom = D, view.coord = origin[3],
bg = "#0000ff")
# Dose profile at x = origin[1] and z = origin[3].
l <- get.line (vol = D, origin = origin,
orientation = c (0, 1, 0), interpolate = FALSE)
plot (l$y, l$value, type = "l")
grid ()
# Dose profile at y = origin[2] and z = origin[3].
l <- get.line (D, origin = origin,
orientation = c (1, 0, 0), interpolate = FALSE)
plot (l$s, l$value, type = "l")
grid ()