bin.subtraction {espadon}R Documentation

Subtraction of two binaries

Description

The bin.subtraction function creates a "volume" class object of "binary" modality, representing the subtraction of two binary objects.

Usage

bin.subtraction(vol1, vol2, alias = "", description = NULL)

Arguments

vol1, vol2

"volume" class objects of "binary" modality.

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 (vol1$object.alias, "-", vol2$object.alias).

Value

Returns a "volume" class object of "binary" modality (see espadon.class for class definitions), with the same grid as vol1 and vol2, in which vol2 is subtracted from vol1.

Examples

# loading of toy-patient objects (decrease dxyz for better result)
step <- 4
patient <- toy.load.patient (modality = c("mr", "rtstruct"), roi.name = "", 
                             dxyz = rep (step, 3))
MR <- patient$mr[[1]]
S <- patient$rtstruct[[1]]

z.ptv <- S$roi.info$Gz[S$roi.info$roi.pseudo == "ptv"]

# binaries
bin.patient <- bin.from.roi (MR, struct = S, roi.name = "patient",
                           alias = "patient", T.MAT = patient$T.MAT)
bin.ptv <- bin.from.roi (MR, struct = S, roi.name = "ptv",
                           alias = "ptv", T.MAT = patient$T.MAT)

#' calculation of the 'patient - ptv' binary
bin <- bin.subtraction (bin.patient, bin.ptv, alias = "patient - ptv")
display.plane (MR, top = bin, view.coord = z.ptv, 
               display.ref = S$ref.pseudo, T.MAT = patient$T.MAT,
               interpolate = FALSE)

[Package espadon version 1.2.0 Index]