Functions usage
Parse Image
To parse tiffiles into numpy arrays you can use the ImageParser.parse_image() function:
If your tiffiles are not stacks but page based tiffs:
Lastly, if you want to extract the channel names from the pages of TIFF use ImageParser.parse_image_pages_namesCH() function.
Preprocessing Image
In this pipeline there are two main preprocessing functions: saturation of outliers and the normalization.
To saturate outliers you can use: .. autofunction:: ImagePreprocessFilters.remove_outliers
To normalize, PENGUIN uses:
Thresholding
Thresholding allows to discard background signals, essentially removing signals of low intensity (already normalized).
To do this, the most straightforward approach is thresholding based on the pixel value, where pixel values below this threshold are set to 0.
Other thresholding techniques are also available:
Percentile Filter
In median filters, the center pixel is substituted with the median of the ranked values from its surrounding pixels. They excel in dealing with impulse noise, as such noise usually ranks at the extreme ends of the brightness scale. Percentile filters, akin to median filters, adjust pixel values based on a range of percentiles rather than solely the median (50th percentile). Different markers may benefit from different values of noise reduction, as they may display more or less shot noise.
To apply percentile filter to each channel:
If you want to apply the hybrid median filter, you can check this implementation:
Save Images
Lastly, to save the denoised images one can use ImagePreprocessFilters.save_images() to multitiffs:
To save as multipage tiffs with page names as metadata:
And to save the channel names as page names use: