Login  Register

Re: Passing variable to a command

Posted by Rasband, Wayne (NIH/NIMH) [E] on Oct 10, 2014; 8:55pm
URL: http://imagej.273.s1.nabble.com/Passing-variable-to-a-command-tp5009999p5010000.html

On Oct 10, 2014, at 4:05 PM, Pedro J Camello wrote:

> Hi all,
>
> within a macro, I would like to pass a string to a command call.
>
> I want to open hundreds of images (stored in a folder) as a stack using the File>Import>Sequence command. I would like the macro to open the series without waiting mi manual input in the corresponding  "File name contains" box.
>
> This is the code:
>
> filenameroot = "18OCT12_261";//This is a typical wild card for the names of my files
>
> run("Image sequence...", "file =\filenameroot sort");
>
> If write the string 18OCT12_261  instead the variable name it works.
>
> What am I doing wrong?

The code should be:

   run("Image Sequence...", "open=&filenameroot sort");

-wayne

     

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