GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / DicomGetMaxWindowLevel Method
GdPicture image identifier. The DICOM image.
Example





In This Topic
DicomGetMaxWindowLevel Method (GdPictureImaging)
In This Topic
Returns the maximum window level of a DICOM image.
Syntax
'Declaration
 
Public Function DicomGetMaxWindowLevel( _
   ByVal ImageID As Integer _
) As Single
public float DicomGetMaxWindowLevel( 
   int ImageID
)
public function DicomGetMaxWindowLevel( 
    ImageID: Integer
): Single; 
public function DicomGetMaxWindowLevel( 
   ImageID : int
) : float;
public: float DicomGetMaxWindowLevel( 
   int ImageID
) 
public:
float DicomGetMaxWindowLevel( 
   int ImageID
) 

Parameters

ImageID
GdPicture image identifier. The DICOM image.

Return Value

The maximum window level.
Remarks
Use the GetStat() method to determine if the method succeeded.
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