Obtaining the maxvalue on a dicom colormap programatically
1 view (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
Image Analyst
on 3 Feb 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 Comments
Image Analyst
on 4 Feb 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.
More Answers (0)
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!