ImageJ
Search
everywhere
only in this topic
Advanced Search
how to open raw image with a variable for the width parameter
‹
Previous Topic
Next Topic
›
Classic
List
Threaded
♦
♦
Locked
3 messages
jvander
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
how to open raw image with a variable for the width parameter
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.
Peter Mc
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: how to open raw image with a variable for the width parameter
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.
jvander
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: how to open raw image with a variable for the width parameter
Thanks!
The "+a2+" solved the problem.
Joe v.
Free forum by Nabble
Edit this page