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

Conversion of the indices of a point, into xyz coordinate vector in the patient's frame of reference

Description

The get.xyz.from.index function converts the indices of a voxel of vol$vol3D.data (for example, obtained with the function which) into a vector or matrix of x, y, z coordinates in the patient's frame of reference.

Usage

get.xyz.from.index(idx, vol)

Arguments

idx

Index, or matrix of voxel indices in the array vol$vol3D.data. The first index of the array is 1.

vol

"volume" class object.

Value

Returns a column-matrix of coordinates in the patient's reference frame, corresponding to the indices idx.

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.xyz.from.index (which (D$vol3D.data >= 0.99 * Dmax), D)
# or
get.xyz.from.index (which (D$vol3D.data >= 0.99 * Dmax, arr.ind = TRUE), D)

[Package espadon version 1.6.0 Index]