// blog

DICOM Rescale Slope and Intercept: How CT Numbers Become Hounsfield Units

A CT file stores raw numbers; Rescale Slope (0028,1053) and Rescale Intercept (0028,1052) turn them into the modality’s unit: value = stored × slope + intercept. Many CT files use slope 1 and intercept -1024, so a stored 1076 becomes 52 Hounsfield units. Apply the rescale before the window, per file (it can differ between files), and mind whether the pixels are signed (Pixel Representation, 0028,0103).

Last updated 2 min read

Rescale Slope and Intercept: stored 1076 times slope 1 plus intercept -1024 equals 52 HU, next to a chest CT

Point at a CT in our viewer and the corner shows a value in Hounsfield units (HU): about -1000 for air, 0 for water. The file doesn’t store those numbers. It stores raw values and two tags that convert them.

The formula

text
output = stored × Rescale Slope + Rescale Intercept
  • Rescale Intercept (0028,1052) and Rescale Slope (0028,1053), both decimal strings.
  • Rescale Type (0028,1054), when present, names the unit: HU on CT.

A real example

Our chest CT sample has:

text
(0028,1052) DS [-1024]   RescaleIntercept
(0028,1053) DS [1]       RescaleSlope
(0028,0101) US 12        BitsStored

So a stored value of 1076 is 1076 × 1 - 1024 = 52 HU. The 12 stored bits give 0 to 4,095, which maps to -1024 to 3071 HU. Hounsfield units are defined so that water is 0 and air is about -1000; that’s physics, which is why a fixed intercept of -1024 works so often.

Where it goes in the pipeline

  1. Read the stored value (mind the sign, below).
  2. Rescale to the modality’s unit.
  3. Window (center and width, in that unit) to choose which values become black to white. See Window Center and Width.
  4. Invert if the file is MONOCHROME1.

The standard calls step 2 the Modality LUT. Most files use the linear rescale above; a few carry a lookup table instead (the Modality LUT Sequence, 0028,3000).

Bugs we see

  • Forgetting the intercept. Everything is 1,024 too high, so the lung preset shows bone and the value under the pointer is wrong.
  • Reading the rescale once per series. It belongs to each file and can change between slices.
  • Ignoring the sign. Pixel Representation (0028,0103) = 1 means the stored values are signed. Read them as unsigned and negative numbers wrap to huge ones. Our viewer shifts signed values into an unsigned range and undoes the shift in the rescale.
  • Parsing DS as a number blindly. DS is text and may have spaces or a leading +; trim before parsing.

In code

js
const slope = parseFloat(tags.RescaleSlope ?? "1");
const intercept = parseFloat(tags.RescaleIntercept ?? "0");
const hu = stored * slope + intercept;

Key takeaways

  • HU = stored × (0028,1053) + (0028,1052).
  • Slope 1 and intercept -1024 are common on CT; read them anyway, per file.
  • Rescale first, then window, then invert for MONOCHROME1.
  • Check Pixel Representation for signed pixels.

See Hounsfield units under the pointer →

We’re glad to share what we know. When you want a viewer or portal of your own, we’ll put all of it to work on your project, and because we build with AI-assisted development, it costs far less than you might expect. Let’s talk.

Frequently asked questions

Is the rescale always to Hounsfield units?

On CT, yes: Rescale Type (0028,1054), when present, says HU. Other modalities use the rescale for other units, or not at all; many MR files have no rescale, or slope 1 and intercept 0.

Can the slope and intercept differ between slices?

Yes. They belong to each file (or, in enhanced multi-frame files, each frame), so read them per image rather than once per series.

Should the window be applied before or after the rescale?

After. Window Center and Width are in the rescaled units, so on CT a soft-tissue window of 40/400 is in Hounsfield units.

Sources

  1. DICOM PS3.3: Modality LUT Module (Rescale Slope and Intercept)
  2. DICOM PS3.3: CT Image Module