Re: Macro open each sub-folders as a stack

Posted by duerna on
URL: http://imagej.273.s1.nabble.com/Macro-open-each-sub-folders-as-a-stack-tp5019681p5019683.html

Hi, Herbie

Thank you very much.
It's works.

Now I could open each sub-folder as a stack,

and I add my code, but it only analysis the last stack, and did not give me a .avi saving.

here is my code:

////////
inputDir = getDirectory("choose the input directory");
outputDir = getDirectory("choose the output directory");

listdir = getFileList( inputDir );
for (i = 0; i < listdir.length; i++) {
        path = inputDir + listdir[i];
        if ( File.isDirectory(  path  )  ) {
                run("Image Sequence...", "open=" + path + " sort");
        }
}

run("Enhance Contrast", "saturated=0.35");
run("Apply LUT", "stack");
setAutoThreshold("Otsu dark");
setThreshold(60, 255);
run("Convert to Mask", " ");
print("Saving to: " + outputFolder);
saveAs("AVI", outputFolder+file);
close();
}

////////

I want set contrast and threshold of all stacks,
and save each stacks as .avi into a folder.

Would you please give me some suggestion?


Best Regards.
Duerna


 



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

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