MATLAB: How can I obtain hounsfield units(HU) from a .dcm image

how can i obtain hounsfield units(hu) from a .dcm image?

hi
if I have a CT image how can I obtain hounsfield units from this… I know that we can read .dcm Image with dicomread(img)..
and I should say when I use dicomread(img) and then I want to imshow this I just see a black screen…

Best Answer

After loading your image:
yourImage = dicomread('yourImage.dcm');
You can go straight to
info = dicominfo('yourImage.dcm');
Now, you have to find your DICOM attribute that corresponds to the Hounsfield units.
This attribute leads you the the linear correlation between the voxel value in the image and the Hounsfield units.
The DICOM attribute I´m talking about is (0028, 1053), or the 'Rescale Slope' attibute.
H_unit(x,y) = voxel_value(x,y)*RescaleSlope + Intercept.
It is exactly like y = a.x + b.
You can do like this:
rSlope = info.RescaleSlope;
for j = 1 : size(yourImage, 1) % This loop multiply each voxel value by the rescale slope
for i = 1 : size(yourImage, 2)
hounsfieldImage(i,j) = yourImage(i,j)*rSlope;
end
end
figure
imshow(hounsfieldImage, 'DisplayRange', []);
Cheers
Related Question