dist_to_diam#

omnipose.core.dist_to_diam(dt_pos, n)[source]#

Convert positive distance field values to a mean diameter.

Parameters
  • dt_pos (1D array, float) -- array of positive distance field values

  • n (int) -- dimension of volume. dt_pos is always 1D because only the positive values int he distance field are passed in.

Returns

mean diameter -- a single number that corresponds to the diameter of the N-sphere when dt_pos for a sphere is given to the function, holds constant for extending rods of uniform width, much better than the diameter of a circle of equivalent area for estimating the short-axis dimensions of objects

Return type

float