Login  Register

Trouble using "endsWith" statements

Posted by Franklin on Mar 08, 2020; 2:08pm
URL: http://imagej.273.s1.nabble.com/Trouble-using-endsWith-statements-tp5023029.html

Hello!
I recently started writing macros and have been struggling with this one
problem for about a week. I have a directory containing two versions of each
file, one version in TIFF form and the other in CZI form. I want to open all
the CZI files, but the program I wrote opens everything. There's a simple
fix but I'm stumped. Assistance would be greatly appreciated.

dir1 = getDirectory("Select Input Directory");
list = getFileList(dir1);
for (i=0; i<list.length; i++)
        {
        showProgress(i+1, list.length);
        filename = dir1 + list[i];
                if(endsWith(filename,"czi")){
                open(filename);
                run("Z Project...", "projection=[Max Intensity]");
                saveAs("TIFF", dir1+list[i]+"Max");
                close();
        }



--
Sent from: http://imagej.1557.x6.nabble.com/

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