| nesting.roi | R Documentation | 
The nesting.roi function restricts a "volume" class
object to the rectangular parallelepiped circumscribed to the chosen RoI.
nesting.roi(
  obj,
  struct,
  roi.name = NULL,
  roi.sname = NULL,
  roi.idx = NULL,
  xyz.margin = c(0, 0, 0),
  obj.restrict = FALSE,
  T.MAT = NULL,
  alias = "",
  description = NULL,
  ...
)
| obj | object of class volume or mesh. | 
| struct | "struct" class object. | 
| roi.name | Vector of exact names of the RoI in the  | 
| roi.sname | Names or parts of names of the RoI in the  | 
| roi.idx | Index of the RoI that belong to the  | 
| 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). | 
| obj.restrict | Boolean. Used if  | 
| T.MAT | "t.mat" class object, created by
load.patient.from.dicom, load.patient.from.Rdcm
or load.T.MAT. If  | 
| alias | Character string,  | 
| description | Character string, describing the the created object.
If  | 
| ... | Additional arguments such as  | 
If roi.name, roi.sname, and roi.idx are all set
to NULL, all RoI are selected.
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.
add.margin, nesting.cube and nesting.bin.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.