Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hello,
how can I select polygons in pixel x,y-coordinates numerically like P1: 20, 30 P2: 221, 30 P3: 121, 204 I want to select geometrical exact polygons like an equilateral triangle in batch jobs. thank you for your help Günter |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Günter Bachelier wrote:
> Hello, > > how can I select polygons in pixel > x,y-coordinates numerically like > > P1: 20, 30 > P2: 221, 30 > P3: 121, 204 > > I want to select geometrical exact polygons > like an equilateral triangle in batch jobs. > > > thank you for your help > Günter > ... [show rest of quote] Use the macro recorder to obtain syntax.
Open an image. Run the Macro Recorder (Plugins:Macro:Record), select the polygon tool, make one and see the correct macro language required: setTool(2); makePolygon(26,61,36,122,103,144,186,156,218,124,230,75,196,57,119,43,63,46); The first line sets the polygon tool (when not already selected), the second line describes each point sequentially: x,y,x,y,x,y etc. Run this macro to see how it works: run("Blobs (25K)"); setTool(2); makePolygon(1,1,256,1,128,254,1,1); There is in fact no need to for the last x,y to be the same as the first. If you leave out the last ,1,1 you'll get the same polygon: it closes automatically Bo |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by g.bachelier
i would like to be taken off the list temporarily
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by Bo de Lange
Hello Bo de Lange,
> Run the Macro Recorder (Plugins:Macro:Record), > select the polygon tool, make one in the recorder window "setTool(2);" is shown in the first line but after I made the selection no "makePolygon(...)" is shown. But it works with the other tools like setTool(1); makeOval(...); In the tool window the active pixel is also not shown with pixel coordinate but with inches. How can this be changed? However after typing "makePolygon(20,30,221,30,121,204)" in the second line, saving and running the macro I get the error message undefined identifier in line 2 <makePolygon>(20,30,221,30,121,204); First I thought this is because of the pixel vs. inches coordinates and I tried "makePolygon(1.07,0.24,2.59,0.24,1.52,1.556); but I get an equivalent error message. Günter Bo de Lange wrote: > Use the macro recorder to obtain syntax. > Open an image. > Run the Macro Recorder (Plugins:Macro:Record), > select the polygon tool, make one and > see the correct macro language required: > > setTool(2); > makePolygon(26,61,36,122,103,144,186,156,218,124,230,75,196,57,119,43,63,46); > > The first line sets the polygon tool (when not already selected), > the second line describes each point sequentially: x,y,x,y,x,y etc. > > Run this macro to see how it works: > > run("Blobs (25K)"); > setTool(2); > makePolygon(1,1,256,1,128,254,1,1); > > There is in fact no need to for the last x,y to be the same as the > first. If you leave out the last ,1,1 you'll get the same polygon: it > closes automatically > > Bo ... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
> Hello Bo de Lange,
> >> Run the Macro Recorder (Plugins:Macro:Record), >> select the polygon tool, make one > > in the recorder window "setTool(2);" is shown in the > first line but after I made the selection no "makePolygon(...)" > is shown. But it works with the other tools like > > setTool(1); > makeOval(...); It sounds like you need to upgrade. Search the release notes at <http://rsb.info.nih.gov/ij/notes.html> for "makePolygon" and you will see that this function was added in ImageJ 1.35b. You can upgrade to ImageJ 1.37e by downloading the file "ij.jar" from <http://rsb.info.nih.gov/ij/upgrade/> and copying it into the ImageJ folder. > In the tool window the active pixel is also > not shown with pixel coordinate but with inches. > How can this be changed? Open the Analyze>Set Scale dialog and set "Distance in Pixels" to 0. -wayne |
Free forum by Nabble | Disable Popup Ads | Edit this page |