Equalize grayscale of two dicom images and subtract
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/418213/image.png)
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 Kommentare
Antworten (1)
Priysha LNU
am 24 Nov. 2020
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 Kommentare
Tain Neupane
am 20 Apr. 2023
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
am 20 Apr. 2023
Siehe auch
Kategorien
Mehr zu DICOM Format finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!