Learn R Programming

neuroim (version 0.0.6)

indexToCoord: Generic function to convert 1D indices to N-dimensional real world coordinates

Description

Generic function to convert 1D indices to N-dimensional real world coordinates

Usage

indexToCoord(x, idx)
"indexToCoord"(x, idx)
"indexToCoord"(x, idx)

Arguments

x
the object
idx
the 1D indices

Value

a matrix of real 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 <- indexToCoord(bvol, idx)
idx2 <- coordToIndex(bvol, g)
all.equal(idx, idx2)

Run the code above in your browser using DataLab