blimp.processing.segment.segment_nuclei_cellpose

blimp.processing.segment.segment_nuclei_cellpose(intensity_image, nuclei_channel=0, pretrained_model=None, diameter=None, threshold=0, flow_threshold=0.4, normalize=True, gpu=False)[source]

Segment nuclei in 2D images across all timepoints using cellpose 4.

Parameters:
  • intensity_image (AICSImage) – intensity image in 5D format “TCZYX” where Z=1

  • nuclei_channel (int) – channel number corresponding to nuclear stain

  • pretrained_model (Union[str, Path, None]) – path to custom pretrained model, if None uses default “cpsam” model

  • diameter (Optional[int]) – estimated diameter of nuclei in pixels, if None cellpose estimates

  • threshold (float) – cellprob_threshold, float between [-6,+6] after which objects are discarded

  • flow_threshold (float) – flow error threshold for filtering masks

  • normalize (Union[bool, dict]) – normalization settings, can be bool or dict of parameters

  • gpu (bool) – whether to use GPU acceleration, by default False

Returns:

label image with segmented nuclei for all timepoints

Return type:

AICSImage

Raises:

ValueError – If input image has Z dimension > 1 (3D images not supported)