qualityFactor
The quality factor (Q factor) is a number that determines the degree of loss in the compression process. You can set a value from 2 to 255, where 2 is the highest quality and 255 is the most compression.

flags
Flags that control the behavior of this method.

Remarks

As an example, if you wish to insert 50 images starting with the 50th frame in the Pixel Data, call this method with index set to 49 (the 50th frame in a zero-based index) and the 50 frames you wish to insert.
Most DICOM files will only have one Data Element of type DicomTag.PixelData. Therefore, in most instances you can set element to null, since the method will automatically insert the images into the only Pixel Data Element in the file. If element is not null, it must point to the Pixel Data Element itself.

If the DICOM file is DicomClassType.BasicDirectory, the file may contain more than one Pixel Data Element. In this case you must specify in element the Pixel Data Element in which to insert the images.

For a table of possible Compression, Photometric, BitsPerPixel, and Quality Factor combinations, refer to Compression Table.

For more options when using the JPEG 2000 compression, refer to Jpeg2000Options.

This method will either insert, delete or update one or more of the following elements:

This method is indifferent to the pixel data restrictions imposed by the various DICOM IOD classes; for example, this method will allow the user to insert a colored image into a "Digital X-Ray Image Storage" Data Set.

This method will always insert a "Number of Frames" (0028, 0008) element and set its value.

The Multi-frame Functional Groups module may have a Shared Functional Groups Sequence item, and/or a Per-frame Functional Groups Sequence item. Either of these items may have a Pixel Value Transformation Sequence (0028,9145) item, or a Frame VOI LUT Sequence (0028,9132) item. The five DICOM_SETIMAGE_MFG flags can be used to add or modify existing information in the Pixel Value Transformation Sequence or the Frame VOI LUT Sequence.
The following flags are used only if the corresponding sequence (Frame VOI LUT Sequence or Pixel Value Transformation Sequence) does not already exist.

Note:
DicomSetImageFlags.MfgVoiLutPerFrame cannot be combined with DicomSetImageFlags.MfgVoiLutShared.
DicomSetImageFlags.MfgModalityLutPerFrame cannot be combined with DicomSetImageFlags.MfgModalityLutShared.
There is no high level functionality to embed MPEG2 into a DICOM dataset. The Multimedia toolkit (DICOM writer can create DICOM files with MPEG2 compression.
This method cannot be used to encode DICOM transfer syntaxes (e.g. video compression support) that are not part of the main medical SDK and it is supported only via the LEADTOOLS Medical Multimedia Module.