Pixel operations

Photometric interpretation fix

Correct an inverted or mislabeled photometric interpretation.

Photometric Interpretation (0028,0004) tells a viewer how to turn stored pixel values into grey levels or colours. MONOCHROME2 shows the lowest value as black and MONOCHROME1 shows it as white; colour images use values such as RGB, YBR_FULL or PALETTE COLOR. When the value is wrong, the image displays inverted or in the wrong colours even though the pixel data is fine. dcmage fixes it by editing the tag, and checks the new value against the CS value representation.

Problem

A DICOM image has a wrong or missing Photometric Interpretation tag (0028,0004) — e.g. it says RGB but the pixel data is actually grayscale, or it says MONOCHROME1 (minimum is white) when it should be MONOCHROME2 (minimum is black). This causes images to display inverted or with wrong colors in the PACS viewer.

Steps

  1. When applying the Bake W/L pixel operation, the output is automatically set to MONOCHROME2 — verified by the e2e tests.

  2. For manual correction, open the file (⌘O), switch to Edit mode (⌘2 in the Mac app), filter for (0028,0004), double-click, and enter the correct photometric interpretation code.

Result

Baking W/L outputs MONOCHROME2 photometric interpretation, and any manual edit to Photometric Interpretation is validated against the CS VR.