Skip to content
Skip to search
1,139 bytes added
14:11, 19 June 2012
Adding areas to an AreaList by scanning pixel values in the slices of a stack
=== Extract areas from an arealist and put them as ROIs in ImageJ's ROI Manager ===
# Albert Cardona 2012-06-19
# Obtain an arealist and add all its areas as ROIs in the ROI Manager
from ini.trakem2.display import Display, AreaList
from ij.gui import ShapeRoi
from ij.plugin.frame import RoiManager
""" Obtain a valid instance of the ROI Manager.
Notice that it could still be null if its window is closed."""
if RoiManager.getInstance() is None:
""" Take all areas of an AreaList and put them in the ROI Manager."""
for layer in arealist.getLayerRange():
area = arealist.getAreaAt(layer)
if area is not None and not area.isEmpty():
roi = ShapeRoi(area)
front = Display.getFront()
layers = front.getLayerSet().getLayers()
arealists = front.getSelection().getSelected(AreaList)
IJ.log("No arealists selected!")
# Extract areas as ROIs for the first one:
← Older edit
Newer edit →
Retrieved from "
Set/change upload password