An example program to demonstrate various techniques for getting and using pixel data from a DICOM dataset. If you wish to acquire window-leveled Bitmaps, see theclass which uses these techniques.
Assembly: GetPixelData (in GetPixelData.exe) Version: DCF34 r12431 DCF_3_4_38_20200923 NetFramework
public class Program
Thetype exposes the following members.
Initializes a new instance of theclass
Main entry point for GetPixelData.
Theinterface provides methods for loading and acquiring the pixel data in several different formats. One creates a FrameProducer with the or the factory methods. The decoded raw pixels for a frame are acquired using either , or . The encapsulated (compressed) data stream for an image frame may be extracted using the method. The entire encapsulated stream which includes the compressed data for all frames and the frame delimiters may be accessed using the method. These acquisition methods are safe for use by multiple threads to allow concurrent acquisition of image frame data in performance intensive applications.
The three approaches demonstrated in this example are:
|load the decoded raw pixels into an Array||This approach usesto decode and read the pixel data for the specified image frame into an array. The decode pixel data is properly byte swapped and sign extended if needed. This approach is useful when you would like to perform custom transformations on the data, such as dynamically applying window level and center or other custom manipulations. The destination array is passed by reference, and you may pass a null array to have the properly typed array created for you.|
|load the decoded raw pixels into a MemoryStream||This approach uses. The raw pixels are properly byte swapped and sign extended if needed, but no window level or lut processing is performed. This approach might be useful for saving raw pixel data in another format for analysis or processing.|
|save the encapsulated data stream||The FrameProducer providesmethod to allow the acquisition of the encapsulated data for a frame without decoding. This example writes the compressed data to another file which may be able to be read by other image viewers. Note that most image viewers support the format, so the demo image we use by default in this example is in that format.|