ImageJ command line

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

ImageJ command line

Juergen Haag
Hi all,

I am using ImageJ from the command line (OS: Window 7) with the name of a
macro as an argument. That works fine. However, if I repeat the command
ImageJ -macro mymacro
a new instance of ImageJ is opened.
Is it possible to just execute the macro if ImageJ is already running?
Is there a way of limiting ImageJ to a single instance?

Thanks
Juergen
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ command line

Gluender-3
Jürgen,

although I nerver used it, you may try Edit <
Option > Misc > "Run single instance listener".

The IJ-manual tells us:

"Enable Run socket listener and ImageJ will use
sockets to prevent multiple instances from being
launched. On Windows, this avoids the problem
where another copy of ImageJ starts each time an
image is dragged and dropped on the ImageJ icon.
It also prevents multiple instances when running
ImageJ from the command line. Note that you may
get a security alert the first time ImageJ starts
with this option enabled. ImageJ does not require
external socket access so it is okay to deny it
access in the security alert."

>Hi all,
>
>I am using ImageJ from the command line (OS: Window 7) with the name of a
>macro as an argument. That works fine. However, if I repeat the command
>ImageJ -macro mymacro
>a new instance of ImageJ is opened.
>Is it possible to just execute the macro if ImageJ is already running?
>Is there a way of limiting ImageJ to a single instance?
>
>Thanks
>Juergen

HTH
--

                   Herbie

          ------------------------
          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ command line

dscho
In reply to this post by Juergen Haag
Hi,

On Fri, 26 Mar 2010, Juergen Haag wrote:

> I am using ImageJ from the command line (OS: Window 7) with the name of a
> macro as an argument. That works fine. However, if I repeat the command
> ImageJ -macro mymacro
> a new instance of ImageJ is opened.
> Is it possible to just execute the macro if ImageJ is already running?
> Is there a way of limiting ImageJ to a single instance?

You need to configure it in the options (Edit>Options>Misc...). Note,
though, that this poses a security risk if your computer has no firewall
enabled, or if other people can log in remotely.

ImageJA has a slightly different approach, which does not show the same
problems (but it did not work in Wayne's tests). Fiji has it enabled by
default.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ command line

utfryre33
In reply to this post by Juergen Haag
When running ImageJ from the command line, each command typically opens a new instance by default, which is why your repeated command launches multiple windows. Unfortunately, ImageJ doesn’t natively support single-instance mode, but you can use scripting or plugins to send commands to an existing instance. This approach is similar to how the  SRD grant Status Check ensures efficient, single-point access to information without creating duplicates or confusion.