struct.clustering {espadon} | R Documentation |
Clustering volumes by RoI
Description
The struct.clustering
function creates a new volume
in which voxels are clustered and labeled by region of interest defined in an
rt-struct.
Usage
struct.clustering(
vol,
struct,
roi.name = NULL,
roi.sname = NULL,
roi.idx = NULL,
T.MAT = NULL,
alias = "",
description = NULL,
verbose = TRUE
)
Arguments
vol |
"volume" class object. |
struct |
"struct" class object. |
roi.name |
Vector of exact names of the RoI in the |
roi.sname |
Vector of names or parts of names of the RoI in the |
roi.idx |
Vector of indices of the RoI that belong to the |
T.MAT |
"t.mat" class object, created by
load.patient.from.Rdcm or load.T.MAT. If
|
alias |
Character string, |
description |
Character string, describing the created object. If
|
verbose |
Boolean. if |
Details
If roi.name
, roi.sname
, and roi.idx
are
all set to NULL
, all RoI are selected.
Value
Returns a "volume" class object (see espadon.class
for class definitions), of "cluster"
modality. This object contains the
$cluster.info
field, detailing the label and volumes in \(cm^{3}\)
of the different clusters. Note that the label NA
or value 0 is used for the voxels
which are not contained in any RoI (air for instance).
See Also
Examples
# loading of toy-patient objects (decrease dxyz for better result)
step <- 5
patient <- toy.load.patient (modality = c ("mr", "rtstruct"),
dxyz = rep (step, 3))
MR <- patient$mr[[1]]
S <- patient$rtstruct[[1]]
cluster.vol <- struct.clustering (MR, S, T.MAT = patient$T.MAT, verbose = FALSE)
head (cluster.vol$cluster.info)
# Display
n = nrow(cluster.vol$cluster.info)
col = c ("#00000000", rainbow (n))
breaks <- seq (0, n, length.out = n+2)
display.plane (cluster.vol, main = "RoI clustering", view.coord = 0,
bottom.col = col, bottom.breaks = breaks, interpolate = FALSE)