Where possible, DicomObjects sets the initial values of Width and Level using attributes (0028,1050) & (0028,1051) in the file itself, but where these are not present, it calculates the values by measuring the range of pixel values. The values may of course be subsequently changed, and this method is therefore useful either to reset to initial values, or to calculate suitable "guess" values when new images are created, or when the pixel data itself is changed.
DicomImage image = new DicomImage("your_dicom_image.dcm");
image.SetDefaultWindows();
// Check the new windows values
var width = image.Width; // Example result: 350
var level = image.Level; // Example result: 35