Multichannel CLIJx_translation Timelapse Registration

Hi @haesleinhuepf,

I really like the CLIJx_translation Timelapse Registration command.
Is there a trick to do it on a multi channel Timelapse ?

 run("CLIJ Macro Extensions", "cl_device=[GeForce RTX 2060]");

// translation timelapse registration
image1 = "Image 23-Airyscan Processing-1.czi";
image2 = "translation_timelapse_registration1890855962";
Ext.CLIJx_translationTimelapseRegistration(image1, image2);

Thank you !

1 Like

Hey @LPUoO,

awesome! I almost forgot about this prototype for image registration in CLIJx. So CLIJ, CLIJ2 and CLIJx don’t know what frames and channels are. They all only can deal with 2D or 3D images. There is a project on the way improving on this. However, it’s too early to talk about it in detail. However, I think you could adapt a macro which does the same. You then also have more flexibility.

The underlying algorithm is simple: Thresholding + centroid determination in every frame and then aligning the frames according to differences in centroid positions between frames:

In order to make that work for multiple channels, one would have to a) take a transformation from channel 1 and apply it to channel 2 or alternatively: Combine transformations of two channels to get a “better average” transformation. As writing this in Java might be a bit more involved, you may want to look at the macro code here which does almost the same:

One note: In CLIJ2, there is a getCenterOfMass function, which is a bit more convenient than the one I used in that macro. Furthermore, in order to process channel stacks individually (but apply the same transformation to them), you may want to call pushCurrentZStack (sorry, documentation missing). The rest should be pretty straigt forward: save translation vectors per frame in order to apply them to a different channel afterwards…

Let me know if you need assistance! I’m happy to help. :slight_smile:


1 Like