Why image appear black and white image?
1 view (last 30 days)
Show older comments
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 Comments
Image Analyst
on 9 Oct 2020
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
on 9 Oct 2020
"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.
Answers (0)
See Also
Categories
Find more on DICOM Format in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!