Processing images using SimpleITK#
See also
import numpy as np
from skimage.io import imread
import napari_simpleitk_image_processing as nsitk
import stackview
blobs = imread('https://samples.fiji.sc/blobs.png')
stackview.insight(blobs)
|
Median filter#
nsitk.median_filter(blobs, 5, 5, 0)
n-sitk made image
|
Gaussian blur#
nsitk.gaussian_blur(blobs, 10, 10, 0)
n-sitk made image
|
Edge enhancement / edge detection#
nsitk.laplacian_filter(blobs)
n-sitk made image
|
nsitk.laplacian_of_gaussian_filter(blobs, sigma=20)
n-sitk made image
|
nsitk.sobel(blobs)
n-sitk made image
|
nsitk.gradient_magnitude(blobs)
n-sitk made image
|
nsitk.morphological_gradient(blobs)
n-sitk made image
|
nsitk.standard_deviation_filter(blobs)
n-sitk made image
|
nsitk.canny_edge_detection(blobs)
n-sitk made image
|
Denoising#
nsitk.bilateral_filter(blobs, radius=10)
n-sitk made image
|
nsitk.binominal_blur_filter(blobs, repetitions=20)
n-sitk made image
|
nsitk.curvature_flow_denoise(blobs, number_of_iterations=150)
n-sitk made image
|
Deconvolution#
kernel = np.zeros((15, 15))
kernel[7,7] = 1
kernel = nsitk.gaussian_blur(kernel, variance_x=3, variance_y=3)
kernel
n-sitk made image
|
nsitk.richardson_lucy_deconvolution(blobs, kernel)
n-sitk made image
|
nsitk.wiener_deconvolution(blobs, kernel)
n-sitk made image
|
nsitk.tikhonov_deconvolution(blobs, kernel, regularization_constant=0.5)
n-sitk made image
|
Background / foreground removal#
nsitk.white_top_hat(blobs)
n-sitk made image
|
nsitk.black_top_hat(blobs)
n-sitk made image
|
nsitk.h_maxima(blobs, height=100)
n-sitk made image
|
nsitk.h_minima(blobs, height=100)
n-sitk made image
|
Other filters#
rescaled = nsitk.rescale_intensity(blobs)
print(rescaled.max())
rescaled
0.9999999999999999
n-sitk made image
|
nsitk.adaptive_histogram_equalization(blobs, radius_x=5, radius_y=5)
n-sitk made image
|
nsitk.invert_intensity(blobs)
n-sitk made image
|