Why image appear black and white image?
1 回表示 (過去 30 日間)
古いコメントを表示
i convert 3 d image to 2 d image. Then I have used the imwrite function. But image was appeared the black and white image. Why?
5 件のコメント
Image Analyst
2020 年 10 月 9 日
What is the class of (the poorly-named) c? Is it double or uint8 or uint16?
You forgot to attach your file so we can't run your code.
You need to put v.jpg in single quotes otherwise it will think that v is a structure and the jpg field of that structure is a character array, which is not what I think it is.
imwrite(c, 'v.jpg');
Do not use JPG for image analysis - it introduces bad compression artifacts. Use PNG format instead.
imwrite(c, 'v.png');
What does this show in the command window
whos a
whos b
whos c
Rik
2020 年 10 月 9 日
"Do not use JPG for image analysis - it introduces bad compression artifacts. Use PNG format instead."
I whole-heartedly agree, but in medical imaging it appears to be common to convert perfectly good 12 bit precision DICOM files to JPEG. I don't understand why, but that seems to be the standard. Judging by the use of niftiread I assume this is a medical purpose as well, meaning this might just be conforming with the input requirements of the next step in the pipeline.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!