// This macro demonstrates the use of selection properties run("Blobs (25K)"); setAutoThreshold("Default"); roiManager("reset"); run("Analyze Particles...", "add"); resetThreshold(); roiManager("Show None"); // in this loop, we tag rois according to circularity // a better use case would be manual tagging with a toolset for (i=0;i 0.9) Roi.setProperty('roundish'); // value of "1" (true) is assumed if 2nd arg missing else Roi.setProperty('longish'); roiManager('update'); } // save the set of rois to a temp file, clear the roiManager, and reopen rois set roiManager('deselect'); path = getDirectory('temp')+'tmp.zip'; roiManager('save', path); roiManager("reset"); wait (1000); roiManager('open', path); // now we can use the tags for rois sorting array =selectROIS('roundish'); roiManager ('select', array); setForegroundColor(0,0,0); roiManager ('fill'); wait (1000); array =selectROIS('longish'); roiManager ('select', array); setForegroundColor(255,255,255); roiManager ('fill'); // this function returns a roimanager index array // of rois tagged with given keyword function selectROIS (keyword) { ids=newArray(0); for (i=0;i