Image alignment



This is my first post in this forum, so please tell me if I am missing to provide the necessary information to fully understand and answer my question or if a similar question has already been answered. So far I could find no good solution for my question:

I have three images (A, B, C) of the same tissue region. A and C consist of three different channels, B of 2 different channels. The first channel of each stack has marked the nuclei of the cells and should serve as reference for overlaying them. In the end I want a picture with with channel 2 of Stack A, channel 2 of Stack B and channel 2 and 3 of Channel C.

I tried using stackreg, but it seems not to be able to handle differnt channel numbers.
Has anyone already done something similar or can help me nevertheless?

Best Regards,


Hi @Maddonix,

Can you be more specific about what you mean? Does it crash? Or give a bad results?

From the StackReg site:

When a stack of color images is provided, the registration proceeds on a grayscale version that is built as a weighted sum of the red, green, and blue components—even when the stack is pseudo-color.

So I would expect it should be able to handle several channels in principle. I would not expect it to work well if you give it images with different numbers of channels (or where any channels representing different measurements).

It may instead be better to:

  1. extract those channels that are most similar across your images.
  2. Register those channels
  3. Apply that transformation to the other channels.

(this is a pretty typical workflow).
But it all depends on what your images are / what the channels measure.

Hope that’s helpful, and look forward to hearing back


So, my interpretation of your post is a bit different then the one @bogovicj has. Nonetheless, my suggestion would be more or less the same as his. My understanding is that you have 3 channel stacks; each file contains slices with each slice corresponding to a channel. In that case, you can run the duplicate command on the channels you want to use for alignment. Then combine the duplicates into a stack and use StackReg. StackReg will save the parameters of the transformations in the Results table. From there, you can retrieve them and use the values to “manually” transforms the desired channels.


@Maddonix, why don’t you add an empty channel to your 2-channel image B? Then all three images have three channels. After registration merge the desired channels in a new image. You just have to think of how you want to display 4 channels in one image, lest making a montage of monochrome images.


Thank you very much for your answers!
Right now I am busy with other experiments which have a higher priority, but I will definitly come back to this topic as soon as I tried your recommendations.

Best Regards,