Does anyone know of / has written a plugin to interleave more than 2 stacks sequentially?

I have 9 stacks that each have 101 pictures in them. I am trying to interleave all 9 together but keep them in order.

Does anyone know of a plugin or macro that could interleave more than 2 stacks?

Thanks!

Image > Stacks > Tools > Interleave indeed only supports interleaving 2 stacks, not more.

What you can do instead:

  • Image > Stacks > Tools > Concatenate… (with the Open as 4D image option deselected)
  • Image > Hyperstacks > Stack to Hyperstack… with order=xyctz, slices=9 and frames= the number of slices in each of your input stacks (provided they have the same size)
  • Image > Hyperstacks > Hyperstack to Stack

The following macro illustrates this on the Bat Cochlea Volume sample image:

run("Bat Cochlea Volume (19K)");
run("Duplicate...", "duplicate");
run("Duplicate...", "duplicate");
run("Duplicate...", "duplicate");
run("Duplicate...", "duplicate");
run("Duplicate...", "duplicate");
run("Duplicate...", "duplicate");
run("Duplicate...", "duplicate");
run("Duplicate...", "duplicate");
run("Concatenate...", "  image1=bat-cochlea-volume.tif image2=bat-cochlea-volume-1.tif image3=bat-cochlea-volume-2.tif image4=bat-cochlea-volume-3.tif image5=bat-cochlea-volume-4.tif image6=bat-cochlea-volume-5.tif image7=bat-cochlea-volume-6.tif image8=bat-cochlea-volume-7.tif image9=bat-cochlea-volume-8.tif");
run("Stack to Hyperstack...", "order=xyctz channels=1 slices=9 frames=114 display=Color");
run("Hyperstack to Stack");

For stacks of unequal size this is more tricky though…

4 Likes

I have tried this and it gives me one stack with no information in it …? All 909 images in the stack are black now. Not sure what happened

I adjusted the contrast but they seem to not have the same resolution

Can you share a few example stacks? Otherwise it’s a bit hard to figure out the specific issue, I’m afraid…