nesting.cube {espadon} | R Documentation |
Restriction of a volume to a rectangular parallelepiped
Description
The nesting.cube
function restricts or increases
a volume to the rectangular parallelepiped defined by its 2 extreme vertices.
Usage
nesting.cube(obj, pt.min, pt.max, alias = "", description = NULL, ...)
Arguments
obj |
object of class volume or mesh. |
pt.min |
minimum x, y, z coordinates of the rectangular parallelepiped vertex. |
pt.max |
maximum x, y, z coordinates of the rectangular parallelepiped vertex. |
alias |
Character string, |
description |
Character string, describing the the created object. If
the |
... |
Additional arguments |
Value
Returns a "volume" class object, in which 3D volume is restricted
or increased to be circumscribed to the requested rectangular parallelepiped.
If the created volume exceeds the initial volume, new voxels are set to NA
.
See Also
add.margin, nesting.roi and nesting.bin.
Examples
# loading of toy-patient objects (decrease dxyz for better result)
step <- 5
patient <- toy.load.patient (modality = "ct", roi.name = "",
dxyz = rep (step, 3))
CT <- patient$ct[[1]]
# Calculation of the new CT restricted to the parallelepiped reduced by 10 mm.
pt.CT <- get.extreme.pt (CT) # extreme points of CT
new.pt.CT <- pt.CT + matrix (rep (c (+ 12, -12), 3), ncol = 2, byrow = TRUE)
new.CT <- nesting.cube (CT, new.pt.CT$min, new.pt.CT$max, alias = "new CT")
## Not run:
# check for change
display.3D.stack (CT)
display.3D.stack (new.CT, line.col="red")
## End(Not run)