Borrar filtros
Borrar filtros

Obtaining the maxvalue on a dicom colormap programatically

1 visualización (últimos 30 días)
while using
[dicom_data,color_map] = dicomread('dicomfile.dcm');
I get this as color_map:
[]
and running max(color_map) return the same.
If I examine the the image via the colormap editor I can find that the ColorDataMax is 3627 on one dicom image and 2627 on another.
new_colormap = gray(3627)
works fine on one image and
new_colormap = gray(2627)
on the other, but I want to expand the colormap programmatically without losing info, so I need to know what's the top gray value on each colormap.
How can I do this?

Respuesta aceptada

Image Analyst
Image Analyst el 3 de Feb. de 2013
The max gray levels are 3627 and 2627. But I don't know what your plans are for new_colormap. You can't have more than 256 gray levels if you want to display the image and use a gray scale colormap.
  2 comentarios
Antonio
Antonio el 4 de Feb. de 2013
Editada: Antonio el 4 de Feb. de 2013
Sorry, I may have phrased this ambiguously,I know the top levels are those, but I got them via the colormap editor. I want to know how to get them via the program, that means, without using the colormap editor.
Also, I don't understand what you say about the 256 gray levels. Using gray(256) as a colormap damages my image, but using gray(3627) does not (in the case of the image with that top intensity).
Image Analyst
Image Analyst el 4 de Feb. de 2013
You can get the max and min this way:
minValue = min(dicom_data(:));
maxValue = max(dicom_data(:));
Depends on how you're displaying the image (like if you're using [] or not in imshow) -- but use whatever colormap works for you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Red en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by