#snippets
Sign in Subscribe

Hot pixel-filtering

Last updated on  Jun 15, 2021

How to filter hot pixels as implemented in the IMC Segmentation Pipeline

def filter_hot_pixels(img, thres):
    kernel = np.ones((1, 3, 3), dtype=np.uint8)
    kernel[0, 1, 1] = 0
    max_neighbor_img = maximum_filter(img, footprint=kernel, mode='mirror')
    return np.where(img - max_neighbor_img > thres, max_neighbor_img, img)
Previous Animations using ffmpeg
Next OME-TIFF channel names
#snippets © 2025
Powered by Ghost