nesting.bin {espadon} | R Documentation |
Restrict volume to a binary selection
Description
The nesting.bin
function restricts a "volume" class
object to the rectangular parallelepiped circumscribed to the selected voxels.
Usage
nesting.bin(
vol,
sel.bin,
alias = "",
description = NULL,
xyz.margin = c(0, 0, 0),
vol.restrict = FALSE
)
Arguments
vol |
"volume" class object, containing data to restrict. |
sel.bin |
"volume" class object, of "binary" modality, specifying the selected voxels. |
alias |
Character string, |
description |
Character string, describing the the created object.
If |
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 voxels selected in |
vol.restrict |
Boolean. If |
Value
Returns a "volume" class object, in which 3D volume is limited to the
rectangular parallelepiped circumscribed to the voxels selected by sel.bin
, increased by the
requested margins.
See Also
add.margin, nesting.cube and nesting.roi.
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]]
b <- bin.from.vol (CT, min = 0, max =200)
CT.restricted <- nesting.bin (CT, b, xyz.margin = rep (step, 3))
display.plane (bottom = CT.restricted, top = b, view.type = "sagi",
bottom.col = pal.RVV (1000),
bottom.breaks = seq (-1000, 1000, length.out = 1001),
bg = "#00ff00", interpolate = FALSE)