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 struct object. By default roi.name = NULL. See Details.

roi.sname

Vector of names or parts of names of the RoI in the struct object. By default roi.sname = NULL. See Details.

roi.idx

Vector of indices of the RoI that belong to the struct object. By default roi.idx = NULL. See Details.

T.MAT

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

alias

Character string, $alias of the created object.

description

Character string, describing the created object. If description = NULL (default value), it will be set to paste (struct$object.alias,"clustering")

verbose

Boolean. if TRUE (default), the RoI studied are listed.

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

get.roi.connection

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)


[Package espadon version 1.6.0 Index]