Login  Register

Re: Launching ImageJ from external program

Posted by Gabriel Landini on Jan 19, 2006; 12:06pm
URL: http://imagej.273.s1.nabble.com/Launching-ImageJ-from-external-program-tp3703994p3703997.html

On Sunday 15 January 2006 16:14, Jon Harman wrote:
> I use Irfanview to view a directory as thumbnails on my W2000 machine.
> I'd like to select an image then launch ImageJ.  Irfanview has the
> ability to run an external image editor.  This feature works with
> "native" windows programs, but fails with ImageJ, giving an error that
> complains about missing ImageJ.cfg and launcher.cfg files.  Does anyone
> know what is going on and if there is a fix?

This will not help :-/ but I have a tip that may come handy to any linux/KDE
users of IJ.
I made a script:

cd ~/ImageJ
./jdk1.5.0_05/bin/java -mx900m -cp
ij.jar:jimi.jar:/home/gabriel/ImageJ/jdk1.5.0_05/lib/tools.jar ij.ImageJ $1

Note the $1 at the end. This allows to use the script to send an image browsed
with konqueror (the KDE file browser) to IJ when using the "Image view"
browsing mode. (There are 3 modes: Icon, Tree and Image view in konqueror,
accessible from 3 icons in the toolbar).
(Just make sure that you change "gabriel" for your own home directory! :-)  )

To make konqueror launch IJ, one must run in the Control Centre:
KDE Components>File Associations and choose the types of images one wishes to
open with IJ.
Let's say you chose tiff, then:
In the "Application Preference Order" list, click "Add..." and go the the
Application tab. Set a name (I chose run_IJ); then in the Command box, use
the Browse button to navigate to the ImageJ folder and choose the script file
above. (then  Apply and do the same for any other image types).

Now each time one right-clicks on an image type set this way (handy in Image
view mode) there will be an entry "Open with..." and the IJ script should be
one of the options.

I hope it is useful.
Cheers,

Gabriel