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 |
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 > > |
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 > > > > > |
Free forum by Nabble | Edit this page |