필터 지우기
필터 지우기

Obtaining the maxvalue on a dicom colormap programatically

조회 수: 1 (최근 30일)
Antonio
Antonio 2013년 2월 3일
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