Distinct NaN from other values in image
Mostra commenti meno recenti
I want to plot image with different values and easily distinct them from NaN values. As default NaN values are imaged with the same color as the minimum value. I have tried a range of possibilites but each provide their own issue. Here is one example:
imagesc(CP)
sc(isnan(CP), 'bone', [1 1 1]);
3 Commenti
Agnete
il 25 Nov 2013
Image Analyst
il 25 Nov 2013
The answer has been accepted. I don't see a question in the last comment. And no m-file was attached.
Oliver Woodford
il 2 Gen 2014
You did not use sc correctly. Try:
sc(CP, 'bone', 'r')
Risposta accettata
Più risposte (1)
Image Analyst
il 20 Nov 2013
I don't know what "plot" means when talking about an image. I don't know why you want to plot anything on an image, like markers to "cover up" the nan locations. Why not just set the nan's to the min gray level and view it like a normal image?
CP(isnan(CP)) = min(CP(:)); % Set nan values to the min value
image(CP);
colormap(bone(256));
colorbar;
3 Commenti
Agnete
il 21 Nov 2013
Agnete
il 21 Nov 2013
Image Analyst
il 22 Nov 2013
Sorry but I don't understand this. One just sort of looks like a very blurred version of the other. Both have the same pattern of triangles on them, and I don't even know what a triangle means/represents. Your image is an array. You can't have nan values have the same value as your minimum value. An element can have only one value, either a nan or some number. It can't have both at the same time. So "Nan values are imaged with the same color as my minimum value" makes no sense to me.
Categorie
Scopri di più su Images in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!