Re: IJ.doCommand(???) and ThresholdAdjuster
Posted by Wayne Rasband on Aug 13, 2008; 8:28pm
URL: http://imagej.273.s1.nabble.com/IJ-doCommand-and-ThresholdAdjuster-tp3695389p3695390.html
On Aug 13, 2008, at 3:52 PM, Carl Trapani wrote:
> Hi Everyone,
>
> Does anyone know what the commands are that can be passed to
> IJ.doCommand(String command)? Are there constants defined somewhere or
> some type of naming scheme?
IJ.run() and IJ.doCommand() can be passed any ImageJ menu command. Use
the Plugins>Utilities>List Commands (or Find Commands in v1.41) command
to get a list of all the menu commands. You can also get a command name
by running the command with the recorder running. Both IJ.run() and
IJ.doCommand() run the specified command but IJ.run() does not return
until the command finishes whereas IJ.doCommand() runs the command in a
separate thread and returns immediately. You can use use either
IJ.run("Threshold...") or IJ.doCommand("Threshold...") to open the
Threshold window.
-wayne
> I'm trying to run the ThresholdAdjuster from my class when the user
> clicks a button. My class extends PlugInFrame. My idea is to just use
> IJ.doCommand("Threshold"), but that isn't working. I've also tried
> IJ.runPlugIn("ThresholdAdjuster", null), but that doesn't appear to do
> anything?
>
> Thanks in advance for any tips.
> Carl Trapani
>