fafbseg.google.locs_to_segments#

fafbseg.google.locs_to_segments(locs, mip=0, dataset='fafb-ffn1-20200412', coordinates='voxel')[source]#

Retrieve Google segmentation IDs at given location(s).

Uses a service on hosted services.itanna.io by Eric Perlman and Davi Bock.

Parameters:
  • locs (list-like) – Array of x/y/z coordinates.

  • mip (int [0-9]) – Scale to query. Lower mip = more precise but slower; higher mip = faster but less precise (small segments might not show at all at high mips).

  • dataset (str) – Currently, the only available dataset is “fafb-ffn1-20200412”, the most recent segmentation by Google.

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

Returns:

List of segmentation IDs in the same order as locs. Invalid locations will be returned with ID 0.

Return type:

numpy.array