how to open raw image with a variable for the width parameter

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

how to open raw image with a variable for the width parameter

jvander
I am writing a plug in  (not a Macro) that uses IJ.run to open raw images.  It works for fixed numeric parameters, but fails when I try to use variables for the parameters.

This works:
_______
IJ.run("Raw...", "open=temp.raw image=8-bit width=128 height=128 offset=0 number=1 gap=0 white");
_______

This does not work
_______
int a2=128;
IJ.run("Raw...", "open=temp.raw image=8-bit width=a2 height=a2 offset=0 number=1 gap=0 white");
________

The error message is
Numeric value expected in run() function  
Dialog box title: "Import>Raw..."
Key:"width:"
Value or variable name: "a2"

Please advise as to how I might be able to open a raw image with a variable for the width and height

thanks in advance

Joe v.
Reply | Threaded
Open this post in threaded view
|

Re: how to open raw image with a variable for the width parameter

Peter Mc
try

int a2=128;
IJ.run("Raw...", "open=temp.raw image=8-bit width="+a2+" height="+a2+" offset=0 number=1 gap=0 white");
Research engineer
HGGM. Madrid.
Reply | Threaded
Open this post in threaded view
|

Re: how to open raw image with a variable for the width parameter

jvander
Thanks!

The "+a2+"  solved the problem.

Joe v.