How to register high resolution images of same modality?

4 views (last 30 days)
I have two large tif images (~35000x37000) in grayscale and i'm having trouble registering them. Because of the large resolution, I initially tried downsampling them by a factor of 16, performing intensity-based registration using imregister, and then applying the transform to the original high-resolution image. The issue is I'm unsure how to take into account the scaling factor into the transform matrix.
Another approach I tried was to binarize the images and then perform phase correlation registration, but that had led to an out-of-memory problem. I also tried doing the imregister on the original full-resolution images but it didn't complete quickly (>4 hours). I'd appreciate any suggestions or advice.

Answers (1)

Jan
Jan on 27 Apr 2022
If you image is stored in double format, it uses 10 GB of RAM. On a 64 GB machine this should work. So is installing more RAM an option?
"The issue is I'm unsure how to take into account the scaling factor into the transform matrix." - this is much easier to answer, if you post the corresponding code.
  1 Comment
Aditya Misra
Aditya Misra on 27 Apr 2022
So I do have a 64 GB machine. These are uint16 images. It doesn't occupy much space until I begin imregcorr or imregtform, at which point most of the RAM is taken up. When I performed imregcorr on the full size (i.e. not downsampled) binarized images, it ran out of memory.
As for code, here's what I did. Looking at the screenshot of the overlay, it's not exactly registered so any feedback would be great!
% These are binarized versions of the images, which I downsampled by factor
% of 4 using the nearest method
im_movingB = imresize(im_movingB,1/4,'nearest');
im_fixedB = imresize(im_fixedB,1/4,'nearest');
% Then I begin to perform phase correlation based registration.
tic
tformEstimate = imregcorr(im_movingB,im_fixedB);
toc
% Here I take the transform matrix and multiply the translation by the
% downsampling scale factor
tformEst_new = tformEstimate;
tformEst_new.T(3,1:2) = tformEst_new.T(3,1:2)*4;
% I then apply the scaled transform to the original, non-binarized moving
% images
im_movingR = imwarp(im_moving,tformEst_new,'OutputView',imref2d(size(im_fixed)));
% I then overlay and check the alignment.
imshowpair(im_fixed,im_movingR,'falsecolor')

Sign in to comment.

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!