Login  Register

Re: Can't save rois with RoiManager in plugin

Posted by Michael Schmid on Feb 26, 2010; 9:22am
URL: http://imagej.273.s1.nabble.com/Can-t-save-rois-with-RoiManager-in-plugin-tp3689085p3689090.html

Hi Adam,

most panels in ImageJ are "singletons", i.e., ImageJ has only one  
instance. It would be confusing for the user to see two ROI Managers  
or two "Brightness&Contrast" panels: which one is the correct one?
Plugins can create their own instances of some panels, including the  
ResultsTable, e.g. to avoid interfering with that of ImageJ (in that  
case, one should set a custom title, different from "Results").

ResultsTable.getResultsTable(), equivalent to Analyzer.getResultsTable
() should give you the one used by ImageJ.
Also the MaximumFinder uses ResultsTable.getResultsTable().

Michael
________________________________________________________________

On 26 Feb 2010, at 02:57, Adam wrote:

> ----- Original Message ----
>
>> maybe you have two instances of RoiManager, the "standard" one and  
>> the one
>> created as 'rm'?
>>
>> My solution would be
>>   RoiManager rm = RoiManager.getInstance();
>> after the particle analyzer has created a RoiManager.
>
> That worked, thank you!
>
> In general, do ImageJ classes make their own instances of other  
> classes that they need?
>
> Does MaximumFinder make its own ResultsTable instance, as well?  
> One of the options to MaximumFinder is 'COUNT' which says that it  
> it simply writes the number of maxima to ResultsTable.  I have not  
> been able to get this to work, either. I'm wondering if it is for a  
> similar reason.
>
> Adam