DicomGetMaxWindowLevel Method (GdPictureImaging)
                                 
                                
                                    
                                        In This Topic
                                    
                                
                                
            Returns the maximum window level of a DICOM image.
            
            
            
            Syntax
            
            
            
            
            'Declaration
 
Public Function DicomGetMaxWindowLevel( _
   ByVal  As Integer _
) As Single
             
        
            
            public float DicomGetMaxWindowLevel( 
   int 
)
             
        
            
            public function DicomGetMaxWindowLevel( 
    : Integer
): Single; 
             
        
            
            public function DicomGetMaxWindowLevel( 
    : int
) : float;
             
        
            
            public: float DicomGetMaxWindowLevel( 
   int 
) 
             
        
            
            public:
float DicomGetMaxWindowLevel( 
   int 
) 
             
        
             
        
            Parameters
- ImageID
 
- GdPicture image identifier. The DICOM image.
 
            
            Return Value
The maximum window level.
 
            
            
            
            
            
            Example
Saving the first page of a dicom document to jpeg using different window levels.
            
            
             
    
	
		using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.dcm", false);
 
    // Read the dicom properties.
    float windowWidth = gdpictureImaging.DicomGetDefaultWindowWidth(imageID);
    float windowLevel = gdpictureImaging.DicomGetMinWindowLevel(imageID);
    float maxWindowLevel = gdpictureImaging.DicomGetMaxWindowLevel(imageID);
 
    // Save different views as jpeg.
    float step = (maxWindowLevel - windowLevel) / 10;
    while (windowLevel <= maxWindowLevel)
    {
        gdpictureImaging.DicomSetWindowLevel(imageID, windowWidth, windowLevel);
        gdpictureImaging.SaveAsJPEG(imageID, "image" + windowLevel.ToString() + ".jpg", 75);
        windowLevel += step;
    }
 
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
	 
	
 
 
            
            Example
Saving the first page of a dicom document to jpeg using different window levels.
            
            using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
            {
                int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.dcm", false);
             
                // Read the dicom properties.
                float windowWidth = gdpictureImaging.DicomGetDefaultWindowWidth(imageID);
                float windowLevel = gdpictureImaging.DicomGetMinWindowLevel(imageID);
                float maxWindowLevel = gdpictureImaging.DicomGetMaxWindowLevel(imageID);
             
                // Save different views as jpeg.
                float step = (maxWindowLevel - windowLevel) / 10;
                while (windowLevel <= maxWindowLevel)
                {
                    gdpictureImaging.DicomSetWindowLevel(imageID, windowWidth, windowLevel);
                    gdpictureImaging.SaveAsJPEG(imageID, "image" + windowLevel.ToString() + ".jpg", 75);
                    windowLevel += step;
                }
             
                gdpictureImaging.ReleaseGdPictureImage(imageID);
            }
            
            
            
            See Also