imctoolkit.utils¶
-
hot_pixel_filter(img, hot_pixel_thres, inplace=False)¶ Hot pixel filter as implemented in https://github.com/BodenmillerGroup/ImcPluginsCP
Sets all hot pixels to the maximum of their 8-neighborhood. Hot pixels are defined as pixels, whose values are larger by
hot_pixel_thresthan the maximum of their 8-neighborhood.
-
median_filter_cv2(img, size, inplace=False)¶ Fast median blur using OpenCV
-
gaussian_filter_cv2(img, size=0, sigma=0, inplace=False)¶ Fast Gaussian blur using OpenCV
- Parameters
- Return type
Union[ndarray,MultichannelImage]- Returns
the Gaussian-filtered image
-
rotate_centered_cv2(img, angle, border_mode=4, expand_bbox=False, inplace=False)¶ Fast centered image rotation using OpenCV
- Parameters
img¶ (
Union[ndarray,MultichannelImage]) – raw image data, shape:(c, y, x)angle¶ (
float) – rotation angle, in degreesborder_mode¶ (
int) – pixel extrapolation method, seecv2.warpAffine()expand_bbox¶ (
bool) – if set toTrue, the bounding box of the resulting image is expanded to contain the full rotated imageinplace¶ (
bool) – ifTrue, the image is modified in-place when possible
- Return type
Union[ndarray,MultichannelImage]- Returns
the image, rotated around its center