DicomGetMinWindowLevel Method (GdPictureImaging)
In This Topic
Returns the minimum window level of a DICOM image.
Syntax
'Declaration
Public Function DicomGetMinWindowLevel( _
ByVal As Integer _
) As Single
public float DicomGetMinWindowLevel(
int
)
public function DicomGetMinWindowLevel(
: Integer
): Single;
public function DicomGetMinWindowLevel(
: int
) : float;
public: float DicomGetMinWindowLevel(
int
)
public:
float DicomGetMinWindowLevel(
int
)
Parameters
- ImageID
- GdPicture image identifier. The DICOM image.
Return Value
The minimum 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