Login  Register

pixel by pixel intensity in a time lapase series

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

pixel by pixel intensity in a time lapase series

Runa Hamid
10 posts
Dear Image J users,

Can someone help me to modify this macro to get pixel by pixel intensity of
a selected circular ROI in all the frames in time lapse series.This macro is
working perfectly fine for a single frame. If this can be modified for a
time lapse series, it will save lot of time running the macro for each
frame.

// list pixels values inside a selection
w=getWidth();h=getHeight();
getSelectionBounds(xmin, ymin, selwidth, selheight);
run("Create Mask");
m=newArray(w*h);
for(x=0;x<w;x++){
       for(y=0;y<h;y++){
               m[y*w+x]=getPixel(x,y);
       }
}
close(); //close mask
for(x=xmin;(x<=xmin+selwidth);x++){
       for(y=ymin;(y<=ymin+selheight);y++){
               if (m[y*w+x]!=0) print (x,y,getPixel(x,y));
       }
}

Thanks in advance,

Runa
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: pixel by pixel intensity in a time lapase series

Gabriel Lapointe
27 posts
Hello Runa,
I didn't tested it but adding a loop should make it work.

Good luck
Gabriel Lapointe

for (slice=1, slice<=nSlices(); slice++){
setSlice(slice);
// list pixels values inside a selection
    w=getWidth();h=getHeight();
    getSelectionBounds(xmin, ymin, selwidth, selheight);
    run("Create Mask");
    m=newArray(w*h);
    for(x=0;x<w;x++){
           for(y=0;y<h;y++){
                   m[y*w+x]=getPixel(x,y);
           }
    }
    close(); //close mask
    for(x=xmin;(x<=xmin+selwidth);x++){
           for(y=ymin;(y<=ymin+selheight);y++){
                   if (m[y*w+x]!=0) print (x,y,getPixel(x,y));
           }
    }
}

Runa Hamid wrote:

> Dear Image J users,
>
> Can someone help me to modify this macro to get pixel by pixel intensity of
> a selected circular ROI in all the frames in time lapse series.This macro is
> working perfectly fine for a single frame. If this can be modified for a
> time lapse series, it will save lot of time running the macro for each
> frame.
>
> // list pixels values inside a selection
> w=getWidth();h=getHeight();
> getSelectionBounds(xmin, ymin, selwidth, selheight);
> run("Create Mask");
> m=newArray(w*h);
> for(x=0;x<w;x++){
>        for(y=0;y<h;y++){
>                m[y*w+x]=getPixel(x,y);
>        }
> }
> close(); //close mask
> for(x=xmin;(x<=xmin+selwidth);x++){
>        for(y=ymin;(y<=ymin+selheight);y++){
>                if (m[y*w+x]!=0) print (x,y,getPixel(x,y));
>        }
> }
>
> Thanks in advance,
>
> Runa
>
>  
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: pixel by pixel intensity in a time lapase series

Runa Hamid
10 posts
Hi Gabriel,

Thankyou very much. After removing few syntax errors, the macro is running
perfectly fine now.


Runa
On Tue, Jun 2, 2009 at 4:53 PM, Gabriel Lapointe <
[hidden email]> wrote:

> Hello Runa,
> I didn't tested it but adding a loop should make it work.
>
> Good luck
> Gabriel Lapointe
>
> for (slice=1, slice<=nSlices(); slice++){
> setSlice(slice);
> // list pixels values inside a selection
>    w=getWidth();h=getHeight();
>    getSelectionBounds(xmin, ymin, selwidth, selheight);
>    run("Create Mask");
>    m=newArray(w*h);
>    for(x=0;x<w;x++){
>           for(y=0;y<h;y++){
>                   m[y*w+x]=getPixel(x,y);
>           }
>    }
>    close(); //close mask
>    for(x=xmin;(x<=xmin+selwidth);x++){
>           for(y=ymin;(y<=ymin+selheight);y++){
>                   if (m[y*w+x]!=0) print (x,y,getPixel(x,y));
>           }
>    }
> }
>
>  Runa Hamid wrote:
> > Dear Image J users,
> >
> > Can someone help me to modify this macro to get pixel by pixel intensity
> of
> > a selected circular ROI in all the frames in time lapse series.This macro
> is
> > working perfectly fine for a single frame. If this can be modified for a
> > time lapse series, it will save lot of time running the macro for each
> > frame.
> >
> > // list pixels values inside a selection
> > w=getWidth();h=getHeight();
> > getSelectionBounds(xmin, ymin, selwidth, selheight);
> > run("Create Mask");
> > m=newArray(w*h);
> > for(x=0;x<w;x++){
> >        for(y=0;y<h;y++){
> >                m[y*w+x]=getPixel(x,y);
> >        }
> > }
> > close(); //close mask
> > for(x=xmin;(x<=xmin+selwidth);x++){
> >        for(y=ymin;(y<=ymin+selheight);y++){
> >                if (m[y*w+x]!=0) print (x,y,getPixel(x,y));
> >        }
> > }
> >
> > Thanks in advance,
> >
> > Runa
> >
> >
>