Login  Register

Re: Open an image sequence using a macro

Posted by Martin Höhne on Feb 27, 2014; 10:44am
URL: http://imagej.273.s1.nabble.com/Open-an-image-sequence-using-a-macro-tp5005969p5006696.html

Dear all,
I also have problems with the use of Import Image Sequence in a macro.

I have a directory with two subdirectories (named dir1 and dir2) containinig image series  and I would like to open both series within a macro:

When I start Fiji and run the macro give below for the first time, stack1 is opened fine without the Image Sequence dialog popping up. But stack2 does´t. Instead the Image sequence dialog pops up. The options given in the macro, e.g. scale=50) are not automatically taken in this dialog.

When I run the macro for a second time, also the first stack is not opened automatically.

It seems the the Import Image Sequence function has to be resetted after every imported stack. But how?

Martin

macro code:

source_dir = getDirectory("Source Directory");
stack1=source_dir+"dir1"+File.separator;
        list = getFileList(stack1);
        fileone=stack1 + list[0];
        nummer=list.length;
        run("Image Sequence...", "open=fileone number=nummer starting=1 increment=1 scale=50 file=[] or=[] convert sort");
       
stack2=source_dir+"dir2"+File.separator;
        list = getFileList(stack2);
        fileone=stack2 + list[0];
        nummer=list.length;
        run("Image Sequence...", "open=fileone number=nummer starting=1 increment=1 scale=50 file=[] or=[] convert sort");