Login  Register

Re: re position ROIs at certain stacks

Posted by Jacob Keller on Feb 04, 2014; 5:53pm
URL: http://imagej.273.s1.nabble.com/re-position-ROIs-at-certain-stacks-tp5006379p5006411.html

But can the ROI repositioning be done automatically by somehow calling one
of the tracking algorithms? I have 1000s-frame stacks with tens to hundreds
of discrete cells to be tracked.

I often have this experience with imageJ/FIJI that there are things which
are incredibly simple in theory to do, but sifting through all of the
plugins and very fancy and sometimes specialized programs takes a long
time, and one often finds only workarounds. Don't a lot of people track
cells while measuring their brightness or ratios or whatever?

JPK


On Tue, Feb 4, 2014 at 11:39 AM, Straatman, Kees (Dr.) <[hidden email]
> wrote:

> I had thought about this in the past while doing FRAP experiments and
> after the start of this macro by Jan Brocher have used his code as basis
> for a macro that when you move the ROI it automatically updates the ROI for
> all following images in the stack and moves automatically to the next image
> in the stack.
>
> You can change the sensitivity of the repositioning of the ROI by changing
> the wait(350) at line 61 of the code.
>
> Not extensively tested but seems to work.
>
> Best wishes
>
> Kees
>
> Dr Ir K.R. Straatman
> Senior Experimental Officer
> Centre for Core Biotechnology Services
> University of Leicester
>
> http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif(notice new website!)
>
>
>
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Jan
> Brocher - BioVoxxel
> Sent: 04 February 2014 10:10
> To: [hidden email]
> Subject: Re: re position ROIs at certain stacks
>
> Hi Pablo, hi Jacob
>
> potentially you can check the following macro. It might do, what you need.
> I simply put it together quickly, so if there is a problem contact me
> again.
>
> What you have to do:
>
> 1.) draw the ROI you want to put into the image
> 2.) choose the color of the ROI using the color picker tool
> 3.) run the macro I attached here
> 4.) go through your slices and if you need to manually move a selection do
> the following
>      5.) keep [Alt] pressed and click inside your ROI (thus you reactivate
> it
>      6.) move it or change its appearance
>      7.) click somewhere outside the ROI to add it back to the overlay
> layer
>      8.) press Ok in the small dialog box
>
> --> This will add all the ROIs to teh ROI-Manager and using this one you
> can select >More >Multi Measure with the choice to measure all slices
> active and you will get the analyses of all the ROIs in all slices in teh
> results table.
>
>
> Macro code:
>
> /**Macro written by Jan Brocher/BioVoxxel
>  * NO WARRENTY of functionality and no liability for any damages.
>  */
>
> getDimensions(width, height, channels, slices, frames); Dialog.create("ROI
> setup");
>         Dialog.addChoice("label:", newArray( "frames", "slices",
> "channels"), "frames");
>         Dialog.show();
>         dimension = Dialog.getChoice();
>
> color = toHex(getValue("rgb.foreground"));
>
> run("Overlay Options...", "stroke="+color+" width=0 fill=none set");
>
> setBatchMode(true);
> if(dimension=="frames") {
>         if(frames<2) {
>                 exit("no multiple frames available");
>         } else {
>                 toLabel = frames;
>         }
> } else if(dimension=="slices") {
>         if(slices<2) {
>                 exit("no multiple slices available");
>         } else {
>                 toLabel = slices;
>         }
> } else if(dimension=="channels") {
>         if(channels<2) {
>                 exit("no multiple channels available");
>         } else {
>                 toLabel = channels;
>         }
> }
>
> roiManager("reset");
> for(i=1; i<=toLabel; i++) {
>         if(dimension=="frames") {
>                 Stack.setFrame(i);
>         } else if(dimension=="slices") {
>                 Stack.setSlice(i);
>         } else if(dimension=="channels") {
>                 Stack.setChannel(i);
>         }
>
>
>         run("Add Selection...");
> }
>
> //reset Stack position
> if(dimension=="frames") {
>                 Stack.setFrame(1);
> } else if(dimension=="slices") {
>                 Stack.setSlice(1);
> } else if(dimension=="channels") {
>                 Stack.setChannel(1);
> }
>
> setBatchMode(true);
> //enable manual adjustments to the individual ROIs waitForUser("adjust
> overlays and press Ok"); run("To ROI Manager"); exit();
>
> //end of macro---------------------------------------------
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
*******************************************

Jacob Pearson Keller, PhD

Looger Lab/HHMI Janelia Farms Research Campus

19700 Helix Dr, Ashburn, VA 20147

email: [hidden email]

*******************************************

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