Re: Plugin- threshold, ROI

Posted by Michael Miller on
URL: http://imagej.273.s1.nabble.com/Plugin-threshold-ROI-tp3701007p3701010.html

Thank you so much, this is excellent, and exactly the sort of thing I have
been looking for, for several weeks!

This macro command, getResult(); detailed here
http://rsb.info.nih.gov/ij/developer/macro/functions.html

how can I run it and get data from it from within a PluginFilter? My
experience knows only of the following:

IJ.runMacro("getResult()"); method detailed
http://rsb.info.nih.gov/ij/developer/api/ij/IJ.html returns a String, which
is the data from the macro. This is in my mind a little indirect but
accomplishes the desired goals -- is this the only way?

Thanks again so much :-D

-Mike

----- Original Message -----
From: "Johannes Schindelin" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, November 14, 2006 3:35 AM
Subject: Re: Plugin- threshold, ROI


> Hi,
>
> On Mon, 13 Nov 2006, Michael Miller wrote:
>
>> I've been working with Liisa quite a bit. I think I can clear a few
>> things up.
>>
>> For some samples of her images see:
>> http://img132.imageshack.us/img132/6105/t2img100jl2.png
>> http://img132.imageshack.us/img132/4930/t2img1cb9.png
>>
>> What she needs is the exact origin/center of the dark circles.
>
> How about this:
>
> -- snip --
> run("Select None");
> id = getImageID();
> run("Duplicate...", "title=temp");
> w = getWidth();
> h = getHeight();
> makeOval(w/4, h/4, w/2, h/2);
> run("Make Inverse");
> run("Colors...", "foreground=white");
> run("Fill");
> setThreshold(2, 25);
> run("Colors...", "background=black");
> run("Make Binary", "thresholded remaining");
> run("Set Measurements...", "center redirect=None decimal=3");
> run("Clear Results");
> run("Measure");
> close();
> selectImage(id);
> centerX = newArray(1);
> centerY = newArray(1);
> centerX[0] = getResult("XM", 0);
> centerY[0] = getResult("YM", 0);
> makeSelection(10, centerX, centerY);
> -- snap --
>
>
> Hth,
> Dscho