normalize99#

omnipose.utils.normalize99(Y, lower=0.01, upper=99.99, contrast_limits=None, dim=None)[source]#

normalize array/tensor so 0.0 is 0.01st percentile and 1.0 is 99.99th percentile Upper and lower percentile ranges configurable.

Parameters
  • Y (ndarray/tensor, float) -- Input array/tensor.

  • upper (float) -- upper percentile above which pixels are sent to 1.0

  • lower (float) -- lower percentile below which pixels are sent to 0.0

  • contrast_limits (list, float (optional, override computation)) -- list of two floats, lower and upper contrast limits

Return type

normalized array/tensor with a minimum of 0 and maximum of 1