Learn R Programming

espadon (version 1.11.3)

bin.erosion: Binary volume erosion

Description

The bin.erosion function decreases a "volume" class object, of "binary" modality, by means of convolution with a sphere. Erosion is useful for :

  • removing volumes that are smaller than the radius,

  • eliminating narrow capes,

  • enlarging channels,

  • turning peninsulas into islands.

Usage

bin.erosion(vol, radius = 10, alias = "", description = NULL)

Value

Returns a "volume" class object of "binary" modality (see espadon.class for class definitions), with the same grid as vol, in which the selected volume has been reduced by the radius.

Arguments

vol

"volume" class object, of "binary" modality

radius

Positive number, or xyz-vector of 3 positive numbers. By default, radius = 10.

alias

Character string, $object.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, "erosion r =", radius).

See Also

bin.dilation, bin.opening, bin.closing, add.margin, nesting.cube.

Examples

Run this code
# loading of toy-patient objects (decrease dxyz for better result)
step <- 4
patient <- toy.load.patient (modality = "mr", roi.name = "", 
                             dxyz = rep (step, 3))
MR <- patient$mr[[1]]

# generation of a binary volume
b <- bin.from.vol(MR, min = 15,max = 30)

b.erosion <- bin.erosion (b, radius = step)
display.plane (bottom = MR, top = b, main = "Before erosion", 
               view.coord = -20, interpolate = FALSE)
display.plane (bottom = MR, top = b.erosion, main = "After erosion", 
               view.coord = -20, interpolate = FALSE)

Run the code above in your browser using DataLab