0

I could only find a reference explaining how to get the Hounsfield value using the Fellow Oak library which says it's determined by formula

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

Is "Pixel Value" in this formula above the IPixelData data resulting from the Create Method in PixelDataFactory?

For the MONOCHROME2 image dataset I'm working with the DicomPixelData is BitsAllocated=16 BitsDepth.BitStored=16. The PixelDataFactor.Create method returns GrayscalePixelData16S IPixelData and this data for all images ranges in values (using MinMax()) -2048 and 1013). I generate this IPixelData.Data with:

var dicomFile = DicomFile.Open(string.Concat(path, "/", file.Name));
DicomPixelData pixelData = DicomPixelData.Create(dicomFile.Dataset, false);
var pixelDataRender = PixelDataFactory.Create(pixelData, 0);

For the 95 axial images I'm working with, the Rescale Intercept=0 and Rescale Slope=1, so in my case Hounsfield unit would be the "Pixel Value" input in the formula shown in the stackoverflow post.

References I could find say Hounsfield value ranges -1024 HU to 3071 HU, does that mean the resulting IPixelData data is not the Hounsfield value? ultimately, how then can I get the Hounsfield field using the fellow oak lib?

E_net4
  • 27,810
  • 13
  • 101
  • 139
Sergio Solorzano
  • 476
  • 9
  • 29
  • 1
    Rescale Intercept=0 and Rescale Slope=1 ususally means that the data is already in Hounsfield units, or the Modality is buggy (both happens). The default for CT is -1024/1 (I assume you are speaking about CT images). And yes, the pixel data in the formula are the raw pixel data. – MrBean Bremen Feb 02 '22 at 13:25
  • Hi @MrBeanBremen yes CT. What do you mean by Raw pixel data, the GrayscalePixelData16S PixelDataFactory.Create returned for example? – Sergio Solorzano Feb 02 '22 at 13:37
  • But the Max-Min range i'm getting for this IPixelData is -2048 and 1013 , that's way off the default -1024/1 hounsfield range for CT you pointed to @MrBeanBremen? – Sergio Solorzano Feb 02 '22 at 13:52
  • 1
    That's not the range, but the default RescaleIntercept/RescaleSlope for CT, but the values look indeed wrong. -1000 is air, so the minimum looks strange... – MrBean Bremen Feb 02 '22 at 14:09
  • For anyone that may be looking for the same, I've added the link to the definition of the GrayscalePixelData16S Class. This class has 1 GrayscalePixelData16S.Component so it's grayscale pixel data and the returned values are signed short, hence range -32,768 to 32,767. The MinMax range for all the axial images I'm working on is still confusing when compared to the signed short 65K range and also to the Hu value ranges -1024 to 3071. That why I fail to see how the signed short GrayscalePixelData16S values = Hu values. – Sergio Solorzano Feb 02 '22 at 17:47
  • 1
    As I wrote, the GrayscalePixelData16S are the raw data, and if your range is -2048 to 1013 possibly your data is just wrong. One possibility is that the original rescale slope has been applied twice due to some preprocessing error, but that depends on the origin of the data - you have to check with the manufacturer / modality technician or whoever was responsible was creating and/or modifying the data. – MrBean Bremen Feb 03 '22 at 06:37

1 Answers1

0

In case it helps anyone, I think the GrayscalePixelData16S data was correct. In fact the images view correctly. I had not considered converting the 16 bit of data to select the data to display. So I changed the approach - instead of taking raw pixel data as hounsfield values, in the case of the data I'm using I applied default linear function for window center and width as a way to reach for hounsfield values, meaning I change window width/center to target houndsfield values.

If VOI LUT Function (0028,1056) is absent or has a value of LINEAR, Window Center (0028,1050) and Window Width (0028,1051) specify a linear conversion from stored pixel values (after any Modality LUT or Rescale Slope and Intercept specified in the IOD have been applied) to values to be displayed.

Sergio Solorzano
  • 476
  • 9
  • 29