Landmark Image Registration of Images with different Resolutions

Hello everyone,

I am a beginner so please forgive me if this is a basic question. I am working on registering Spectralis SLO images with OCT-A images. I am using landmarks to identify points on vessels, which correlate in both scans. I suppose since both scans have different resolutions (1536x1536 vs. 1024x1024) the registration fails and produces an image like shown below. Is it possible to deal with different resolutions without having to crop the “bigger” image?

This is my code for image registration:

def register_images(self):
        if not self.fixed_image_path or not self.moving_image_path:
            return

        fixed_image = sitk.ReadImage(self.fixed_image_path)
        moving_image = sitk.ReadImage(self.moving_image_path)
       
        landmark_initializer = sitk.LandmarkBasedTransformInitializerFilter()

        fixed_landmarks = [coord for point in self.fixed_points for coord in point]
        moving_landmarks = [coord for point in self.moving_points for coord in point]

        landmark_initializer.SetFixedLandmarks(fixed_landmarks)
        landmark_initializer.SetMovingLandmarks(moving_landmarks)

        transform = sitk.AffineTransform(2)

        output_transform = landmark_initializer.Execute(transform)
  
        print(output_transform)

        output_image = sitk.Resample(moving_image, referenceImage=fixed_image, transform=output_transform)
        
        sitk.WriteImage(output_image, "landmark_example.tiff")
 
        sitk.WriteTransform(output_transform, "landmark_transform.tfm")

Here the resulting transformation:
landmark_example.tiff (2.3 MB)

Thank you for any help!

EDIT: I noticed that the pixel spacing of the fixed and moving image are different (1.0 and 0.24 respectively). I will try to compensate for that discrepancy.

Hello @luviku,

In ITK/SimpleITK registration is done in physical space, so the two images can have different sizes (number of pixels per dimension) and spacing (physical size of pixel/voxel in mm). For a better understanding of the fundamentals of the toolkit please see the fundamental concepts page and registration overview page.

Possibly also look at the registration initialization notebook, section titled Register using manual initialization. You will need to modify it slightly to accommodate for the different data dimension and transform type VersorRigid3DTransform to AffineTransform(2) etc.

1 Like

Hello @zivy ,

thanks for the response. I read through your suggestions, unfortunately I could not find a solution to my problem in the documents. What I failed to mention above, is that the two images don’t look alike. The fixed image is a photo of the eye fundus where there are barely vessels visible. The moving image is an angiography with lots of vessels visible. That is why I can only use the landmarks for registering them.

Anyway setting the spacing of the moving image to (1,1) resolved the problem, even though I am not sure if it is the right way to so.

1 Like