Skip to content

Instantly share code, notes, and snippets.

@jccaicedo
Last active March 10, 2021 17:47
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
# Example instructions to decode ground truth masks in BBBC039
# Masks available at: https://data.broadinstitute.org/bbbc/BBBC039/masks.zip
import skimage.io
import matplotlib.pyplot as plt
import skimage.morphology
# Load one image after uncompressing masks.zip
gt = skimage.io.imread("IXMtest_A02_s1_w1051DAA7C-7042-435F-99F0-1E847D9B42CB.png")
# Keep first channel only
gt = gt[:,:,0]
# Label independent connected components
gt = skimage.morphology.label(gt)
# Display image or use as needed
plt.imshow(gt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment