Login  Register

question: macro for automatic image stack summing

Posted by Sebastian Voigtländer on Jan 24, 2017; 8:09pm
URL: http://imagej.273.s1.nabble.com/question-macro-for-automatic-image-stack-summing-tp5017938.html

Dear all,

I try to write a simple macro to help me with image analysis for my thesis.
It should:

1. open .tif image stacks from an input folder
2. execute run("Z Project...", "projection=[Sum Slices]")
3. save the files in an output folder


my macro (so far):

function sum_stacks(input, output, filename) {

    run("Bio-Formats Windowless Importer", "open=input + filename");
    run("Z Project...", "projection=[Sum Slices]");
    run("Save", "save=[output+filename]");
    run("Close");
};

input = "*specified input folder with stacks of .tif images*"
output = "*specified empty output folder*"

list = getFileList(input);

for (k = 0; k < list.length; k++) {
    sum_stacks(input, output, list[k]);
};



When I run it I get the error message:

Sorry, there was an I/O problem during import.


Since I have no idea what's wrong, I would be very grateful for any help!

Cheers,
Sebastian

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