imagej -batch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

imagej -batch

David Webster
I tried running "imagej -batch Random_Ovals" and "imagej -batch
Random_Ovals.class" from the command line in a Windows command prompt
window, but nothig happens in the first case, and in the second I get a
macro error. The documentation in Plugins/Programming Examples/Command
Line Example says this should work with a Plugin. What am I doing wrong?

David Webster
Reply | Threaded
Open this post in threaded view
|

Re: imagej -batch

Wayne Rasband
> I tried running "imagej -batch Random_Ovals" and "imagej
> -batch Random_Ovals.class" from the command line in a
> Windows command prompt window, but nothig happens in the
> first case, and in the second I get a macro error. The
> documentation in Plugins/Programming Examples/Command Line
> Example says this should work with a Plugin. What am I doing
> wrong?
>
> David Webster

Running "imagej -batch Random_Ovals" from the command line does not appear to do anything because -batch runs a macro in batch mode, and images are not displayed in batch mode. Instead, use "imagej -macro Random_Ovals". "imagej -batch Random_Ovals.class" does not work because -batch only runs macros. Instead, use "imagej -run "Random Ovals". All of the ImageJ command line options are described at

    http://rsbweb.nih.gov/ij/docs/install/linux.html#options

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: imagej -batch

David Webster
Wayne/Al,

I did this "imagej -macro Random_Ovals" but get the error message "macro or
script not found". I was looking for something that would run my Java Plugin
(i.e a class file) from the command line. If I can do this, it not
immediately obvious how to from the documentation.

Specifically, I can easily compile Plugins using the JCreator IDEI can even
run them to a limited extent using my own runner program with a main(). But
I would like to do it with ImageJ.java so that I can have full
functionality.

David

P.S. I sent this to the group as it seems to be of general interest.

On Sat, Jan 2, 2010 at 7:34 PM, Wayne Rasband <[hidden email]> wrote:

>  > I tried running "imagej -batch Random_Ovals" and "imagej
> > -batch Random_Ovals.class" from the command line in a
> > Windows command prompt window, but nothig happens in the
> > first case, and in the second I get a macro error. The
> > documentation in Plugins/Programming Examples/Command Line
> > Example says this should work with a Plugin. What am I doing
> > wrong?
> >
> > David Webster
>
> Running "imagej -batch Random_Ovals" from the command line does not appear
> to do anything because -batch runs a macro in batch mode, and images are not
> displayed in batch mode. Instead, use "imagej -macro Random_Ovals". "imagej
> -batch Random_Ovals.class" does not work because -batch only runs macros.
> Instead, use "imagej -run "Random Ovals". All of the ImageJ command line
> options are described at
>
>    http://rsbweb.nih.gov/ij/docs/install/linux.html#options
>
> -wayne
Reply | Threaded
Open this post in threaded view
|

Re: imagej -batch

Wayne Rasband
On Jan 3, 2010, at 12:45 PM, David Webster wrote:

> Wayne/Al,
>
> I did this "imagej -macro Random_Ovals" but get the error message
> "macro or script not found".

There has to be a file named Random_Ovals.txt in the ImageJ/macros folder, or the macro file can be anywhere if you specify the full file path.

> I was looking for something that would run
> my Java Plugin (i.e a class file) from the command line. If I can do this,
> it is not immediately obvious how to from the documentation.

You can run the plugin My_Plugin.class from the command line using a command like

   imagej -run "My Plugin"

where "My Plugin" is the command in the Plugins menu that runs the plugin.

> Specifically, I can easily compile Plugins using the JCreator IDEI can even
> run them to a limited extent using my own runner program with a main().
> But I would like to do it with ImageJ.java so that I can have full
> functionality.
>
> David
>
> P.S. I sent this to the group as it seems to be of general interest.
>
> On Sat, Jan 2, 2010 at 7:34 PM, Wayne Rasband <[hidden email]> wrote:
>
>>> I tried running "imagej -batch Random_Ovals" and "imagej
>>> -batch Random_Ovals.class" from the command line in a
>>> Windows command prompt window, but nothig happens in the
>>> first case, and in the second I get a macro error. The
>>> documentation in Plugins/Programming Examples/Command Line
>>> Example says this should work with a Plugin. What am I doing
>>> wrong?
>>>
>>> David Webster
>>
>> Running "imagej -batch Random_Ovals" from the command line does not appear
>> to do anything because -batch runs a macro in batch mode, and images are not
>> displayed in batch mode. Instead, use "imagej -macro Random_Ovals". "imagej
>> -batch Random_Ovals.class" does not work because -batch only runs macros.
>> Instead, use "imagej -run "Random Ovals". All of the ImageJ command line
>> options are described at
>>
>>   http://rsbweb.nih.gov/ij/docs/install/linux.html#options
>>
>> -wayne