Skip to content

Instantly share code, notes, and snippets.

@erjel
Created April 20, 2020 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erjel/4ce35742340e1df80b21f14f4f984b3d to your computer and use it in GitHub Desktop.
Save erjel/4ce35742340e1df80b21f14f4f984b3d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
from tifffile import imread
# In[ ]:
im = imread()
# In[ ]:
im.shape
# In[ ]:
im = im[38, :, :]
# In[ ]:
import matplotlib.pyplot as plt
# In[ ]:
f , ax = plt.subplots(1, figsize=(15, 15))
ax.imshow(im)
# In[ ]:
f , ax = plt.subplots(1, figsize=(15, 15))
ax.imshow(im == -1)
# In[ ]:
from skimage.measure import regionprops
from skimage.measure import label
# In[ ]:
overlap_labeled = label(im == -1)
# In[ ]:
f , ax = plt.subplots(1, figsize=(15, 15))
ax.imshow(overlap_labeled)
# In[ ]:
import numpy as np
# In[ ]:
overlap_labels = np.unique(overlap_labeled)
# In[ ]:
overlap_labels
# In[ ]:
f , ax = plt.subplots(1, figsize=(15, 15))
ax.imshow(overlap_labeled == 1)
# In[ ]:
props[0].area
# In[ ]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment