get.ijk.from.index {espadon} | R Documentation |
Conversion of the indices of a point into ijk vector
Description
The get.ijk.from.index
function converts the voxel indices
of vol$vol3D.data
(for example, obtained with the function which
)
into a vector or matrix of DICOM indices i, j, k.
Usage
get.ijk.from.index(idx, vol)
Arguments
idx |
Index, or matrix of voxel indices of the array |
vol |
"volume" class object. |
Value
Returns an i, j, k column matrix of the DICOM indices of the points
of vol$vol3D.data
.
See Also
get.value.from.ijk, display.kplane
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]]
# voxels location where the dose is greater than 99.9% Dmax
Dmax <- max (D$vol3D.data, na.rm = TRUE) # D$max.pixel
get.ijk.from.index (which (D$vol3D.data >= 0.999 * Dmax), D)
# or
get.ijk.from.index (which (D$vol3D.data >= 0.999 * Dmax, arr.ind = TRUE), D)
ijk <- as.numeric (get.ijk.from.index (which.max (D$vol3D.data), D))
display.kplane (D, k = ijk[3])
[Package espadon version 1.7.2 Index]