MATLAB Answers

Working with dicom images

18 ビュー (過去 30 日間)
Sparkle89
Sparkle89 2019 年 3 月 12 日
コメント済み: Sparkle89 2019 年 3 月 12 日
I am working on a dataset of dicom images.
I tried reading the images using the code below:
img = dicomread(path) % path is the filename of the image
img is stored as type uint16.
Next, I need to calculate HU values[Hounsfield] for the image.
info = dicominfo(path);
b = info.RescaleIntercept;
m = info.RescaleScale;
HU = m .* img + b;
As per the HU values given in the link, range for lung is -700 to -600[Image contains lung, I am able to see the HU values in a dicom viewer]. But as HU is of type uint16, it doesn't contain negative values at all. How can I extract the HU values as such and plot a histogram?

  0 件のコメント

サインインしてコメントする。

採用された回答

Rik
Rik 2019 年 3 月 12 日
You need to convert to either a double or a int16 (before applying the subtraction). The latter only has a maximum half as high as uint16, but since CT is almost always 12 bits, that should be fine. (16 bit CT dicom is sometimes referred to as extended CT scale)

  1 件のコメント

Sparkle89
Sparkle89 2019 年 3 月 12 日
Thank you. It worked!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by