Calling UnwarpJ plugin fails - Windows issue?

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

Calling UnwarpJ plugin fails - Windows issue?

Paolo Tanga
Hello

I need to call the UnwarpJ plugin from a macro, using ImageJ under
Windows XP.
The only syntax that appears to work requires a double back slash, such as:

run("UnwarpJ ","-align d:\\tmp\\clear_00000.fit NULL
d:\\tmp\\clear_00001.fit NULL 0 5 1 1 2 d:\\tmp\\unwarpout.tif");

If I use the output of "getDirectory()" for choosing a path, that comes with
single back slash as separators, and UnwarpJ throws a Java exception.
The same happens if I directly type single back slashes in the above line.

Where is the problem? How to use getDirectory() to produce a path string
that can be digested by UnwarpJ?

Thank you in advance
Paolo
Reply | Threaded
Open this post in threaded view
|

Re: double back slash bugs

dpoburko
Hi Paulo,

  Did you ever find a way around this bug. I have run into the same problem if run("Image Sequence..."...
It only works with double backslashes. I wonder if this is an artefact? It sounds like older versions of IJ returned doulbe backslashes with getDirectory. Maybe some functions have the embedded in them. For the time being, I'm trying to come up with simple loop to scan the path strong and double the backslashes, but this shouldn't be neccessary.

Thanks



Paolo Tanga wrote
Hello

I need to call the UnwarpJ plugin from a macro, using ImageJ under
Windows XP.
The only syntax that appears to work requires a double back slash, such as:

run("UnwarpJ ","-align d:\\tmp\\clear_00000.fit NULL
d:\\tmp\\clear_00001.fit NULL 0 5 1 1 2 d:\\tmp\\unwarpout.tif");

If I use the output of "getDirectory()" for choosing a path, that comes with
single back slash as separators, and UnwarpJ throws a Java exception.
The same happens if I directly type single back slashes in the above line.

Where is the problem? How to use getDirectory() to produce a path string
that can be digested by UnwarpJ?

Thank you in advance
Paolo
Reply | Threaded
Open this post in threaded view
|

Re: double back slash bugs

dscho
Hi,

On Sat, 17 Jan 2009, dpoburko wrote:

>   Did you ever find a way around this bug. I have run into the same problem
> if run("Image Sequence..."...
> It only works with double backslashes.

You can use forward slashes instead; even Windows understands that now.

And yes, it is my design.  The backslash is traditionally the escape
character: if you want to add a newline in a string, you say "\n".  If you
have to add a double quote, you have to escape it with a backslash
(otherwise, you wold end the string instead).  And if you want a
backslash, you need to escape it either, obviously.

Hth,
Dscho