darsia.bounding_box#

bounding_box(voxels, padding=0, max_size=None)[source]#

Determine bounding box for a set of given coordinates.

Parameters:
voxelsVoxelArray

Voxel array of size N x dim, using matrix indexing in 2d.

paddingint

Padding to create a slightly larger bounding box. Might be of interest if the area that is prescribed in coords cover slightly less than strictly needed. Default is 0.

max_sizelist or tuple, optional

Max size of bounding box in each dimension.

Returns:
tuple of slices

Slices with ranges from min to max value per dimension.