Borrar filtros
Borrar filtros

How can I change a pixel value of a CT image series to display HU.

8 visualizaciones (últimos 30 días)
Dan Smith
Dan Smith el 20 de Nov. de 2018
Editada: Dan Smith el 22 de Nov. de 2018
How can I change a pixel value of a CT image series stored as a variable in Matlab format to HU units,.... as in how can I subtract 1024 from all the pixels so they display in matlab as HUs?

Respuestas (1)

Nick
Nick el 20 de Nov. de 2018
Your question is not really clear to what your intent is. If you just want to subtract 1024 of each pixel it would be:
HUImage = CTImage-1024;
Ofcourse you would need to make sure you have a value type that can be less that 0 so you could make sure it is capable of being signed for example int16's or doubles:
HUImage = int16(CTImage)-1024; % this is assuming your CT image is something like: uint16 or so which seems unlikely
% or
HUImage = double(CTImage)-1024;
% then display it using something like:
imshow(HUImage, []) % rescale to min and max value
% or
imshow(HUImage,[-1000 2000]) % set display range yourself, outliers will be black for lower than -1000 or white for higher than 2000
But houndsfield units are not just subtracting a certain value from some image, it is a relationship of the average linear attentuation coefficient inside a voxel compared to this of water and air:
If your CTImage is a doubles array of linear attenuation coefficients then you need to know the linear attentuation coefficients of water and air and could turn the image into HU using:
uWater % linear att water
uAir % linear att air -> uAir is so much smaller than uWater that u can prolly ignore this
linearAttCoef = double(CTImage); % already assuming its double but just putting it here
% calculate HU from linear attenuation coefficients
HUImage = ((linearAttCoef - uWater)./(uWater - uAir)) .* 1000; % HU unit conversion formula
Hopefully this clears out enough for you, without more information on your problem we cannot answer your question fully.
  1 comentario
Dan Smith
Dan Smith el 21 de Nov. de 2018
Editada: Dan Smith el 22 de Nov. de 2018
Thank you for your reply. I ran CERR on CT dicom files to create one mat file that has a variable planC containing the image data. I then took planC (a 1x25 cell) with code imagesc(CTimgmat(:,:,200)) to display the image and compared the x,y,index position/value to that which is displayed for the dicom images in OSIRIX or any other viewer that displays the pixels in HU units. The two didn't match up by about a thousand but it differs pixel to pixel. My goal is to run imagesc(CTimgmat(:,:,"slice#")) and have index # display as HU.
I applied your equation above but values still don't match up to HU

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by