简体   繁体   中英

How to change pixel intensity range of the image in matlab?

I read dicom Image in matlab. Pixel intensity range is really large. I want to rescale Pixel intensity to 0 - 1000. How Can I modify the Image ?

I would appreciate for any help please.

Be careful when rescaling DICOM image data like this. It is possible (for some images) that the actual pixel values correspond to actual units.

If you do want to rescale everything, there are a number of ways to do this.

imadjust

If you have the image processing toolbox you can use imadjust to adjust the range.

imout = imadjust(double(im), [min(im(:)), max(im(:))], [0 1000]);

mat2gray

mat2gray automatically normalizes an image between 0 and 1. You can then multiply the result by 1000.

imout = mat2gray(im) * 1000;

Manual Normalization

imout = im - min(im(:));
imout = imout * 1000 ./ max(imout(:));

尝试以下方法:

Image=((Image-min(Image(:))/max(Image(:))*1000;

You could convert the image (matrix) using the mat2gray command. Afterwards you can multiply it by your favorite factor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM