vol.sum: Sum of 2 volumes

View source: R/vol_sum.R

vol.sumR Documentation

Sum of 2 volumes

Description

The vol.sum function adds two "volume" class objects of the same grid and of the same modality.

Usage

vol.sum(vol1, vol2, alias = "", description = NULL)

Arguments

vol1, vol2

"volume" class objects. The 2 volumes must have the same modality, and the same grid (i.e. share the same position of the voxels).

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 (vol1$object.alias, "+", vol2$object.alias).

Value

Returns a "volume" class object (see espadon.class for class definitions), with the same grid and modality as vol1 and vol2, sum of vol1 and vol2.

Examples

# loading of toy-patient objects (decrease dxyz and increase beam.nb for 
# better result)
step <- 5
pat<- toy.load.patient(modality = c ("rtdose"), dxyz = rep(step, 3),
                       beam.nb = 3)

# Double dose
D <- vol.sum(pat$rtdose[[1]], pat$rtdose[[1]])
pat$rtdose[[1]]$max.pixel
D$max.pixel

espadon documentation built on May 8, 2026, 9:07 a.m.