follow_flows#

omnipose.core.follow_flows(dP, dist, inds, niter=None, interp=True, use_gpu=True, device=None, omni=True, suppress=False, calc_trace=False, verbose=False)[source]#

define pixels and run dynamics to recover masks in 2D

Pixels are meshgrid. Only pixels with non-zero cell-probability are used (as defined by inds)

Parameters
  • dP (float32, 3D or 4D array) -- flows [axis x Ly x Lx] or [axis x Lz x Ly x Lx]

  • inds (int, ND array) -- initial indices of pixels for the Euler integration

  • niter (int) -- number of iterations of dynamics to run

  • interp (bool) -- interpolate during dynamics

  • use_gpu (bool) -- use GPU to run interpolated dynamics (faster than CPU)

  • omni (bool) -- flag to enable Omnipose suppressed Euler integration etc.

  • calc_trace (bool) -- flag to store and retrun all pixel coordinates during Euler integration (slow)

Returns

  • p (float32, ND array) -- final locations of each pixel after dynamics

  • inds (int, ND array) -- initial indices of pixels for the Euler integration [npixels x ndim]

  • tr (float32, ND array) -- list of intermediate pixel coordinates for each step of the Euler integration