Login  Register

Re: passing image to ImageJ via Java Web Start

Posted by dscho on Feb 01, 2010; 10:33am
URL: http://imagej.273.s1.nabble.com/passing-image-to-ImageJ-via-Java-Web-Start-tp3689525p3689528.html

Hi,

On Sun, 31 Jan 2010, arnim.jenett wrote:

> Situation: I created a catalog of images using html. these images I
> currently can open in ImageJA (applet), but 1) after a couple of images I
> reliably run into a an "out-of-memory" exception

With Java >= 1.6, you can specify larger memory with applets:

        https://jdk6.dev.java.net/plugin2/

> and 2) on a weak network it is rather slow to download Imagej every time
> I call it (often).

Right.

> Therefore I thought about using Java Web Start instead and found the
> corresponding jnpls ( thanks dscho, curtis and wayne). But there is no way
> documented how I could pass image information via the jnpl to ImageJ.

I would suggest something like this:

        <application-desc main-class="fiji.Main">
                <argument>http://example.com/image.png</argument>
        </application-desc>

(For Fiji, we run fiji.Main rather than ij.ImageJ)

> I also tried to pass it as "<argument>" from inside the "<application-desc>"
> but that failed as well.

I guess that it does not work with local paths, unless you have a signed
jnlp. Do you have any error message from that try?

> even nicer would be, if I could call the jnpl with the image's parameters
> (in hmtl).

You can specify a Java Webstart only with a .jnlp file, i.e. this xml
format you already know.  There is no way to specify any add-on options
via .html.

Having said that, if you manage to make a .jnlp file that _does_ load an
image as you want, it is relatively easy to produce a .php or .perl script
to generate a custom .jnlp from HTTP variables (i.e. parameters you pass
in by appending "?variable=value" to the URL).

Ciao,
Dscho