Search code examples
javaimagepngdicomimagej

Set "window level" of a png (converted from DICOM)


So, there is this question here on SO about changing the window level of a DICOM converted into JPG.

But I have files that were converted from DICOM to PNG (32 bits) and I am supposed to make it be displayed with these properties:

(0028,1050) WindowCenter DS # 6 1 [382.0]

(0028,1051) WindowWidth DS # 6 1 [672.0]

I couldn't really understand how to relate those to a PNG.

//(I am using Java and ImageJ but wouldn't mind using a third party tool for this)

What kind of operations I have to perform on the PNGs to meet such criteria?


Solution

  • Please refer to PS 3.3 section C.11.2.1.2 of the DICOM Standard for explanation of Window Center and Window Width. This section includes pseudo code showing how to apply Window Level to extended grayscale image (e.g. over 8 bits per pixel gray value in the pixel data element). Also, note that you may need to apply the Modality LUT transformation if dataset contains Rescale Slope (0028, 1053) and Rescale Intercept (0028, 1052) before applying the VOI LUT transformation (e.g. applying Window Center and Window Width). Please refer to table C.11-1b under section C.11.1 for information on how to apply Modality LUT transformation.