dvid.fetch.get_roi¶
- dvid.fetch.get_roi(roi, step_size=2, form='MESH', save_to=None, server=None, node=None)[source]¶
Get ROI as mesh or voxels.
Uses marching cube algorithm to extract surface model of ROI voxels if no precomputed mesh available.
Note that some ROIs exist only as voxels or as mesh. If voxels are requested but not available, will raise “Bad Request” HttpError.
- Parameters
roi (str) – Name of ROI.
form ("MESH" | "VOXELS"| "BLOCKS", optional) – Returned format - see
Returns
.step_size (int, optional) – Step size for marching cube algorithm. Only relevant for
form="MESH"
. Smaller values = higher resolution but slower.save_to (filename) – If provided will also write mesh straight to file. Should end with .obj.
server (str, optional) – If not provided, will try reading from global.
node (str, optional) – If not provided, will try reading from global.
- Returns
mesh (trimesh.Trimesh) – If
format=='MESH'
. Coordinates in nm.voxels (numpy array) – If
format=='VOXELS'
.blocks (numpy array) – If
format=='BLOCKS'
. Encode blocks of voxels as 4 coordinates:[z, y, x_start, x_end]