Assembly: LoadImageFrames (in LoadImageFrames.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 LoadImageFrames.
This program takes a single file or folder path as an argument. A file path should reference an existing DICOM file containing at least one image frame. A folder path should reference an existing directory that should contain one or more DICOM files with a '.dcm' extension; each containing exactly one image frame, and each frame having the same size and image type. Both the multi-frame and multi-dataset implementations use Parallel.For to load the image frames in parallel.
For a single file, the program will allocate a byte array of sufficient size to contain all frames of the dataset, and then load the image data for each frame. For a very large encapsulated multi-frame image, a fair amount of time may be spent constructing the basic frame offset table which is required to efficiently seek to the correct location for each frame. See the CreateBasicOffsetTable example program to see how to add a basic frame offset table to a dataset.
For a single folder, the program will scan the directory for a sorted list of '.dcm' file names. The program will then allocate a byte array of sufficient size to contain the single frame of each dataset, and then load the image data. The image frames of each dataset must be identical size.
This implementation allocates exactly the number of bytes needed for the specified number of image frames. Depending upon your application, it may be more performant to make sure image frames are padded to theto ensure that every frame begins on a page boundary.
Additional image filtering may be necessary for modality and value-of-interest processing.
For very large multi-frame or multi-dataset images it may be more performant and/or necessary to use a MemoryMappedFile as the backing store for the frame buffer.
In some scenarios it may also be simpler to make use of an UnmanagedMemoryStream to avoid extra memory copies, which is exactly whatdoes to handle buffers of arbitrary array types.
Other premature optimizations are possible. Your mileage may vary.
See theinterface and the class for more details on loading image frames.