| vol.regrid | R Documentation | 
The vol.regrid function transforms the grid of a volume
according to the grid of another.
vol.regrid(
  vol,
  back.vol,
  T.MAT = NULL,
  interpolate = TRUE,
  method = c("NN", "Av"),
  alias = "",
  description = NULL,
  verbose = TRUE
)
| vol | "volume" class object to regrid. | 
| back.vol | "volume" class object whose grid will be used for regriding.
Its  | 
| T.MAT | "t.mat" class object, created by
load.patient.from.dicom, load.patient.from.Rdcm,
load.T.MAT or ref.add. If  | 
| interpolate | Boolean, default to  | 
| method | method of interpolation, defaulted to 'NN' ie 'Nearest Neighbor'. See Details. | 
| alias | Character string,  | 
| description | Character string, describing the the created object.
If  | 
| verbose | Boolean. if  | 
The interpolation method is chosen from:
'NN': the value of a voxel is calculated from its nearest adajcent neighbors.
'Av': the value of a voxel is the weighted average of
the voxels contained in a box, whose sides are automatically calculated from
the back.bol$dxyz steps.
Returns a copy of vol, in which grid is that of back.vol.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.