Posted by
Rasband, Wayne (NIH/NIMH) [E] on
Sep 08, 2010; 2:09pm
URL: http://imagej.273.s1.nabble.com/add-x-number-of-stacks-tp3687001p3687006.html
On Sep 8, 2010, at 2:33 AM, fabrice senger wrote:
> Hello,
>
> and thank you for your answer.
>
> Actually if there are 10 stacks with 3 images(01,02,03) , I want to add all
> together so that all 01 are added, all 02 are added and all 03 are added and
> so I get a new stack with 3 images.
>
> Concatenate thus not help as this produces a new stack but one stack after
> another.
>
> Ther several ways to sum stacks but it is always one to another, and I would
> like to automate this, maybe in batch mode...
Here is an easy way to do this:
1. Use File>Import>Raw to Open the 10 stacks as a single 30 image stack.
2. Use Image>Hyperstacks>Stack to Hyperstack to convert the stack to
a 10 slice, 3 frame hyperstack (Order="xyctz", c=1, z=10, t=3, display mode="Grayscale").
3. Use Image>Stack>Z Project (Projection type = "Sum Slices").
Use the command recorder (Plugins>Macros>Record) to generate a macro. It will look something like this:
run("Image Sequence...", "open=/Users/wayne/stack/stack01.tif sort");
run("Stack to Hyperstack...", "order=xyctz channels=1 slices=4 frames=3 display=Grayscale");
run("Z Project...", "projection=[Sum Slices] all");
-wayne