Equalize grayscale of two dicom images and subtract
5 ビュー (過去 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).
![](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 件のコメント
回答 (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!