Skip to contents

Convert xyz locations to root or supervoxel ids

Usage

fanc_xyz2id(
  xyz,
  rawcoords = FALSE,
  voxdims = c(4.3, 4.3, 45),
  root = TRUE,
  ...
)

Arguments

xyz

One or more xyz locations as an Nx3 matrix or in any form compatible with xyzmatrix including neuron or mesh3d surface objects.

rawcoords

whether the input values are raw voxel indices or in nm

voxdims

The voxel dimensions (in nm). See details.

root

Whether to return the root id of the whole segment rather than the supervoxel id.

...

additional arguments passed to pbapply when looking up multiple positions.

Value

A character vector of segment ids, NA when lookup fails.

Details

This used to be very slow because we do not have a supervoxel field on spine.

I am somewhat puzzled by the voxel dimensions for FANC. Neuroglancer clearly shows voxel coordinates of 4.3x4.3x45. But in this function, the voxel coordinates must be set to 4.25 in x-y to give the correct answers.

See also

flywire_xyz2id

Other fanc-ids: fanc_cellid_from_segid(), fanc_ids(), fanc_islatest(), fanc_latestid(), fanc_leaves(), fanc_rootid()

Examples

# a point from neuroglancer, should map to 648518346498932033
fanc_xyz2id(cbind(34495, 82783, 1954), rawcoords=TRUE)
#> [1] "648518346499897667"