Module qute.preprocess
Preprocessing functions.
Functions
def extract_fft_stats(image_list: list) ‑> tuple-
Returns global min and max values for the real and imaginary parts of the Fourier transforms of all images.
Parameters
image_list:list- List of paths for the intensity TIFF images.
Returns
mean_real: global mean of all real parts from all Fourier transforms. std_real: global std of all real parts from all Fourier transforms. mean_imag: global mean of all imaginary parts from all Fourier transforms. std_imag: global std of all imaginary parts from all Fourier transforms.
def extract_intensity_stats(image_list: list, mask_list: list, fg_classes: Optional[list] = None, low_perc: float = 0.5, high_perc: float = 99.5) ‑> tuple-
Returns min, max, low and high percentile of intensities over foreground classes.
Parameters
image_list:list- List of paths for the intensity TIFF images.
mask_list:list- List of paths for the mask TIFF images. Importantly, label image at index i must correspond to intensity image at index i.
fg_classes:Optional[list[int]]- List of foreground classes to be considered to extract the intensities to process. If omitted, all classes but 0 (background) will be used.
low_perc:Optional[float]- Low percentile. Default 0.5
high_perc:Optional[float]- High percentile. Default 99.5
Please note: the image lists are supposed to be sorted so that the
ithelement of one list matches theithelement of the other.Returns
mean:global mean foreground intensitystd:global standard deviationofthe foreground intensitiesp_low:low percentileofall foreground intensitiesp_high:high percentileofall foreground intensities
def extract_median_object_size(label_list: list) ‑> tuple[float, float, float]-
Returns the median size of all labels.
Parameters
label_list:list- List of paths for the label TIFF images.
Returns
mn:float- Min size of all objects.
med:float- Median size of all labels.
mx:float- Max size of all labels.