ImageGear for C and C++ on Windows v20.5 - Updated
MED_DCM_save_DICOM_FD
API Reference Guide > MD Component API Reference > MD Component Functions Reference > File Functions > MED_DCM_save_DICOM_FD

This function performs the same operation as MED_DCM_save_DICOM() except that it uses the FD instead of the file name.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_DCM_save_DICOM_FD(
        AT_INT fd, 
        const HIGEAR hIGear, 
        const AT_MODE nSyntax, 
        const BOOL bIncludeGroupLengths, 
        const BOOL bSaveAsPart10, 
        const AT_MODE nPlanarConfiguration, 
        const BOOL bInludeSmallestLargest, 
        const UINT nJPEGQuality, 
        const DWORD lReserved
);

Arguments:

Name Type Description
fd AT_INT Set to the FD handle of the open image. The image must have been opened with Read/Write access.
hIGear const HIGEAR The HIGEAR handle of the image to save. This HIGEAR must have an attached DICOM Data Set.
nSyntax const AT_MODE Set to the type of Transfer Syntax used for the file that you will be saving. Use one of the MED_DCM_TS_ constants defined in enumIGMedTS.
bIncludeGroupLengths const BOOL Set this Boolean variable to TRUE if you want to store the Group Lengths with the image.
bSaveAsPart10 const BOOL Set this Boolean variable to TRUE if you want to save a Part 10 header with the image.
nPlanarConfiguration const AT_MODE Determines how RGB pixel values are to be saved to the DICOM image file. The Planar Configuration Data Element (0028, 0006) will be automatically inserted and this value stored in it. If the Data Set already contains (0028,006), its value is ignored, and the value of this parameter is used instead. This parameter is used for RGB only. It is ignored for all other image types. Set to one of the constants that begins with MED_DCM_PLANAR_.
bIncludeSmallestLargest const BOOL Setting this parameter to TRUE will cause the Smallest and Largest pixel value in the image to be computed and saved in Smallest Image Pixel Value (0028,0106) and Largest Image Pixel Value (0028,0107). If the Data Set contains these 2 Data Elements already, they are ignored and the computed values are used. If this parameter is set to FALSE these two Data Elements are not stored in the file.
nJPEGQuality const UINT The value of this argument is only relevant to lossy JPEG compression. When using any other compression scheme, this value will be ignored. Set to the amount of pixel data to preserve during lossy JPEG compression. The range of valid values is 1-100 with a default value of 70. Higher settings result is higher quality and a larger file. Note that even at 100, JPEG compression is not capable of being completely "lossless".
lReserved const DWORD Reserved for future use. Set to 0 for now.

Return Value:

Returns the number of ImageGear errors that occurred during the function call.

Supported Raster Image Formats:

All pixel formats supported by IG_FORMAT_DCM format.

The image must have a DICOM DataSet attached to it. Use MED_DCM_DS_exists to check whether the image contains a DataSet.

Remarks:

The file must have been opened with Read/Write access.

Since you are responsible for opening and closing the file, this function can be used to bypass the IG_save_file() limitation of not handling unicode or multi-byte character strings.

Is this page helpful?
Yes No
Thanks for your feedback.