index_to_grid-methods: Convert 1d indices to n-dimensional grid coordinates

index_to_gridR Documentation

Convert 1d indices to n-dimensional grid coordinates

Description

Convert 1d indices to n-dimensional grid coordinates

Usage

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


 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. 3, 2024, 9:31 a.m.