nesting.roi {espadon}R Documentation

Restrict volume to RoI

Description

The nesting.roi function restricts a "volume" class object to the rectangular parallelepiped circumscribed to the chosen RoI.

Usage

nesting.roi(
  vol,
  struct,
  roi.name = NULL,
  roi.sname = NULL,
  roi.idx = NULL,
  xyz.margin = c(0, 0, 0),
  vol.restrict = FALSE,
  T.MAT = NULL,
  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

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

roi.idx

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

xyz.margin

Vector of length 3, representing the distances in mm to be added to the x, y and z directions of the rectangular parallelepiped circumscribed to the chosen RoI, in the cutting planes frame of reference. By default xyz.margin = c (0, 0, 0).

vol.restrict

Boolean. If vol.restrict = TRUE, the rectangular parallelepiped circumscribed to the chosen RoI, enlarged by xyz.margin cannot exceed the initial volume.

T.MAT

"t.mat" class object, created by load.patient.from.dicom, 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 the created object. If description = NULL, it will be that of the vol.

Details

If roi.name, roi.sname, and roi.idx are all set to NULL, all RoI are selected.

Value

Returns a "volume" class object, in which 3D volume is limited to the rectangular parallelepiped circumscribed to the chosen RoI, increased by the requested margins.

See Also

add.margin, nesting.cube and nesting.bin.

Examples

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

CT.brain <- nesting.roi (CT, S, roi.sname = "brain")
CT.brain.with.margin <- nesting.roi (CT, S, roi.sname = "brain",
                                         xyz.margin = c (10,10,10))

# display at the center of gravity of the cerebellum Gz
Gz <- S$roi.info [grep("^brain",S$roi.info$roi.pseudo),]$Gz
display.plane (bottom = CT.brain, view.coord = Gz,
               struct = S, bottom.col = pal.RVV (1000),
               bottom.breaks = seq (-1000, 1000, length.out = 1001),
               bg = "#00ff00",  interpolate  = FALSE, legend.shift = -20)
display.plane (bottom = CT.brain.with.margin,view.coord = Gz,
               struct = S,  bottom.col = pal.RVV (1000),
               bottom.breaks = seq(-1000, 1000, length.out = 1001),
               bg = "#00ff00", interpolate  = FALSE, legend.shift = -20)

[Package espadon version 1.2.0 Index]