indexToCoord-methods: Generic function to convert 1D indices to N-dimensional real...

Description Usage Arguments Value Examples

Description

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

Usage

1
2
3
4
5
6
7
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

1
2
3
4
5
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)

neuroim documentation built on May 2, 2019, 1:04 p.m.