Login  Register

Re: ROI Manager count=0 although ROI Manager has ROIs

Posted by Martin Höhne on Sep 25, 2015; 5:00pm
URL: http://imagej.273.s1.nabble.com/ROI-Manager-count-0-although-ROI-Manager-has-ROIs-tp5014427p5014468.html

Thanks Romain and Emanuele for the solution.
 
Wayne Rasband suggeted the same solution via Email. Moreover it turned out that there was a bug that is fixed in the latest ImageJ daily build (1.5015)

Here is what I learned from Wayne - might be interesting for others as well:
If the ROI Manager is not open, batch mode macros use an invisible ROI Manager that is deleted when batch mode is exited.
In my macro this invisible ROI Manager was still running when I opened a second (visible) ROI Manager. And this should not have been possible (and is changed with the daily build: ROI Manager cannot be opened when the invisible batch mode ROI Manager is already active). What happened in my macro was obviously, that the second Analyze Particles command populated the visible ROI Manager, while the roiManager("Count") command counted ROIs in the invisible ROI Manager. And that caused quite some confusion.

Martin