get.value.from.xyz {espadon}R Documentation

Voxel values on a selection of points

Description

The get.value.from.xyz function calculates the voxel values at the x, y, z coordinate points in the chosen frame of reference.

Usage

get.value.from.xyz(
  xyz,
  vol,
  xyz.ref.pseudo = NULL,
  T.MAT = NULL,
  interpolate = TRUE,
  verbose = FALSE
)

Arguments

xyz

Vector of length 3, corresponding to the x, y, z coordinates (in mm) of a point in xyz.ref.pseudo frame of reference, or 3-column matrix of x, y, z coordinates of several points.

vol

"volume" class object.

xyz.ref.pseudo

ref.pseudo in which the xyz coordinate points are given. This ref.pseudo must exist in the T.MAT list. If ref.pseudo is NULL then the point with coordinates xyz is considered to be in the patient frame of reference vol$ref.pseudo.

T.MAT

"t.mat" class object, created by load.patient.from.Rdcm, load.patient.from.dicom or load.T.MAT. If T.MAT = NULL, xyz.ref.pseudo must be equal to vol$ref.pseudo or NULL.

interpolate

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

verbose

Boolean, default to FALSE. If verbose = TRUE, then the xyz coordinates are printed.

Value

Returns a vector of the voxel values at the requested coordinates.

See Also

get.xyz.from.index

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]]
get.value.from.xyz (xyz = matrix (c (0, 0, 0, 10, 10, 10), 
                    ncol = 3, byrow = TRUE), vol = D)

# isodose
Dmax <- max (D$vol3D.data, na.rm = TRUE)
idx <- which (D$vol3D.data >= (Dmax -1) & D$vol3D.data <= (Dmax - 0.3))
pt <- get.xyz.from.index (idx, D)
get.value.from.xyz (pt, vol = D, interpolate = FALSE, verbose = TRUE)

[Package espadon version 1.2.0 Index]