Created
January 31, 2016 17:54
-
-
Save mutterer/ebb204ee61e001e25797 to your computer and use it in GitHub Desktop.
A tool that allows drawing multiple freehand regions and adds them as overlay objects. In response to http://forum.imagej.net/t/test-if-roi-selection-is-closed-finished/723/3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macro "MultiFreehand Tool - C00cT0f18M" { | |
| xs = newArray(1); | |
| ys = newArray(1); | |
| getCursorLoc(x, y, z, flags); | |
| xs[0]=x; ys[0]=y; | |
| lastx=x;lasty=y; | |
| leftclick=16; | |
| while (flags&leftclick>0) { | |
| getCursorLoc(x, y, z, flags); | |
| if ((x!=lastx)||(y!=lasty)) { | |
| xs = Array.concat(xs,x); | |
| ys = Array.concat(ys,y); | |
| makeSelection ("freehand",xs,ys); | |
| lastx=x;lasty=y; | |
| } | |
| wait(50); | |
| } | |
| run("Add Selection...",""); | |
| run("Select None"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment