Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate label image from rois in Fiji
#@ ImagePlus imp
#@ OUTPUT ImagePlus result
from ij import IJ
from ij.plugin.frame import RoiManager
result = IJ.createImage("Labeling", "16-bit black", imp.getWidth(), imp.getHeight(), 1)
ip = result.getProcessor()
rm = RoiManager.getInstance()
for index, roi in enumerate(rm.getRoisAsArray()):
ip.resetMinAndMax(), "glasbey inverted", "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment