Visit the wiki pages to find some additional documentation and instructions on how view an interactive verson of these notebooks using binder.

In [2]:
%matplotlib inline
In [3]:
import math
import numpy as np
import matplotlib.pyplot as plt


from skimage import io
from skimage import filters
from skimage.transform import pyramid_laplacian
from skimage.filters import threshold_otsu

%matplotlib inline

Global Otsu Threshold - Example 1

In [4]:
image = io.imread("../images/nuclei-dapi.tif")
In [5]:
threshold = threshold_otsu(image)
print(threshold) 
binary = ~(image <= threshold)
33
In [6]:
fig, ax = plt.subplots(figsize=(10, 10))
plt.subplot(1,2,1)
plt.imshow(image, cmap='gray')
plt.subplot(1,2, 2)
plt.imshow(binary, cmap='gray')
plt.show()

Global Otsu Threshold - Example 2

In [7]:
image = io.imread("../images/Lyuba-CT_350.tif")
In [8]:
threshold = threshold_otsu(image)
print(threshold) 
binary = ~(image <= threshold)
45
In [9]:
fig, ax = plt.subplots(figsize=(10, 10))
plt.subplot(1,2,1)
plt.imshow(image, cmap='gray')
plt.subplot(1,2, 2)
plt.imshow(binary, cmap='gray')
plt.show()
In [ ]:
 
In [ ]: