Learn R Programming

neuroim (version 0.0.6)

indexToGrid: Generic function to convert 1D indices to N-dimensional grid coordinates

Description

Generic function to convert 1D indices to N-dimensional grid coordinates

Usage

indexToGrid(x, idx)
"indexToGrid"(x, idx)
"indexToGrid"(x, idx)
"indexToGrid"(x, idx)
"indexToGrid"(x, idx)

Arguments

x
the object
idx
the 1D vector of indices

Value

a matrix of grid coordinates

Examples

Run this code
 
 bvol <- BrainVolume(array(0, c(10,10,10)), BrainSpace(c(10,10,10), c(1,1,1)))
 idx <- 1:10
 g <- indexToGrid(bvol, idx)
 bvol[g]

Run the code above in your browser using DataLab