dvid.utils.check_skeleton

dvid.utils.check_skeleton(bodyid, sample=False, node=None, server=None)[source]

Test if skeleton is up-to-date.

This works by getting the distance to the closest mesh voxel and skeleton node for each skeleton node and mesh voxel, respectively. The function returns the difference of the mean between skeleton->mesh and mesh->skeleton distances. A negative difference means the skeleton is missing branches, a positive difference indicates the skeleton having too many branches (e.g. if the mesh has been split).

For large neurons, this can be costly. Use the sample parameter to speed up calculations.

Parameters
  • bodyid (int | str) – ID of body for which to check the skeleton.

  • sample (float | int | None, optional) – Use to restrict number of voxels/nodes used to compare mesh and skeleton. If float, must be between 0 and 1 and will use random fraction. If int and >1, will shuffle and cap number of voxels/nodes.

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

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

Returns

  • float – Difference of the mean between skeleton->mesh and mesh->skeleton distances. A negative difference means the skeleton is missing branches, a positive differene indicates the skeleton having too many branches (e.g. if the mesh has been split).

  • None – If no skeleton available.