Re: Ring Shaped ROIs
Posted by
Wayne Rasband on
Mar 15, 2006; 8:36pm
URL: http://imagej.273.s1.nabble.com/Ring-Shaped-ROIs-tp3703395p3703396.html
> A ring shaped ROI can be defined manually by using the Oval
> selection tool twice: once to create an outer circular
> selection and again to subtract an inner Oval selection
> ("alt" key down) from the outer circle. Processes such as
> "clear" and "invert" affect the pixels within the ring
> shaped region bounded by the two oval selections without
> affecting pixels interior to the smaller oval (the donut
> hole). .
>
> The macro language does not seem to provide the capability
> to define such a ring shaped ROI. The following statements
> always result in the creation of a single oval selection
> corresponding to the second "makeOval" statement:
>
> makeOval(x1, y1, width1, height1);
> setKeyDown("alt");
> makeOval(x2, y2, width2, height2);
>
> The second "makeOval" statement is not affected by the
> "setKeyDown" statement. The same result is obtained with
> and without the "setKeyDown"statement.
>
> Is there a way to define a ring shaped ROI with the macro language?
This worked in ImageJ 1.33 but I removed this feature because of some
nasty side effects. It's working again, however, in 1.37a.
You can also add selections using setKeyDown("shift"). There is an
example macro at
http://rsb.info.nih.gov/ij/macros/CompositeSelections.txtthat uses makeOval(), makeRectangle() and makePolygon() to create
composite selections.
-wayne