dvid.fetch.get_sparsevol

dvid.fetch.get_sparsevol(bodyid, scale='COARSE', ret_type='INDEX', voxels=True, save_to=None, bbox=None, server=None, node=None)[source]

Fetch sparsevol (voxel) representation for given neuron.

Parameters
  • bodyid (int | str) – ID of body for which to download mesh.

  • scale (int | "COARSE", optional) – Resolution of sparse volume starting with 0 where each level beyond 0 has 1/2 resolution of previous level. “COARSE” will return the volume in block coordinates.

  • save_to (str | None, optional) – If provided, will save response from server as binary file.

  • ret_type ("INDEX" | "COORDS" | "RAW") – “INDEX” returns x/y/z indices. “COORDS” returns x/y/z coordinates. “RAW” will return server response as raw bytes.

  • voxels (bool) – If False, will return x/y/z/x_run_length instead of x/y/z voxels.

  • bbox (list | None, optional) – Bounding box to which to restrict the query to. Must be in scale=0 index coordinates. Format: [x_min, x_max, y_min, y_max, z_min, z_max].

  • server (str, optional) – If not provided, will try reading from global.

  • node (str, optional) – If not provided, will try reading from global.

Returns

  • voxels ((N, 3) np.array) – If voxels=True: array with x/y/z coordinates/indices

  • rles ((N, 4) np.array) – If voxels=False: array with x/y/z/x_run_length coordinates/indices.

  • raw (bytes string) – If ret_type='RAW': server response as raw bytes.