Confocal images alignment issues

Hello,
I am facing a problem with ITK alignment . More specifically, when I upload my images the outpout score before alignment is usually 0,05 to 0,1 after the registration the highest score that I got is 0.7 (after cropping etc). But , when I am observing my images I can clearly see that there is no problem with my registration markers or any tissue drifting so the final score makes no sense (neiher the initial). I would like to know if there is a setting that I can play with to bring my images closer and obtain a better alignment score after registraton

Thanks a lot in advance
Spiros

Hello @Spiran,

Actually, these values do make sense for many confocal images. The reason is that there is a significant amount of noise in the background.

Even when the foreground is aligned correctly the correlation coefficient is far from 1.0, because the background contains noise. Theoretically the background should have no signal (value should be zero). To confirm the background noise hypothesis, load the volume in your free viewer of choice (e.g. Fiji, napari, imaris viewer, …) and check the background pixel values.

Hi zivy
Thanks a lot for your prompt response. I understand what you are saying and I will follow your suggestion. To be honest , most of the times the markers that I use for registration exhibit minimal background signal, is it possible that there is some initial setting wrong in my software?
Additionally, I have some difficulties understanding what does this mean about my experiment. To be more specific, does it mean that my alignment will never be correct and I will never get the proper scores for all of my cells (I align tissues and I want to extract information about the mean intensity of fluorophores that I use for each tissue cell)? Or does it mean that the alignment is efficient enough but I will never see high alignment scores because of the background that exist every time?
Thanks once again in advance

Hello @Spiran,

I assume that the question here is a crosspost of the question on the imaris extensions issue tracker. Please don’t simultaneously cross-post, and using different aliases (apologies if this isn’t you, but the question is an exact repeat of the one here). It is hard to maintain a coherent conversation when it is happening concurrently on multiple channels, and yes, the microscopy pun is intended.

I will give a general answer that is relevant to the ITK/SimpleITK community here, but as this is more specific, we should continue the discussion via the imaris extensions issue tracker.

Generally speaking, a perfect, numerical precision level, registration will yield a correlation coefficient of 1, only if the relationship between the intensities is I_2 = aI_1+b. If this is close to this, we will get a high correlation but not 1. As long as the optimum corresponds to the correct transformation we don’t really care if it is 0.7 or 0.9 which is why the correlation coefficient after registration is somewhere between a qualitative and quantitative measure of registration (more towards qualitative).

Case in point, see the toy code below with perfect registration but nonlinear intensity relationship:

import SimpleITK as sitk
import numpy as np

# Create "nucleus" image
nucleus_image1 = sitk.GaussianSource(
        outputPixelType=sitk.sitkFloat32,
        size=[256, 256],
        sigma=[32, 32],
        mean=[128, 128],
        scale=16.0,
    )
# Same image, no spatial difference so perfect registration, just change
# the intensities to be I^3
nucleus_image2 = sitk.Pow(nucleus_image1,3)

sitk.Show(nucleus_image1, "image1")
sitk.Show(nucleus_image2, "image2")

print("correlation between all image combinations ([I1,I1],[I1,I2],[I2,I1],[I2,I2])):")
print(
    np.corrcoef(
        [
            sitk.GetArrayViewFromImage(nucleus_image1).ravel(),
            sitk.GetArrayViewFromImage(nucleus_image2).ravel(),
        ]
    )
)

1 Like