Dicom file not displaying properly.
4 ビュー (過去 30 日間)
古いコメントを表示
I am trying to read and display dicom(.dcm) file in matlab and save it later. However, the file is not displaying properly. Please find my code below:
info=dicominfo("IMG-0012-00218.dcm");
I=dicomread(info);
figure, imshow(I,[])
h = drawfreehand; %draw something
M = ~h.createMask();
I(M) = 0;
imshow(I,[]);
imwrite(I,'Image1.png','mode','loseless')
I am unable to attach the .dcm file here as it is not allowing me to do it. I am getting the image below which is not correct. I want the image to be displayed in the way defined in 'IMG-0012-00218.png'.
0 件のコメント
回答 (1 件)
Harsha
2022 年 11 月 18 日
Hi Warid Islam
To get the output as shown in IMG-0012-00218.png you have to change the window level in the raw data.
Refer to this MATLAB answer by Simon Chan to resolve your issue.
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!