Problem with colormap!
Ältere Kommentare anzeigen
I have a CT image (a matrix 512 x 512) that has maximum value is 2062 and minimum ones is 64. I want to show it so that the maximum pixel get white and the minimum ones get black color. I tried to use function colormap(C), with C=[a a a], a=[0:1/2000:1]'.Then used function image (CT)to show it. I imagined a color bar that begin with black (at 1) and change along with shade value to white (at 2062 or less than that a little). But i got a figure with weird color bar. It's discrete and just black and gray like the attached image (hadn't used function image(CT) yet). I'm wondering what's wrong!

1 Kommentar
Nguyen Tan Duoc
am 15 Aug. 2015
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 15 Aug. 2015
Don't use image(). Use imshow():
imshow(CT, []); % Be sure to use [].
5 Kommentare
Nguyen Tan Duoc
am 15 Aug. 2015
Bearbeitet: Nguyen Tan Duoc
am 15 Aug. 2015
Image Analyst
am 15 Aug. 2015
Was CT a floating point image (double)? That might be why. You might also need to fiddle with the caxis() function. With imshow() you don't have to worry about any of that - no need to do it manually since imshow() will do it automatically for you.
Nguyen Tan Duoc
am 15 Aug. 2015
Image Analyst
am 15 Aug. 2015
Then how did you display the image?
Nguyen Tan Duoc
am 20 Aug. 2015
Bearbeitet: Nguyen Tan Duoc
am 20 Aug. 2015
Kategorien
Mehr zu White finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
