add.margin | R Documentation |
The add.margin
function adds or subtracts a margin of the
rectangular parallelepiped circumscribed by a volume.
add.margin(vol, xyz.margin, alias = "", description = NULL)
vol |
"volume" class object. |
xyz.margin |
Vector of the 3 positive or negative x, y and z margins in mm, in the frame of reference of volume cutting planes. |
alias |
Character string, |
description |
Character string, describing the created object.
If |
Returns a "volume" class object (see espadon.class
for class definitions), in which 3D volume is restricted or increased by the
requested margins.
If the created volume exceeds the initial volume, new voxels are set to NA
.
nesting.cube, nesting.roi and nesting.bin.
# loading of toy-patient objects (decrease dxyz for better result)
step <- 4
patient <- toy.load.patient (modality = "ct", roi.name = "",
dxyz = rep (step, 3))
CT <- patient$ct[[1]]
# Calculation of new volumes decreased by 10 mm in all directions.
new.CT <- add.margin (CT, xyz.margin = c (-10, -10, 10), alias = "new CT")
# display of the CT before and after, in the middle cutting plane
z.mid <- apply (get.extreme.pt (CT), 1, mean)[3]
display.plane (bottom = CT, view.coord = z.mid, bottom.col = pal.RVV(1000),
bg = "#00ffff", interpolate = FALSE)
display.plane (bottom = new.CT, view.coord = z.mid, bottom.col = pal.RVV(1000),
bg = "#00ffff", interpolate = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.