1

When i get a Drawing.image from Dicom.imaging.DicomImage.RenderImage() using fellow oak Dicom, that image has just RGB values but i need hounsfield units.

How to get hounsfield units? I need a sample code plz. Thank you.

Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114
Chani
  • 13
  • 4
  • 2
    All of your words make sense but it's like you are speaking a different language. I think it's just that I'm unfamiliar with Dicom and Hounsfield units but I'm not completely sure you aren't a BOT. – Kevin Apr 10 '14 at 14:49
  • No definitely C#. I found this website but i didn't understand how to get hounsfield. can anyone explain about it or give a sample code? https://groups.google.com/forum/#!searchin/fo-dicom/hu/fo-dicom/g058rvCBddQ/3LK02mYhvBcJ – Chani Apr 10 '14 at 15:10

1 Answers1

2

If you have a CT image, then there's a standard way to convert pixel values to Hounsfield units.

First, a couple words of caution.

First, normally, CT images should contain greyscale pixel values, and that's what you want to use. You can tell the type stored pixel values by examining the Photometric Interpretation (0028,0004) tag. Hopefully, it is "MONOCHROME2", and your image contains greyscale pixel values. (In the unlikely event that Photometric Interpretation is "MONOCHROME1", check with the source of the images to see if you can get "MONOCHROME2", instead.) If you are seeing RGB values, it might be that something in your toolkit is converting them (possibly for display), and that's not what you want. You want to use the actual stored pixels from Pixel Data (7FE0,0010).

Second, everything I'm saying relates to the traditional CT Image Information Object (IOD). If you have an Enhanced CT Image, details may change. If you have a Secondary Capture image, then all bets are off.

For CT images, there's a linear conversion from stored pixel values to Hounsfield units, using the values Rescale Slope (0028,1053) and Rescale Intercept (0028,1052):

Hounsfield units = (Rescale Slope * Pixel Value) + Rescale Intercept

(Note: Other types of images can have a look-up table in place of their equivalent of this formula. For CT, you don't have to worry about that.)

Hope this helps.

  • I have a CT image (MONOCHROME2). I do not have Rescale Slope and Rescale Intercept values in the metadata of my image. How can I calculate HU in this case? – Trisa Biswas Sep 05 '18 at 06:46
  • 1
    You might be out of luck. See whether the metadata contains SOP Class UID (0008,0016). If so, and it is 1.2.840.10008.5.1.4.1.1.2, then you have a traditional CT Image, and by rights it is supposed to have the rescale values. If it is 1.2.840.10008.5.1.4.1.1.2.1, then you have an Enhanced CT Image, which also is supposed to have rescale values, but you need to look in a different place. If it is 1.2.840.10008.5.1.4.1.1.7, then you have a Secondary Capture Image, and that's really just a picture, without the metadata you need. – Dan Konigsbach Oct 09 '18 at 21:35
  • Hi @DanKonigsbach Is "Pixel Value" in the formula above the IPixelData output when running PixelDataFactory.Create(pixelData, 0); where e.g. pixelData=DicomPixelData.Create(dicomFile.Dataset, false); ? For this IPixelData GetMinMax() I get -2048 and 1013. Rescale Intercept=0 and Rescale Slope=1, so in my case Hounsfield unit would be the Pixel Value input in your formula – Sergio Solorzano Jan 31 '22 at 19:09
  • apologies, I missed adding that I run 93 images (full axial) and min max of all was Max:3740 and Min:-2048 – Sergio Solorzano Jan 31 '22 at 19:55