How to get auto WLWW with SImpleITK in JAVA

For example, Radiant dicom viewer has “auto window level window width” preset marked as default, that is different for each dicom file.

opening dicom file 1:
image

opening dicom file 2:
image

opening dicom file 3:
image

The question is, how could i get the same values with simpleitk? Even an python or c++ code would help me

Hello @Salu_Ramos,

Default values may be available in the DICOM file header, relevant tags are window-width (0028|1051) and window-center (0028|1050). If these are in the file header use them. If not, use the whole intensity range as the window and the center of the range as the level. In both cases allow the user to change the W/L settings.

3 Likes