Login  Register

Re: pixel by pixel intensity in a time lapase series

Posted by Gabriel Lapointe on Jun 02, 2009; 11:23am
URL: http://imagej.273.s1.nabble.com/pixel-by-pixel-intensity-in-a-time-lapase-series-tp3692220p3692221.html

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
>
>