Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
bazinga
bazinga el 19 de En. de 2014
Comentada: bazinga el 30 de En. de 2014
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

Respuestas (1)

Image Analyst
Image Analyst el 20 de En. de 2014
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 comentarios
Walter Roberson
Walter Roberson el 30 de En. de 2014
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 el 30 de En. de 2014
Oh, thank you for the shortcut :)
Yet I still get the white screen. Do you have any solution to this?

Iniciar sesión para comentar.

Categorías

Más información sobre Modify Image Colors en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by