Login  Register

Re: question: macro for automatic image stack summing

Posted by Eric Denarier on Jan 25, 2017; 10:56am
URL: http://imagej.273.s1.nabble.com/question-macro-for-automatic-image-stack-summing-tp5017938p5017943.html

Hi Sebastian,
You can do it with the batch function :
Process/Batch/macro
without need to code.

Eric Denarier
Grenoble Institut des Neurosciences
Inserm U1216
Chemin Fortuné Ferrini
38700 La Tronche
France

Tél :33 (0)4 565 205 38

http://neurosciences.ujf-grenoble.fr/

Le 24/01/2017 21:09, Sebastian Voigtländer a écrit :

> 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

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

Capture.PNG (40K) Download Attachment