Macro Language | select all masks from ROI Manager

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

Macro Language | select all masks from ROI Manager

Rainer M. Engel
Hey everyone.

Playing around with selections I had difficulties selecting all masks
from ROI Manager in one step. De-selecting all is easy ;-(

I hope I haven't overlooked the obvious.

Best Regards,
Rainer

--
Rainer M. Engel, Dipl. Digital Artist
scientific|Media GbR
Pichelsdorfer Str. 143
13595 Berlin

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro Language | select all masks from ROI Manager

Krs5
Hi Rainer,

I had to think a moment about this but assuming you don't want to use "Show All" you could use the snipped below to select all items in the ROI manager:

array1 = newArray("0");;
for (i=1;i<roiManager("count");i++){
        array1 = Array.concat(array1,i);
        Array.print(array1);
}
roiManager("select", array1);

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Centre for Core Biotechnology Services
University of Leicester

http://www.le.ac.uk/biochem/microscopy/home.html



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rainer M. Engel
Sent: 06 August 2013 14:58
To: [hidden email]
Subject: Macro Language | select all masks from ROI Manager

Hey everyone.

Playing around with selections I had difficulties selecting all masks from ROI Manager in one step. De-selecting all is easy ;-(

I hope I haven't overlooked the obvious.

Best Regards,
Rainer

--
Rainer M. Engel, Dipl. Digital Artist
scientific|Media GbR
Pichelsdorfer Str. 143
13595 Berlin

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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro Language | select all masks from ROI Manager

Krs5
Obviously after deleting the "Array.print(array1)" line

Kees

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Straatman, Kees R. (Dr.)
Sent: 06 August 2013 15:59
To: [hidden email]
Subject: Re: Macro Language | select all masks from ROI Manager

Hi Rainer,

I had to think a moment about this but assuming you don't want to use "Show All" you could use the snipped below to select all items in the ROI manager:

array1 = newArray("0");;
for (i=1;i<roiManager("count");i++){
        array1 = Array.concat(array1,i);
        Array.print(array1);
}
roiManager("select", array1);

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Centre for Core Biotechnology Services
University of Leicester

http://www.le.ac.uk/biochem/microscopy/home.html



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rainer M. Engel
Sent: 06 August 2013 14:58
To: [hidden email]
Subject: Macro Language | select all masks from ROI Manager

Hey everyone.

Playing around with selections I had difficulties selecting all masks from ROI Manager in one step. De-selecting all is easy ;-(

I hope I haven't overlooked the obvious.

Best Regards,
Rainer

--
Rainer M. Engel, Dipl. Digital Artist
scientific|Media GbR
Pichelsdorfer Str. 143
13595 Berlin

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

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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro Language | select all masks from ROI Manager

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Rainer M. Engel
On Aug 6, 2013, at 9:57 AM, Rainer M. Engel wrote:

> Hey everyone.
>
> Playing around with selections I had difficulties selecting all masks
> from ROI Manager in one step. De-selecting all is easy ;-(


"Deselect" in the ROI Manager is the same as "select all" since all ROIs are processed if none are selected.

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro Language | select all masks from ROI Manager

gankaku
In reply to this post by Rainer M. Engel
Hi Rainer,

This might be the answer to your question:

count=roiManager("count");
array=newArray(count);
for(i=0; i<count;i++) {
        array[i] = i;
}
roiManager("Select", array);

-----------------------------------------------------------------
A further possibility to do operations on consecutive selections using the ROI manager would be:

{
 counts=roiManager("count");

 for(i=0; i<counts; i++) {
    roiManager("Select", i);
    run("....whatever you want to do with the selected item....");
 }
}


Hope this addresses your question and helps,
Kind regards,
Jan

P.S. if my last mail reached you forget about it, I didn't read your headline properly.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro Language | select all masks from ROI Manager

Rainer M. Engel
In reply to this post by Krs5
Thank you Kees, Jan and Wayne.

I was already trying something like that. But I got lost and now I know
why. I missed to hit..

roiManager("Combine");

..to be able, making a "global" enlarge of that combined mask.

roiManager("Select", 0);
run("Enlarge...", "enlarge=15"); -> enlarges that mask

roiManager("Select", newArray(0,1));
´run("Enlarge...", "enlarge=15"); -> only enlarges Mask 0

Same for selections of more ROIs. I forgot/missed to combine them first
and thought the selection process itself "failed".

Thanks again.

Rainer


Am 06.08.2013 17:02, schrieb Straatman, Kees R. (Dr.):

> Obviously after deleting the "Array.print(array1)" line
>
> Kees
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Straatman, Kees R. (Dr.)
> Sent: 06 August 2013 15:59
> To: [hidden email]
> Subject: Re: Macro Language | select all masks from ROI Manager
>
> Hi Rainer,
>
> I had to think a moment about this but assuming you don't want to use "Show All" you could use the snipped below to select all items in the ROI manager:
>
> array1 = newArray("0");;
> for (i=1;i<roiManager("count");i++){
> array1 = Array.concat(array1,i);
> Array.print(array1);
> }
> roiManager("select", array1);
>
> Best wishes
>
> Kees
>
>
> Dr Ir K.R. Straatman
> Senior Experimental Officer
> Centre for Core Biotechnology Services
> University of Leicester
>
> http://www.le.ac.uk/biochem/microscopy/home.html
>
>
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rainer M. Engel
> Sent: 06 August 2013 14:58
> To: [hidden email]
> Subject: Macro Language | select all masks from ROI Manager
>
> Hey everyone.
>
> Playing around with selections I had difficulties selecting all masks from ROI Manager in one step. De-selecting all is easy ;-(
>
> I hope I haven't overlooked the obvious.
>
> Best Regards,
> Rainer
>
> --
> Rainer M. Engel, Dipl. Digital Artist
> scientific|Media GbR
> Pichelsdorfer Str. 143
> 13595 Berlin
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>

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