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(
obj,
sel.bin,
alias = "",
description = NULL,
xyz.margin = c(0, 0, 0),
obj.restrict = FALSE,
...
)
Arguments
obj |
"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 |
Numeric vector of length 3, by default set to |
obj.restrict |
Boolean. Used if |
... |
Argument such as T.MAT, or for deprecated arguments |
Details
If obj
is of class "volume", xyz.margin
represents the
distances in mm to be added to the x, y and z directions of the rectangular
parallelepiped circumscribed to the voxels selected in sel.bin
, in the
obj
frame of reference.
If obj
is of class "mesh", sel.bin
will undergo margin
expansion any operation on the obj
.
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)