Skip to content

API reference

cave_mapper.map_points(points, root_id, client, initial_distance=0, max_distance=4, verbose=False)

Map points in space to voxels and their corresponding supervoxels.

Parameters:

Name Type Description Default
points ndarray

Array of points in space to be mapped. Must be of shape (n_points, 3), and are assumed to be in coordinates of nanometers.

required
root_id int

The root id of the object to map to.

required
client CAVEclient

The CAVEclient object to use for mapping.

required
initial_distance int

The initial distance to search for a mapping. Default is 0. Units are in voxels.

0
max_distance int

The maximum distance to search for a mapping. Default is 4. Units are in voxels.

4
verbose

Whether to print progress messages.

False

Returns:

Type Description
DataFrame

A DataFrame containing the mapping information. The DataFrame will have the following columns:

  • query_pt_x, query_pt_y, query_pt_z: The original points in space.
  • voxel_pt_x, voxel_pt_y, voxel_pt_z: The corresponding voxel coordinates. Units are the same as client.chunkedgraph.base_resolution.
  • supervoxel_id: The supervoxel id of the corresponding voxel.
  • root_id: The root id of the object.
  • query_voxel_distance_nm: The distance from the original point to the closest voxel that is part of the object.

cave_mapper.map_points_via_mesh(points, root_id, client, max_distance=4, verbose=False)

Map points in space to a mesh and then to voxels and their corresponding supervoxels.

Parameters:

Name Type Description Default
points ndarray

Array of points in space to be mapped. Must be of shape (n_points, 3), and are assumed to be in coordinates of nanometers.

required
root_id int

The root id of the object to map to.

required
client CAVEclient

The CAVEclient object to use for mapping.

required
max_distance int

The maximum distance to search for a mapping. Default is 4. Units are in voxels.

4
verbose

Whether to print progress messages.

False

Returns:

Type Description
DataFrame

A DataFrame containing the mapping information. The DataFrame will have the following columns:

  • query_pt_x, query_pt_y, query_pt_z: The original points in space.
  • mesh_pt_x, mesh_pt_y, mesh_pt_z: The closest points on the mesh.
  • voxel_pt_x, voxel_pt_y, voxel_pt_z: The corresponding voxel coordinates. Units are the same as client.chunkedgraph.base_resolution.
  • supervoxel_id: The supervoxel id of the corresponding voxel.
  • root_id: The root id of the object.
  • query_mesh_distance_nm: The distance from the original point to the closest point on the mesh.
  • mesh_voxel_distance_nm: The distance from the closest point on the mesh to the corresponding voxel.