Login  Register

macro - array elements as options in run()

Posted by ved sharma on Aug 23, 2015; 3:17am
URL: http://imagej.273.s1.nabble.com/macro-array-elements-as-options-in-run-tp5014112.html

Hi,

I am writing a macro, where I create a newArray() to store names of all the open files. When I run Combine... command to combine the first two files (array elements [0] and [1]) as:

run("Combine...", "stack1=&filenames[0] stack2=&filenames[1]");

It gives me an error "filenames[0] is not a valid choice for Stack1". But, if I assign the array elements to different variables and pass those variables, then it works:

a = filenames[0];
b = filenames[1];
run("Combine...", "stack1=&a stack2=&b");

Is there a way to pass array elements as options to the run command?

Thanks,

Ved
________________________________
Ved Sharma, PhD
Department of Anatomy and Structural Biology
Albert Einstein College of Medicine
Bronx, New York

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html