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





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

Parameters

ImageID
GdPicture image identifier. The DICOM image.

Return Value

The maximum 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 widths.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.dcm", false);
 
    // Read the dicom properties.
    float windowWidth = gdpictureImaging.DicomGetDefaultWindowWidth(imageID);
    float maxWindowWidth = gdpictureImaging.DicomGetMaxWindowWidth(imageID);
    float windowLevel = gdpictureImaging.DicomGetDefaultWindowLevel(imageID);
 
    // Save different views as jpeg.
    float step = (maxWindowWidth - windowWidth) / 10;
    while (windowWidth <= maxWindowWidth)
    {
        gdpictureImaging.DicomSetWindowLevel(imageID, windowWidth, windowLevel);
        gdpictureImaging.SaveAsJPEG(imageID, "image" + windowWidth.ToString() + ".jpg", 75);
        windowWidth += step;
    }
 
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also