get.line {espadon}R Documentation

Image value along an axis


The get.line function calculates the value of the points of a volume vol along an axis in any direction.


  origin = c(0, 0, 0),
  orientation = c(1, 0, 0),
  grid = seq(-100, 100, 1),
  interpolate = TRUE



"volume" class object.


Vector of x, y, z coordinates belonging to the line to extract. If interpolate = FALSE, these coordinates are replaced by the coordinates of the voxel closest to origin.


Directing vector of the line in the vol frame of reference. This vector is internally normalized.


Vector, representing the curvilinear coordinates on the line to extract.


Boolean, default to TRUE. If interpolate = TRUE, a trilinear interpolation of the value of the voxels, relative to the values of adjacent voxels, is performed.


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", = "", 
                             dxyz = rep (step, 3), beam.nb = 3)
D <- patient$rtdose[[1]]

# Dose at maximum dose
origin <- (which.max (D$, 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 ()

[Package espadon version 1.4.1 Index]