bin.from.roi {espadon}R Documentation

Creation of a binary volume according to RoI

Description

The bin.from.roi function creates a "volume" class object, of "binary" modality, in which all the voxels of a RoI are set to TRUE.

Usage

bin.from.roi(
  vol,
  struct,
  roi.name = NULL,
  roi.sname = NULL,
  roi.idx = NULL,
  T.MAT = NULL,
  within = TRUE,
  alias = "",
  description = NULL
)

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 or set to NULL.

within

Boolean, defaults to TRUE. If within = TRUE, the contours included in a RoI are managed, depending on their $level field. If within = FALSE, only the $level = 0 fields of the RoI are used (i.e. only the external outlines).

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 struct$roi.info$roi.pseudo[roi.idx].

Details

roi.name, roi.sname, and roi.idx must select only one RoI.

Value

Returns a "volume" class object of "binary" modality (see espadon.class for class definitions), with the same grid as vol, in which the voxels in the RoI are set to TRUE.

See Also

bin.from.vol.

Examples

# loading of toy-patient objects (decrease dxyz for better result)
step <- 3
patient <- toy.load.patient (modality = c("ct", "rtstruct"), 
                             roi.name =  c("eye", "optical nerve", "brain"), 
                             dxyz = rep (step, 3))
CT <- patient$ct[[1]]
S <- patient$rtstruct[[1]]

# "optical nerve" binary without inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical", 
                     alias = "left_optical_nerve")
display.plane (CT, top = bin, struct = S,
               view.coord = S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz, 
               legend.shift = -80, interpolate = FALSE, main = "Left nerve selection")

## Not run: 
# with a smaller step
step <- 1
patient <- toy.load.patient (modality = c("ct", "rtstruct"), 
                             roi.name =  c("eye", "optical nerve", "brain"), 
                             dxyz = rep (step, 3))
CT <- patient$ct[[1]]
S <- patient$rtstruct[[1]]

# "optical nerve" binary without inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical", 
                     alias = "left_optical_nerve", within = FALSE)
display.plane (CT, top = bin, struct = S,
               view.coord = S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz, 
               legend.shift = -80, interpolate = FALSE, main = "Left nerve selection")

# "optical nerve" binary with inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical", 
                     alias = "left_optical_nerve", within = TRUE)
display.plane (CT, top = bin, struct = S,
               view.coord = S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz, 
               legend.shift = -80, interpolate = FALSE, main = "Left nerve selection") 

## End(Not run)

[Package espadon version 1.2.0 Index]