Creating a standard Microsoft AVI file with DicomObjects is simple, 2 steps:
- Load a valid DICOM multi-frame image
- Call DicomImage.WriteAVI, description of which is available in DicomObjects help file.
We have recently discovered a free AVI wrapper class for .NET environment. We haven't integrated it into DicomObjects. But for people who want to experiment the AVI export, you can download the sample program, which reads in a multi-frame DicomImage and exports AVI file.
The sample program can be download from here
Please let us know your thoughts and your experiences of using that AVI wrapper class. If we receive enough positive feedback then we will integrated it into DicomObjects.NET.
Changing AVI Frame Rate
If you find the output AVI has a default frame rate of 10 per second, that's because DicomObjects failed to find any better suggestions within the original multi-frame image. There are 3 elements that DicomObjects will be looking for when WriteAVI is called:
- Recommended Display Rate (0008, 2144), frames per second, if not found, then
Frame Increment Pointer (0028, 0009), which points to one the following data elements:
- Frame Time (0008, 1063), or
- Frame Time Vector (0008, 1065)
If any of the above data elements is present in the DicomImage and has a meaningful value, DicomObjects will pick it up and use it. If not, then the default rate of 10 frames per second is used.
So if you need to change the output AVI frame rate, the easiest way is to change/add the Recommended Display Rate before you call WriteAVI. More information about Frame Increment Pointer can be found in part 3 of the DICOM Standard.
By changing the CineRate, you have an immediate effect on the cine display but this has nothing to do with AVI creation. When displaying cine DicomObjects multiplies the frame rate, as described in the above section, by CineRate, before it calls the internal graphics render routine.
NOTE: AVI import if available in the .NET version of DicomObjects via DicomImage.ImportAVI method.