Skip to contents

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

Usage

grid_to_index(x, coords)

# S4 method for NeuroSlice,matrix
grid_to_index(x, coords)

# S4 method for NeuroSlice,numeric
grid_to_index(x, coords)

# S4 method for NeuroSpace,matrix
grid_to_index(x, coords)

# S4 method for NeuroSpace,numeric
grid_to_index(x, coords)

# S4 method for NeuroVol,matrix
grid_to_index(x, coords)

# S4 method for NeuroVol,numeric
grid_to_index(x, coords)

Arguments

x

the object, typically a NeuroVol or NeuroSpace instance.

coords

a matrix where each row is a coordinate or a vector of length equal to ndim(x)

Value

a vector of indices