Align images in a z-stack

Hi, I have a Z stack of 25 images that I want to use to make a projection for subsequent segmentation and measurement of fibres that are in a 3d matrix. The problem is the stack was acquired on a new microscope that has some alignment problems as the Z is changed (the frame moves slightly in the x,y direction with each subsequent Z), thus the resulting projection as would be expected is blurry. While I wait for nikon to make a service call, and even after (to have a robust workflow that can work even if there is some misalignment problems), I hoped to use the ‘align’ module to align each subsequent Z frame to the first Z frame. However after trying it, and if I understand the help, it seems you can only align one image (channel) against another channel. Any way to get it to work for each image cycle against the first image?

Thanks, Keith

Hi Keith,

One possible approach is to use two pipelines: one to extract and save the first image of the z-stack, and then a second pipeline to read in the saved image using LoadSingleImage and refer to that image as the first input image to Align. Not the most streamlined solution, but it’s workable in the time frame you have.


Note that the approach Mark describes also would work to align all images in a time-series to the first image of the time-series, for those of you working with time-lapse movies.

There are a couple of other approaches to aligning images in a stack listed at a related post here:
Loading images sequentially with overlap - but I have to say that Mark’s approach is definitely the easiest to understand. The approach I suggested Fri Oct 15, 2010 7:09 pm in the “Loading images sequentially with overlap” topic would allow you to do the whole analysis in a single pipeline, but getting the settings right for grouping by metadata can be tricky. Lee’s approach (Thu Oct 14, 2010 6:57 pm) also allows you to complete the analysis in a single pipeline, but would require you to create the text file appropriate to the data set, which may not be convenient.

Hopefully, among all these suggestions you can find one that is the right balance!