Login  Register

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

Posted by jvander on Sep 30, 2015; 2:48pm
URL: http://imagej.273.s1.nabble.com/how-to-open-raw-image-with-a-variable-for-the-width-parameter-tp5014502.html

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.