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





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

Parameters

ImageID
GdPicture image identifier. The DICOM image.

Return Value

The default window width.
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