seg_slice#

niriss_tools.pipeline.seg_slice(seg_map, seg_id, padding=50, equal_ratio=False)[source]#

Find the location of an object in a segmentation map.

Parameters:
seg_mapArrayLike

The segmentation map, where each pixel value indicates the ID of the object to which that pixel belongs.

seg_idint

The ID of the object to find.

paddingint, optional

The extra padding to add to the object boundaries, by default 50.

equal_ratiobool, optiona

Force the slice to be a square.

Returns:
tuple

The indices of the object in the array.