Visual Basic (Declaration) | |
---|---|
Public Function GetImage( _ ByVal element As DicomElement, _ ByVal index As Integer, _ ByVal bitsPerPixel As Integer, _ ByVal order As RasterByteOrder, _ ByVal flags As DicomGetImageFlags _ ) As RasterImage |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public RasterImage GetImage( DicomElement element, int index, int bitsPerPixel, RasterByteOrder order, DicomGetImageFlags flags ) |
Managed Extensions for C++ | |
---|---|
public: RasterImage GetImage( DicomElement* element, int index, int bitsPerPixel, RasterByteOrder order, DicomGetImageFlags flags ) |
C++/CLI | |
---|---|
public: RasterImage GetImage( DicomElement^ element, int index, int bitsPerPixel, RasterByteOrder order, DicomGetImageFlags flags ) |
Parameters
- element
- An item in the Data Set.
- index
- The zero-based index of the frame to load.
- bitsPerPixel
-
Value that represents the resulting image pixel depth. Possible values are:
Value Meaning 0 Keep the original file's pixel depth (do not convert). 1 to 8 The specified bits per pixel in the resultant image. 12 12 bits per pixel in the resultant image. 16 16 bits per pixel in the resultant image. 24 24 bits per pixel in the resultant image. 32 32 bits per pixel in the resultant image. - order
- The desired color order.
- flags
- Flags that control the behaviour of this method.
Return Value
The image of a Pixel Data element.This example will read a DICOM dataset and do a number of image related operations such as loading and saving.
Visual Basic | Copy Code |
---|---|
Public Sub TestDicomImage() |
C# | Copy Code |
---|---|
public void TestDicomImage() |
If DicomGetImageFlags.AllowRangeExpansion is set in flag, consider the following example:
If the Data Set has the following attributes:
Bits allocated 16
Bits stored 12
Pixel Range 0 - +4095
Pixel Representation is unsigned (0)
Photometric Interpretation is MONOCHROME2
Rescale Slope 1
Rescale Intercept -1024
After applying the rescale slope and the intercept:
Output minimum pixel value = (0 * 1 +(-1024)) = -1024
Output maximum pixel value = (4095 * 1 + (-1024)) = 3071
The new pixel value range (–1024 to 3071) can not be represented with the current bits stored (12 bits), which can represent values in the range (–2048 to 2048). In this case the method will change the high bit inside the image object to be 12 instead of 11 (bits stored becomes 13), which can represent values in the range (–8192 to 8191).
Please note that the method will not be able to update the high bit and/or low bit if the number of bits stored was already equal to the number of bits allocated.
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family