Roi problem : The list is empty

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Roi problem : The list is empty

Mohamed Tleis
Dear Folks,

I wrote some code , and I want to empty the ROI manager at a certain point.
My problem is that I am getting the following message while I am processing
a large set of images:

" The list is empty " and I have to press OK before I continue.

I checked my code, and found that the following part of the code is
printing "Ok 1 " then displays the message. That is strange because between
the 2 print statements I am checking the manager and only delete when it is
not empty

[code]
  System.out.println("Ok 1");
        if (manager != null)
            manager.runCommand("Delete");
        System.out.println("Ok 2");
[/code]
Reply | Threaded
Open this post in threaded view
|

Re: Roi problem : The list is empty

Olivier Burri
Dear Mohammed,
To empty the ROI manager the code:
manager.runCommand("Delete");

Only works if there are ROIs in it. In your case, because there are none, it gives you this message.

Technically what you want to do is reset the ROI manager, for this you can use:
manager.runCommand("Reset");

This will remove any ROIs previously present and will not prompt you if the ROI Manager is empty.

Best

Oli
Reply | Threaded
Open this post in threaded view
|

Re: Roi problem : The list is empty

Mohamed Tleis
Thank you Olivier, I will try it, and I think it will work :)

On Tue, Jan 10, 2012 at 3:03 PM, Olivier Burri <[hidden email]>wrote:

> Dear Mohammed,
> To empty the ROI manager the code:
> manager.runCommand("Delete");
>
> Only works if there are ROIs in it. In your case, because there are none,
> it gives you this message.
>
> Technically what you want to do is reset the ROI manager, for this you can
> use:
> manager.runCommand("Reset");
>
> This will remove any ROIs previously present and will not prompt you if
> the ROI Manager is empty.
>
> Best
>
> Oli
>