Learn R Programming

espadon (version 1.11.3)

vol.from.bin: Volume class object according to binary selection

Description

The vol.from.bin function selects a part of a "volume" class object of "binary" modality which has the same grid. It is especially useful to restrict voxel data in region of interest.

Usage

vol.from.bin(vol, sel.bin, alias = "", description = NULL)

Value

Returns a "volume" class object (see espadon.class

for class definitions), in which non-selected voxels have the value NA, and selected voxels have the original value of vol.

Arguments

vol

"volume" class object, containing data to restrict.

sel.bin

"volume" class object, of "binary" modality. vol and sel.bin must have the same grid.

alias

Character string, $alias of the created object

description

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

Examples

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

# select the brain in the volume
bin.brain <- bin.from.roi (vol = CT, struct = S, roi.name = "brain",
                           verbose = FALSE)
vol.brain <- vol.from.bin (CT, bin.brain)
# display at the center of gravity of the brain Gz
Gz <- S$roi.info [grep("^brain", S$roi.info$roi.pseudo),]$Gz
display.plane (bottom = vol.brain, view.coord = Gz, struct = S,
               roi.sname = "brain", bg = "#00ff00", interpolate = FALSE)

Run the code above in your browser using DataLab