index_to_grid-methods: Generic function to convert 1D indices to N-dimensional grid...

Description Usage Arguments Value Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
index_to_grid(x, idx)

## S4 method for signature 'NeuroSlice,numeric'
index_to_grid(x, idx)

## S4 method for signature 'NeuroSpace,numeric'
index_to_grid(x, idx)

## S4 method for signature 'NeuroVec,index'
index_to_grid(x, idx)

## S4 method for signature 'NeuroVec,integer'
index_to_grid(x, idx)

## S4 method for signature 'NeuroVol,index'
index_to_grid(x, idx)

## S4 method for signature 'NeuroVol,integer'
index_to_grid(x, idx)

Arguments

x

the object

idx

the 1D vector of indices

Value

a matrix of grid coordinates

Examples

1
2
3
4
 bvol <- NeuroVol(array(0, c(10,10,10)), NeuroSpace(c(10,10,10), c(1,1,1)))
 idx <- 1:10
 g <- index_to_grid(bvol, idx)
 bvol[g]

bbuchsbaum/neuroim2 documentation built on Nov. 14, 2019, 7:01 a.m.