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.