Re: Adding to the Roi Manager with a name

Posted by Stein Rørvik on
URL: http://imagej.273.s1.nabble.com/Adding-to-the-Roi-Manager-with-a-name-tp5015947p5015951.html

Ok, thanks!
This is short enough.

Stein

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rasband, Wayne (NIH/NIMH) [E]
Sent: 19. mars 2016 05:21
To: [hidden email]
Subject: Re: Adding to the Roi Manager with a name

> On Mar 18, 2016, at 11:24 PM, Stein Rørvik <[hidden email]> wrote:
>
> A suggestion for an improvement to the macro language:
>
> roiManager("Add") adds the current ROI. To set a name for that, you need to retrieve the index and use the rename command.
> It would be a lot simpler if the "Add" command just could have a second otional parameter "Name".
>
> The code could then be
>
> roiManager("Add", "MyRoiName");
>
> instead of the current equivalent
>
> roiManager("Add");
> i = roiManager("count");
> roiManager("select", i);
> roiManager("rename", "MyRoiName");

You can set the name of an ROI and add it to the ROI Manager with two lines of code:

  Roi.setName("MyRoiName");
  roiManager("Add");

-wayne
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html