how to display an image's colormap onto its grayscale map?

4 ビュー (過去 30 日間)
bazinga
bazinga 2014 年 1 月 19 日
コメント済み: bazinga 2014 年 1 月 30 日
Hi everyone,
I have biomedical images (.dcm) and I need to display the colormap of each image onto its grayscale map. I.e:
Let's say my image is named as X, and Y is a processed version of X 1) imshow(X); //grayscale 2) image(Y); //colormap
These two resulting figures on top of each other.
Any suggestion would help. Thanks

回答 (1 件)

Image Analyst
Image Analyst 2014 年 1 月 20 日
Applying a colormap to one grayscale image will apply it to all grayscale images in all axes in the figure. Since that is usually not what you want, you can call freezecolors but it's probably easiest just to convert the grayscale image that you want to apply a colormap to, into a color image with ind2rgb():
imshow(X); % Show first gray scale image.
rgbImage = ind2rgb(Y, yourColorMap); % Convert second gray scale image into a color image.
imshow(rgbImage); % Display the color image.
  11 件のコメント
Walter Roberson
Walter Roberson 2014 年 1 月 30 日
tempImage = zeros(size(original), 'like', original);
Note: you could also use this code with no loop
tempImage = original;
tempImage(original <= threshold2 | original >= threshold) = 0;
bazinga
bazinga 2014 年 1 月 30 日
Oh, thank you for the shortcut :)
Yet I still get the white screen. Do you have any solution to this?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModify Image Colors についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by