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, $alias of the created object.

description

Character string, describing the the created object. If description = NULL, it will be paste (vol$description,"restricted to", sel.bin$description).

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 sel.bin, 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 selected voxels, enlarged by xyz.margin cannot exceed the initial volume.

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)

[Package espadon version 1.6.0 Index]