Re: skipping "convert all images in stack to binary?"
Posted by
willliam.day on
URL: http://imagej.273.s1.nabble.com/skipping-convert-all-images-in-stack-to-binary-tp3698816p3698818.html
Hmm, didn't work. However I am not running the macro inside ImageJ. I am
externally automating ImageJ from a java program, could this be the problem?
-- START CODE --
import ij.*;
public class TrackerAnalyzeParticles {
public static void main(String[] argv) {
// ...
IJ.selectWindow(filebase);
IJ.setThreshold(8, 255);
IJ.run("Convert to Mask", " ");
IJ.run("Analyze Particles...",
"size=4-Infinity circularity=0.00-1.00 show=Nothing display
clear stack");
IJ.run("Measurements...", "path='" + file + ".pts'");
//...
mainFrame.quit();
}
}
-- END CODE --
On 7/18/07, Ben Tupper <
[hidden email]> wrote:
>
> On Jul 18, 2007, at 4:12 PM, William Day wrote:
>
> > I'm trying to automate a selection of tasks in a Java program, but
> > I can't
> > let it run in the background because after I run("Convert to Mask")
> > I get
> > prompted with "Convert all images in stack to binary?"
> >
>
> Hi,
>
> This is a great time to use the macro recorder
> (Plugins>Macros>Record...) to see ImageJ expects for arguments to
> commands. You can usually avoid the dialogs by populating the
> argument list. For example...
>
> Do these to converts the gray scale images in the stack to masks
> without prompting for a dialog.
>
> run("MRI Stack (528K)");
> run("Convert to Mask", "calculate black");
>
> In the following the "calculate" argument is missing, but still no
> dialog.
> run("MRI Stack (528K)");
> run("Convert to Mask", " black");
>
> And finally, an empty string of arguments. Still no dialog.
> run("MRI Stack (528K)");
> run("Convert to Mask", " ");
>
> Pretty good stuff!
>
> Cheers,
> Ben
>
>
> > Is there something I can set, or argument I can pass that will
> > avoid this
> > dialog? I poked around in the Thresholder.java and didn't see any
> > trivial
> > ways around it.
> >
> > --
> > William Day
>
> Ben Tupper
> Bigelow Laboratory for Ocean Science
> 180 McKown Point Road
> POB 475
> West Boothbay Harbor, ME 04575
>
--
William Day