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_map
ArrayLike The segmentation map, where each pixel value indicates the ID of the object to which that pixel belongs.
- seg_id
int The ID of the object to find.
- padding
int, optional The extra padding to add to the object boundaries, by default 50.
- equal_ratiobool,
optiona Force the slice to be a square.
- seg_map
- Returns:
tupleThe indices of the object in the array.