Last active
December 3, 2023 03:13
-
-
Save jccaicedo/15e811722fca51e3ae90e8b43057f075 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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