Equalize grayscale of two dicom images and subtract
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I want to compare two dicom images, see figures below. I want to know whether there is a difference in size between the two 'circles'. To visualize this, I want to subtract the two images to see if a 'ring' remains (something like the figure below).
However the problem is that the two dicom images have a different grayscale. So therefore I first have to equalize the two grayscales. After that I can subtract the two images (I think...?).
I hope I explained clearly what I want to achieve, I am quite new to matlab. Hope someone can help. Thanks!!
0 个评论
回答(1 个)
Priysha LNU
2020-11-24
Hi,
You may use 'dicomread()' MATLAB function to read both image files into MATLAB. For detailed information of this function, you may refer to the following documentation link:
Read both images as:
Im1 = dicomread('Fig1.dcm');
Im2 = dicomread('Fig2.dcm');
Having read both the image files, you can then display the difference in images by:
imshow(Im2 - Im1);
This will show a single image with difference in pixels of the two input images.
You can also display following different types of errors in MATLAB:
(Im2 - Im1) % Errors
(Im2 - Im1).^2 % Squared Error
mean((Im2 - Im1).^2) % Mean Squared Error
RMSE = sqrt(mean((Im2 - Im1).^2)); % Root Mean Squared Error
Hope this helps!
DISCLAIMER: These are my own views and in no way depict those of MathWorks.
2 个评论
Tain Neupane
2023-4-20
Hi Priysha,
I am wondering if you have a folder with multiple dicom images (like CT/PET slices), how do you compare ? I mean how do you loop in? I need help with this! Thank you in advance!
-Tain
Image Analyst
2023-4-20
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!