add.shape: Adding shape to a 3D volume.

View source: R/add_shape.R

add.shapeR Documentation

Adding shape to a 3D volume.

Description

The add.shape function adds the shape defined by espadon volume object of the modality "binary" or "weight" to a 3D volume.

Usage

add.shape(obj, shape.bin, shape.mean, shape.sd)

Arguments

obj

Object of the "volume" class and a modality other than "binary" or "weight".

shape.bin

Object of the "volume" class and "binary" or "weight" modality, sharing the same voxels as obj..

shape.mean, shape.sd

Positive numbers, representing the mean value and the standard deviation of voxels identified by shape.bin.

Value

Returns the ‘volume’ class object obj, in which the voxels identified by shape.bin have been replaced by a linear interpolation between the initial value and new values. These new values follow a normal distribution with mean shape.mean and standard deviation shape.sd. The weights of the linear interpolation are defined by the voxels values of shape.bin.

See Also

bin.cuboid, bin.cylinder, bin.ellipsoid, bin.from.roi.

Examples

# Creation of a volume
CT <- vol.create (c(80, 80,40), c(1.2, 1.2, 2), 
                  pt000 = c(-50.4,-50.4,-75), modality = "ct", 
                  default.value = as.integer(-997), value.sd = 1)
# Creation of a new shape shape                
ellipsoid <- bin.ellipsoid(CT, center = c(-20.1, 0.1, -15), 
                           radius =  c(19.3, 20.2, 15.3))  
                           
# Incorporating form into the CT
CT <- add.shape (CT, shape.bin = ellipsoid, shape.mean = 100, shape.sd = 10)

plot(CT, view.coord =  c(-20.1, 0.1, -15))      

espadon documentation built on April 11, 2025, 5:57 p.m.