Fellow ImageJ users - I'm trying to get a list of *filled* points in an ImageJ ROI. I just need a listing of the x,y pairs that fill an arbitrary ROI that I've drawn. This sounds pretty simple. Does anyone have a quick solution to this request? Thanks in advance.
- Jim Ewing -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Jim,
what about a macro roughly like this: getSelectionBounds(x0, y0, width, height); for (y=y0; y<y0+height; y++) for (x=x0; x<x0+width; x++) { if (selectionContains(x, y)) print (x+","+y); } Michael _________________________________________________________________________ On Wed, June 6, 2012 22:09, James Ewing wrote: > Fellow ImageJ users - I'm trying to get a list of *filled* points in an > ImageJ ROI. I just need a listing of the x,y pairs that fill an arbitrary > ROI that I've drawn. This sounds pretty simple. Does anyone have a > quick solution to this request? Thanks in advance. > > - Jim Ewing > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Jim,
are you using an old version of ImageJ? According to the documentation, 'selectionContains' is a standard macro function since 1.44g (Sept 2010). http://rsb.info.nih.gov/ij/developer/macro/functions.html#selectionContains Michael _______________________________________________________________________ On Sat, June 9, 2012 03:31, James Ewing wrote: > Hi Michael - > > I made a sample roi and tried to run the macro you suggested. > The program had a problem with selectionContains() > > It flagged it with "Undefined identifier in line 4" > > - Jim > > On Jun 8, 2012, at 6:25 AM, Michael Schmid wrote: > >> Hi Jim, >> >> what about a macro roughly like this: >> >> getSelectionBounds(x0, y0, width, height); >> for (y=y0; y<y0+height; y++) >> for (x=x0; x<x0+width; x++) { >> if (selectionContains(x, y)) >> print (x+","+y); >> } >> >> >> Michael >> _________________________________________________________________________ >> >> >> On Wed, June 6, 2012 22:09, James Ewing wrote: >>> Fellow ImageJ users - I'm trying to get a list of *filled* points in an >>> ImageJ ROI. I just need a listing of the x,y pairs that fill an >>> arbitrary >>> ROI that I've drawn. This sounds pretty simple. Does anyone have a >>> quick solution to this request? Thanks in advance. >>> >>> - Jim Ewing >>> -- >>> 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 |
Thank you Michael! Yes, that was an old version of ImageJ, and yes, the macro works. Just what I needed.
- Jim On Jun 9, 2012, at 4:21 AM, Michael Schmid wrote: > Hi Jim, > > are you using an old version of ImageJ? > According to the documentation, 'selectionContains' is a standard macro > function since 1.44g (Sept 2010). > > http://rsb.info.nih.gov/ij/developer/macro/functions.html#selectionContains > > Michael > _______________________________________________________________________ > > On Sat, June 9, 2012 03:31, James Ewing wrote: >> Hi Michael - >> >> I made a sample roi and tried to run the macro you suggested. >> The program had a problem with selectionContains() >> >> It flagged it with "Undefined identifier in line 4" >> >> - Jim >> >> On Jun 8, 2012, at 6:25 AM, Michael Schmid wrote: >> >>> Hi Jim, >>> >>> what about a macro roughly like this: >>> >>> getSelectionBounds(x0, y0, width, height); >>> for (y=y0; y<y0+height; y++) >>> for (x=x0; x<x0+width; x++) { >>> if (selectionContains(x, y)) >>> print (x+","+y); >>> } >>> >>> >>> Michael >>> _________________________________________________________________________ >>> >>> >>> On Wed, June 6, 2012 22:09, James Ewing wrote: >>>> Fellow ImageJ users - I'm trying to get a list of *filled* points in an >>>> ImageJ ROI. I just need a listing of the x,y pairs that fill an >>>> arbitrary >>>> ROI that I've drawn. This sounds pretty simple. Does anyone have a >>>> quick solution to this request? Thanks in advance. >>>> >>>> - Jim Ewing >>>> -- >>>> 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 |
Free forum by Nabble | Edit this page |