get.line {espadon}R Documentation

Image value along an axis

Description

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

Usage

get.line(
  vol,
  origin = c(0, 0, 0),
  orientation = c(1, 0, 0),
  grid = seq(-100, 100, 1),
  interpolate = TRUE
)

Arguments

vol

"volume" class object.

origin

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.

orientation

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

grid

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

interpolate

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.

Value

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.

Examples

# 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 ()

[Package espadon version 1.6.0 Index]