indexToCoord {neuroim}R Documentation

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)

## S4 method for signature 'BrainSpace,index'
indexToCoord(x, idx)

## S4 method for signature 'BrainVolume,index'
indexToCoord(x, idx)

Arguments

x

the object

idx

the 1D indices

Value

a matrix of real coordinates

Examples

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)

[Package neuroim version 0.0.6 Index]