bin2cell.view_labels
- bin2cell.view_labels(image_path, labels_npz_path, crop=None, stardist_normalize=False, fill=False, border=True, fill_palette=None, fill_label_weight=0.5, border_color=[255, 255, 0])
Render segmentation results in a lightweight manner on a full image level. Can do fills or borders. Returns image as
np.array.Input
- image_path
filepath Path to image that was segmented.
- labels_npz_path
filepath Path to sparse labels generated by
b2c.stardist().- crop
Noneor tuple ofint, optional (default:None) A PIL-formatted crop specification - a four integer tuple, provided as (left, upper, right, lower) coordinates. If
None, will render full segmentation results.- stardist_normalize
bool, optional (default:False) If
True, percentile normalise the input image prior to rendering the segmentation labels on it.- fill
bool, optional (default:False) If
True, render the objects in full, with transparency controlled byfill_label_weight.- border
bool, optional (default,True) If
True, render a fully opaque border of a specified colour around the objects- fill_palette
Noneornp.arrayofnp.uint8, optional (default:None) Two-dimensional
np.array, with rows corresponding to colours of the palette and columns corresponding to RGB, innp.uint8. IfNone, will use Seaborn’s bright palette, skipping the pink due to it rendering poorly against H&E images. Objects will be coloured based on the remainder of dividing its label ID by the number of colours.- fill_label_weight
float, optional (default: 0.5) Weight to assign the object fill render when constructing output. 0 is completely transparent, 1 is completely opaque.
- border_color
listofnp.uint8, optional (default:[255, 255, 0]) Border colour in RGB.
- image_path