fafbseg.flywire.supervoxels_to_roots#

fafbseg.flywire.supervoxels_to_roots(x, timestamp=None, batch_size=10000, stop_layer=10, retry=True, progress=True, *, dataset=None)[source]#

Get root(s) for given supervoxel(s).

Parameters:
  • x (int | list of int) – Supervoxel ID(s) to find the root(s) for. Also works for e.g. L2 IDs.

  • 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 materialization. You can also use e.g. “mat_438” to get the root ID at a specific materialization.

  • batch_size (int) – Max number of supervoxel IDs per query. Reduce batch size if you experience time outs.

  • stop_layer (int) – Set e.g. to 2 to get L2 IDs instead of root IDs.

  • retry (bool) – Whether to retry if a batched query fails.

  • progress (bool) – If True, show progress bar.

  • dataset ("public" | "production" | "sandbox", optional) – Against which FlyWire dataset to query. If None will fall back to the default dataset (see set_default_dataset()).

Returns:

roots – Roots corresponding to supervoxels in x.

Return type:

numpy array

Examples

>>> from fafbseg import flywire
>>> flywire.supervoxels_to_roots(78321855915861142)
array([720575940594028562])