how can convert HU(hounsfield units) to grayscale??

33 views (last 30 days)
how can convert HU(hounsfield units) to grayscale. is there any command in matlab for this?
I download a file from LIDC(Lung Image Database Consortium) to start my work,it has 55 images and these images are .dcm . I am beginner so I dont know how can I use this for a segmentation project. so I read it with dicomread and I saw that the value of this is between 0-4095 then I searched in google and found that ct images have a scale that call HU. when I want to see these images in matlab I just see a black screen..I think maybey there is a way in matlab for this. in fact I think I can do segmentation method on a .jpg image but I cant start my work with this images
thanks
  1 Comment
Matt J
Matt J on 5 Sep 2014
when I want to see these images in matlab I just see a black screen
We don't know what you did to display the images. There's no reason why you wouldn't be able to view image slices over a range of values like 0-4095, using something like imagesc.

Sign in to comment.

Answers (3)

Matt J
Matt J on 5 Sep 2014
Edited: Matt J on 5 Sep 2014
I suspect the image is already grayscale if it consists of an array of HU values and not a 3D/4D array with different color channels. It would be strange to have a color CT image, to my mind, though I guess for rendering and tissue segmentation purposes you might.

Image Analyst
Image Analyst on 5 Sep 2014
Use dicomread() to read in the images. They will have values. Don't worry what they're called - HU or gray levels - just use them. I don't see why you say "I cant start my work with this images" . You can use them as-is for your segmentation. There is no problem so why do you think there is? There is even a function that reads dicom images. Did you even try to use it?
  4 Comments
sara
sara on 6 Sep 2014
Edited: sara on 6 Sep 2014
thanks Image Analyst I use this code
grayImage = dicomread('000008.dcm');
imshow(grayImage, []);
it is better and show image but it is darker than my original image..
......................... for "special image " I mean that if we have 55 images that are Different from each other but all of them are for one Patient maybe there is a way to Access all of the information from them with one command.Because when we take a CT scan image the folder that the Radiologist give us include more than one image.
Image Analyst
Image Analyst on 6 Sep 2014
Edited: Image Analyst on 6 Sep 2014
Not unless that one command is the name of a GUI that you can call up that shows the Radiologist a montage or else a single image with a listbox or scrollbar to change images. It should not be darker than your original image unless your original image had what the radiologist call window and level applied to it such that the displayed portion was a amplified intensity window. The [] option scales from min to max so in most cases it's brighter but it depends on the shape of the histogram. If you have one oddball pixel in there that is way brighter than everything else, say, some text, then it will make all the other pixels seem darker. Like if anatomy pixels have gray levels of 0-1000 but annotation is in there with gray level 65535, then all the anatomy pixels will be inthe range 0 to 1000*255/65535 and seem dark. But if the radiologist had the "original" image windowed so that 0-1000 displayed as 0-255, and the annotation would be clipped at 255 since it can't get any brighter so the image might seem brighter then. Understand? You can use imadjust to scale display between the small tails of the histogram, like the 1% points.

Sign in to comment.


Matt J
Matt J on 5 Sep 2014
Edited: Matt J on 5 Sep 2014
The reason you see a black image is that your data ranges from 0-4095, but imshow by default expects data ranging from 0 to 1 and sets the display range accordingly. You have several options for dealing with this,
  1. Normalize your imaging manually to fall within the range 0-1, e.g. Image=double( Image)/max(Image(:))
  2. Use a different display function like imagesc that will automatically scale your image as above.
  3. Don't use the default settings for imshow. Use additional input args to tell it that your data ranges from 0 to 4095.
  7 Comments
Matt J
Matt J on 6 Sep 2014
Edited: Matt J on 6 Sep 2014
You need to check the range of Hounsfield values that the your DCM viewer is windowed to. The image you've posted looks similar to what you get by doing the following in MATLAB,
imshow(m,[0,1100]);
In other words, it looks like your DCM viewer is set to a window of 0 to 1100 HU or so.
Image Analyst
Image Analyst on 6 Sep 2014
I agree. That's what I said in my last comment about there being some window and level applied that is different between the two programs.

Sign in to comment.

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!