fafbseg.flywire.get_voxels#

fafbseg.flywire.get_voxels(x, mip=0, sv_map=False, bounds=None, thin=False, progress=True, use_mirror=True, threads=4, *, dataset=None)[source]#

Fetch voxels making a up given root ID.

Parameters:
  • x (int) – A single root ID.

  • mip (int) – Scale at which to fetch voxels. For example, mip=0 is at 16 x 16 x 40nm resolution. Every subsequent mip halves the resolution.

  • sv_map (bool) – If True, additionally return a map with the L2 ID for each voxel.

  • bounds ((3, 2) or (2, 3) array, optional) – Bounding box to return voxels in. Expected to be in 4, 4, 40 voxel space.

  • thin (bool) – If True, will remove voxels at the interface of adjacent supervoxels that are not supposed to be connected according to the L2 graph. This is rather expensive but can help in situations where a neuron self-touches.

  • use_mirror (bool) – If True (default), will use an mirror of the base segmentation for supervoxel look-up. Possibly slightly slower than the production dataset but doesn’t incur egress charges for Princeton.

  • threads (int) – Number of parallel threads to use for fetching the data.

  • progress (bool) – Whether to show a progress bar or not.

  • 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()).

Returns:

  • voxels ((N, 3) np.ndarray) – In voxel space according to mip.

  • sv_map ((N, ) np.ndarray) – Supervoxel ID for each voxel. Only if sv_map=True.