Convert pixel value to HU

36 views (last 30 days)
Ahmad Abbas
Ahmad Abbas on 7 Aug 2020
Commented: Walter Roberson on 14 Aug 2020
How can I change a voxel value of a Micro CT image series to HU units ?
i need to change the voxel value and the header in dicom to use the new dicom in the treatment planning system
the linear equation i will be used to change the voxel is
y = 0.7966x-568.5
  1 Comment
Ahmad Abbas
Ahmad Abbas on 7 Aug 2020
% this is the code i used to create histogram, which help me to create the equation (tmp11) which then i convert the pixel value to HU ( i am not sure if it is correct or not )
% i am trying to save the result with the metadata and changes, please can someone help
clear
myFolder = 'C:\Users\Admin\Desktop\MATLAB\Crop cochlea';
filePattern = fullfile(myFolder, '*dcm');
theFiles = dir(filePattern);
crop=zeros(209,218,394);
for k = 1 : length(theFiles)
baseFileName = theFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n',fullFileName);
x = dicomread(fullFileName);
crop(:,:,k)=x;
end
%histogram(crop)
tmp11 = min(max (0.7966*crop -568.5, -1000),4096);
hu = uint16(tmp11);

Sign in to comment.

Accepted Answer

Gouri Chennuru
Gouri Chennuru on 14 Aug 2020
Hi Ahmad,
In order to convert the data found in CT data to Housefield Units you have to apply a linear transformation to the data.
The equation, which is used for converting into HouseField Units,
HU = pixel_value*slope +intercept
The tags are alse called as Rescale Slope and Rescale Intercept.
The slope and intercept are found in the DICOM file itself and you can read the DICOM image to MATLAB using dicomread.
Thanks & Regards,
Gouri Chennuru.

More Answers (0)

Categories

Find more on DICOM Format in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!