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

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


from skimage import io
from skimage import filters

%matplotlib inline

Global Threshold - Example 1

In [3]:
image = io.imread("../images/nuclei-dapi.tif")
In [4]:
threshold = 54
print(threshold) 
binary = ~(image <= threshold)
54
In [5]:
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 [15]:
image = io.imread("../images/Lyuba-CT_350.tif")
In [6]:
threshold = 55
print(threshold) 
binary = ~(image <= threshold)
55
In [7]:
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 [ ]: