masks_to_flows_gpu#

cellpose_omni.dynamics.masks_to_flows_gpu(masks, device=None)[source]#

convert masks to flows using diffusion from center pixel Center of masks where diffusion starts is defined using COM :param masks: labelled masks 0=NO masks; 1,2,...=mask labels :type masks: int, 2D or 3D array

Returns

  • mu (float, 3D or 4D array) -- flows in Y = mu[-2], flows in X = mu[-1]. if masks are 3D, flows in Z = mu[0].

  • mu_c (float, 2D or 3D array) -- for each pixel, the distance to the center of the mask in which it resides