View source: R/volvis_shells.R
| volume.subsample.matrix | R Documentation |
Subsampling a volume with a factor f keeps voxels 1, 1+f, 1+2f, ... of the original volume, so the coordinate i of the subsampled volume corresponds to the original 1-based R array index i*f + (1-f) (e.g., for f = 2: the subsampled voxels are the original voxels 1, 3, 5, ... and they stay at 1, 3, 5 of the original volume). This function returns the 4x4 affine matrix which implements this mapping. Note that it maps to 1-based R array indices, so it has to be composed with index2ras_tkr() (and not with vox2ras_tkr(), which expects 0-based CRS indices) to transform subsampled shells to surface RAS.
volume.subsample.matrix(factor = 1L)
factor |
positive integer, the subsampling factor. |
a 4x4 numerical matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.