Skip to content

Instantly share code, notes, and snippets.

@emmanuelle
emmanuelle / skimage_3d_compatibility.py
Last active April 16, 2019 08:10
Inspect which functions of scikit-image are compatible with 3-D arrays.
import numpy as np
import inspect
from skimage import exposure, feature, filters, measure, morphology, \
restoration, segmentation, transform, util
def only_one_nondefault(args):
"""
Returns True if the function has only one non-keyword parameter,
False otherwise.
import numpy as np
from skimage import io, restoration
from skimage import img_as_float
from scipy import ndimage
def hysteresis_thresholding(im, high_threshold=0.5, low_threshold=0.2):
"""
Hysteresis thresholding, using two thresholds.
from skimage.segmentation import active_contour
from skimage import io, color, transform, filters, util
import numpy as np
import matplotlib.pyplot as plt
image = io.imread('statue.jpg')
print('Rescaling image...')
image = transform.rescale(image, 0.05)