vol.regrid {espadon}R Documentation

Transform the grid of a volume class object into the grid of another

Description

The vol.regrid function transforms the grid of a volume according to the grid of another.

Usage

vol.regrid(
  vol,
  back.vol,
  T.MAT = NULL,
  interpolate = TRUE,
  alias = "",
  description = NULL,
  verbose = TRUE
)

Arguments

vol

"volume" class object to regrid.

back.vol

"volume" class object whose grid will be used for regriding. Its $ref.pseudo must exist in the T.MAT list.

T.MAT

"t.mat" class object, created by load.patient.from.dicom, load.patient.from.Rdcm, load.T.MAT or ref.add. If T.MAT = NULL, back.vol$ref.pseudo must be equal to vol$ref.pseudo.

interpolate

Boolean, default to TRUE. If interpolate = TRUE, a trilinear interpolation of the value of the voxels, relative to the values of adjacent voxels, is performed.

alias

Character string, $alias of the created object.

description

Character string, describing the the created object. If description = NULL, it will be that of vol.

verbose

Boolean. if TRUE (default) a progress bar is displayed.

Value

Returns a copy of vol, in which grid is that of back.vol.

Examples

# loading of toy-patient objects (decrease dxyz and increase beam.nb for 
# better result)
step <- 5
patient <- toy.load.patient (modality = c ("mr", "rtdose"), 
                             dxyz = rep (step, 3), beam.nb = 4)
MR <- patient$mr[[1]]
D <- patient$rtdose[[1]]

# change grid
D.on.MR <- vol.regrid (vol = D, back.vol = MR, interpolate = TRUE,
                       T.MAT = patient$T.MAT, alias = "",
                       description = NULL, verbose = FALSE)

# maximum dose location
max.dose.in.MR <- get.xyz.from.index (which.max (D.on.MR$vol3D.data), D.on.MR)
display.plane (bottom = MR, view.coord = max.dose.in.MR[3],
               top= D.on.MR, bottom.col = grey.colors(255, start = 0, end = 1),
               bottom.breaks = seq (0, 500, length.out = 256),
               bg = "#00ff00", interpolate = FALSE)

[Package espadon version 1.2.0 Index]