def __init__(self, image=[[0.0]], min_size=64, **options): from skimage import morphology import numpy as np self.a = np.array(image, dtype=bool) for sl1 in range(self.a.shape[2]): self.a[:, :, sl1] = morphology.remove_small_objects( self.a[:, :, sl1], min_size, **options)
def __init__(self, image=[[0.0]], area_threshold=64, **options): from skimage import morphology import numpy as np self.a = np.array(image, dtype=bool) for sl1 in range(self.a.shape[2]): self.a[:, :, sl1] = morphology.remove_small_holes( self.a[:, :, sl1], area_threshold, connectivity=connectivity, in_place=in_place)
def __init__(self, image=[[0.0]], **options): from skimage.morphology import black_tophat import numpy as np self.bt = black_tophat(np.array(image), **options)
def __init__(self, image=[[0.0]], **options): from skimage.morphology import dilation import numpy as np self.dilated = dilation(np.array(image), **options)
def __init__(self, image=[[0.0]], **options): from skimage.morphology import erosion import numpy as np self.eroded = erosion(np.array(image), **options)
def image_cln(self: 'array_float'): return np.array(self.a, dtype=float)
def __init__(self, image=[[0.0]], **options): from skimage.morphology import closing import numpy as np self.cl = closing(np.array(image), **options)