Image Registration
(KAWASAKI DISEASE)-(CT &MRI)
(KAWASAKI DISEASE)-(CT &MRI)
img1 = imread("MRI.jpg");
img2 = imread("CT.jpg");
% Convert the images to grayscale
gray1 = rgb2gray(img1);
gray2 = rgb2gray(img2);
% Find the offset between the two images using the correlation coefficient
c = normxcorr2(gray1, gray2);
[maxValue, maxIndex] = max(abs(c(:)));
[maxRow, maxCol] = ind2sub(size(c), maxIndex(1));
offsetRow = maxRow - size(gray1, 1);
offsetCol = maxCol - size(gray1, 2);
% Apply the offset to the second image
registeredImg = imtranslate(img2, [-offsetCol, -offsetRow]);
% Display the results
figure;
subplot(2,2,1);
imshow(img1);
title('MRI IMAGE');
subplot(2,2,2);
imshow(img2);
title('CT IMAGE');
subplot(2,2,3);
imshow(registeredImg);
title('REGISTERED IMAGE');