How DicomObjects handles Width and Level values

The Width and Level properties of an image are unusual, in that they are both stored as a part of the image, and are also transient DicomImage properties, regularly adjusted by users. This page explains the relationship between the persistent and transient values.


  1. The Persistent Values
  2. The Transient Values
  3. How they relate to each other
  4. Saving Width & Level Values

The Persistent Values

These are held in attributes 0028,1050 & 0028,1051 in the image. It is important to realise that they are optional attributes, and not every image contains these attributes. DicomObjects never changes the value of any attribute of a DicomImage or DicomDataSet unless this is specifically requested by the programmer. The values of the Width and Level attributes are no exception.

The Transient Values

These are simply properties of a DicomImage and when changed cause the image (if in a DicomViewer’s collection) to be redisplayed with a revised mapping between pixel data and screen values.

How they relate to each other

The only relationship between the persistent and transient values is that the persistent values (if present) are used to initialise the transient values when the DicomImage is first created, or if the SetDefaultWindows method is used. At this time, the following procedure is used:

Saving Width & Level Values

In general, DICOM image objects should not be altered once created and the behaviour of many PACS is unpredictable if modified images are sent to them, so changing the persistent data is discouraged, but of course this is sometimes necessary (and reasonable if you are the initial creator of an image!), in which case the values can be copied back into the image as follows:


    Image.Attributes.Add(0x0028, 0x1050, Image.Level)
    Image.Attributes.Add(0x0028, 0x1051, Image.Width)


    Image.DataSet.Add(0x0028, 0x1050, Image.Level);
    Image.DataSet.Add(0x0028, 0x1051, Image.Width);
    // or
    Image.DataSet.Add(DicomObjects.Enums.Keyword.WindowCenter, Image.Level);
    Image.DataSet.Add(DicomObjects.Enums.Keyword.WindowWidth, Image.Width);

We use cookies to give you the best possible experience on our website. By continuing to use this website, you agree with our use of cookies. for more information please click HERE