fafbseg.flywire.locs_to_segments#

fafbseg.flywire.locs_to_segments(locs, timestamp=None, backend='spine', coordinates='voxel', *, dataset=None)[source]#

Retrieve FlyWire segment (i.e. root) IDs at given location(s).

Parameters:
  • locs (list-like | pandas.DataFrame) – Array of x/y/z coordinates. If DataFrame must contain ‘x’, ‘y’, ‘z’ or ‘fw.x’, ‘fw.y’, ‘fw.z’ columns. If both present, ‘fw.’ columns take precedence)!

  • timestamp (int | str | datetime | "mat", optional) – Get roots at given date (and time). Int must be unix timestamp. String must be ISO 8601 - e.g. ‘2021-11-15’. “mat” will use the timestamp of the most recent materalization. You can also use e.g. “mat_438” to get the root ID at a specific materialization.

  • backend ("spine" | "cloudvolume") – Which backend to use. Use “cloudvolume” only when spine doesn’t work because it’s terribly slow.

  • coordinates ("voxel" | "nm") – Units in which your coordinates are in. “voxel” is assumed to be 4x4x40 (x/y/z) nanometers.

  • dataset ("public" | "production" | "sandbox" | "flat_630", optional) – Against which FlyWire dataset to query. If None will fall back to the default dataset (see set_default_dataset()). Only relevant if root_ids=True.

Returns:

List of segmentation IDs in the same order as locs.

Return type:

numpy.array

See also

locs_to_supervoxels()

Takes locations and returns supervoxel IDs.

Examples

>>> from fafbseg import flywire
>>> # Fetch root IDs at two locations
>>> locs = [[133131, 55615, 3289], [132802, 55661, 3289]]
>>> flywire.locs_to_segments(locs)
array([720575940631693610, 720575940631693610])