pythonimagenormalizationpixelmedical-imaging

Python - Convert pixel value to Hounsfield Units


I'm working on image chest scans, I am trying to convert pixel values on Hounsfield Units.

I'm using python for that purpose, my scans have different ranges and the problem is, window of (width of 3200, and center of 450)?

How can I make those scans have normal ranges (shift the hounsfield units) for me to work normally on with a window of (width of 800, and center of 150)?


Solution

  • I am not very familiar with Hounsfield units and I am not sure about the "windows" you mention. Normally, I would associate windows with an "area process" where any given pixel's new value is partially determined by its neighbours within a given area.

    If, however, you mean a pure "point process" where any given pixel's new value is solely determined by a function of its old value, you can proceed as follows:

    1. Subtract 450 so the value is centred on zero with a range of 3200
    2. Divide by 4 so the range is 800
    3. Add 150 to re-centre

    So, in concrete terms:

    new = (old - 450)/4 + 150