Posted by
Ghislain BUGNICOURT-2 on
Apr 28, 2011; 11:35am
URL: http://imagej.273.s1.nabble.com/Ubuntu-Run-single-instance-listener-tp3684690p3684692.html
Le 28/04/2011 11:29, Johannes Schindelin a écrit :
> Dear Ghislain,
>
> On Thu, 28 Apr 2011, Ghislain Bugnicourt wrote:
>
>> Sorry for asking again, but it seems that my previous message (13th of
>> april) was ignored because somebody answered by asking another
>> question...
> Yep, sorry, I also planned to answer, but got side-tracked by the day-job
> :-)
>
>> I'm trying to correct a strange behavior of imagej on Ubuntu : when
>> opening several images at the same time while ImageJ isn't started, the
>> single instance listener (if checked in misc. options) doesn't work and
>> one instance is started for each image. If ImageJ is already open, it
>> works well (with imageJ 1.45e)
>>
>> I can't repeat this on MacOSX, that's why I try to correct the bug. :)
>>
>> I learned how to compile ImageJ, so I can test any idea of yours, if you
>> tell me what to modify in the source code !
> The first thing would be to find out in which sequence the code is called
> that is supposed to check for an existing instance and the code that then
> starts listening to the socket.
>
> The code that checks whether there is already a running instance is here:
>
>
http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=ImageJA.git;a=blob;f=ij/ImageJ.java;h=a446cac76eaf97f10c1adc01b1e32da3e4fb0c77;hb=imagej#l626>
> The code to start the socket listener is here:
>
>
http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=ImageJA.git;a=blob;f=ij/SocketListener.java;h=f6475b6f3602548dd382823c1ab7e86fc43ce563;hb=imagej#l29>
> I typically insert some code like IJ.log("Checkpoint 1"); with a running
> number so I can identify the places passed. You might also want to turn on
> the debug mode by passing ImageJ the -debug option...
>
> Please also note that IJ.log() outputs to the standard error (i.e. the
> command-line window you started ImageJ in) as long as there is no instance
> of ImageJ itself (i.e. the main window).
>
> Sorry for the delay,
> Johannes
Hi !
Gluender,
Thanks for your response, but I should have given more details.
Johannes and I exchanged several mails (12th of April), and after a few
kind advices he told me I should learn how to compile ImageJ, and then
ask the list again for hints to find the bug.
This is why I sent my message (13th of April), although at the moment I
use the workaround of course !
Johannes,
Thanks for your detailed hints but I'm facing a few problems due to my
lack of confidence with command-line use :
- I'm not sure about the command to use in a terminal, if I want to
mimic what happens when I select two images and press enter. Is it
{imagej -p 1 ./image1.tif & imagej -p 1 ./image2.tif &} ?
More details : with {imagej image1.tif image2.tif}, only one instance of
imagej opens even if the instance listener isn't checked in the options.
On the contrary, if I open the two images consecutively by the command
line, {imagej ./image1.tif &} and then {imagej ./image2.tif &}, two
instances open ! Except if I use the {-p 1} option of course.
- I didn't figure out how to pass the {-debug} option to ImageJ from
the terminal. It isn't listed in the {man imagej} page. When I check the
debug option and then close-reopen ImageJ, the debug mode is lost. Normal ?
Regards,
Ghislain