Passing variable to a command

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

Passing variable to a command

Pedro J CamelloDr Pedro J Camello
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?

Thanks in advance

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Passing variable to a command

Rasband, Wayne (NIH/NIMH) [E]
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