rescale¶
-
seas.video.rescale(array: numpy.ndarray, low: float = 3, high: float = 7, cap: bool = True, mean_std: Optional[Tuple[float, float]] = None, mask: Optional[numpy.ndarray] = None, maskval: float = 1, verbose: bool = True, min_max: Optional[bool] = None, return_scale: bool = False) → Tuple[numpy.ndarray, dict][source]¶ determine upper and lower limits of colormap for playing movie files. limits based on standard deviation from mean. low, high are defined in terms of standard deviation. Image is updated in-place, and doesn’t have to be returned.
- Parameters
array – The array to rescale.
low – The number of standard deviations below to scale the range to.
high – The number of standard deviations above to scale the range to.
cap – If the dynamic range would be reduced, instead cap range to the minimum/maximum values present within the array.
mean_std – Use a given mean and standard deviation to apply the transformation, rather than gathering from the video.
mask – A mask to apply to the video when calculating the min/max range to scale by.
maskval – The value of the mask to include as signal.
verbose – Whether to print a verbose output.
min_max – Apply a specific min/max as the range, rather than calculating dyamically.
return_scale – Whether to return the resize scale which was applied.
- Returns
- The rescaled array.
The original array should be updated in place as well.
- scale: A dictionary containing all the scaling parameters.
Only returned if return_scale = True.
- Return type
array