If you have an image-like object and you want to turn it into a matrix of 3D coords then you need ind2coord. For the reverse operation we offer as.im3d.matrix which allows you to turn a matrix of 3D coordinates into an im3d image object.

ind2coord(inds, ...)

# S3 method for default
ind2coord(inds, dims, voxdims, origin, ...)

# S3 method for array
ind2coord(inds, voxdims = NULL, origin = NULL, ...)

# S3 method for im3d
ind2coord(inds, voxdims = NULL, origin = NULL, ...)

Arguments

inds

indices into an image array (either 1D, for which dims must be present, or a logical array).

...

extra arguments passed to methods.

dims

dimensions of 3D image array.

voxdims

vector of 3 voxel dimensions (width, height, depth).

origin

the origin.