Equalize grayscale of two dicom images and subtract
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Priysha LNU
el 24 de Nov. de 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 comentarios
Tain Neupane
el 20 de Abr. de 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
el 20 de Abr. de 2023
Ver también
Categorías
Más información sobre DICOM Format en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!