Obtaining the maxvalue on a dicom colormap programatically

1 次查看(过去 30 天)
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?

采纳的回答

Image Analyst
Image Analyst 2013-2-3
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 个评论
Antonio
Antonio 2013-2-4
编辑:Antonio 2013-2-4
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 2013-2-4
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Red 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by