how can convert HU(hounsfield units) to grayscale??
18 views (last 30 days)
Show older comments
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
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.
Answers (3)
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.
0 Comments
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
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.
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,
- Normalize your imaging manually to fall within the range 0-1, e.g. Image=double( Image)/max(Image(:))
- Use a different display function like imagesc that will automatically scale your image as above.
- 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
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
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.
See Also
Categories
Find more on Explore and Edit Images with Image Viewer App in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!