open image sequence

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

open image sequence

Morgiane Richard
Hello,
 
I wrote a macro that save the text files of a given folder as tiff images into a second given folder.
 
Then, the tiff images are opened as an image sequence and the animation of the slices is started.
 
When two macros are written (one for saving the files and one for opening an image sequence), the two work properly. However, I combined the two macro in a single one, and the image sequence does not open.
 
Here is the macro:
//first part: saving text files into images:
       dir1 = "F:/Documents And Settings/ees1mr/My Documents/ImageJ/C++/phase/text_file/";
       dir2 = "F:/Documents And Settings/ees1mr/My Documents/ImageJ/C++/phase/phase_seq/";
       list1 = getFileList(dir1);
       setBatchMode(true);
       for (i=0; i<list1.length; i++) {
           showProgress(i+1, list1.length);
           run("Text Image... ", "open=["+dir1+list1[i]+"]");
           saveAs("tif", dir2+list1[i]);
           close();
       }
//second part: opening and animating the image sequence
       dir = "F:/Documents And Settings/ees1mr/My Documents/ImageJ/C++/phase/phase_seq/";
       name = "time00000.tif"
       list = getFileList(dir);      
       path =dir+name;
       number = list.length;
       lut = "F:/Documents And Settings/ees1mr/My Documents/ImageJ/C++/phase/20_Colors.lut";
       run("Image Sequence...", "open=["+path+"] number="+number+" starting = 1 increment = 1");
       run("Open...", "open = ["+lut+"]");
       for(i = 1; i < nSlices + 1; i++){
           setSlice(i);
           wait(200);
       }  
 
The imageJ version is the 1.37.
 
Also, when I worked with imageJ 1.34, I could write open("blablabla.lut") and the lut file would open and be applied to the active image. It does not seem to work with imageJ 1.37; I have to write run(open, "open = []"), and even if I sepcify the file to be opened, a dialog box pops up to choose the lut file.
 
Thank you,
 
Morgiane