INSERTDICOMFILECALLBACK

#include "ltdic.h"

L_UINT16 pEXT_CALLBACK Your_Function(hDicomDir, pszFileName, hDS, uStatus, pUserData)

Called for each DICOM file enumerated by L_DicomDirInsertFile.

Parameters

HDICOMDIR hDicomDir

A handle to the DICOMDIR

const L_TCHAR* pszFileName

Character string that contains the name of the file being added to the DICOM Directory.

HDICOMDS hDS

A DICOM handle that specifies the Data Set contained by the DICOM file being processed. If the Data Set was not loaded successfully, this parameter is set to NULL.

L_UINT16 uStatus

the status code. Possible values are:

Value Meaning
DICOMDIR_INSERTDICOMFILE_PREADD [300] The Data Set in the file was loaded successfully and the file is about to be added to the DICOM Directory.
DICOM_SUCCESS [0] The file has been added successfully to the DICOM Directory.
Any other value [> 0] An error occurred. Refer to Return Codes.

L_VOID * pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

Value Meaning
0 DICOM_SUCCESS
> DICOM_SUCCESS An error occurred. Refer to Return Codes.

Comments

If the parameter passed to L_DicomDirInsertFile is NULL, then all files in the destination folder will be enumerated. If the bIncludeSubfolders member of a DICOMDIROPTIONS structure is set to TRUE and set using L_DicomDirSetOptions, and then L_DicomDirInsertFile is called with pszFileName set to NULL, then all files in the destination folder and all files in all of the subfolders of the destination folder will be enumerated. For each file, the callback function OnInsertDicomFile is called once or twice:

If the callback function returned a value other than DICOM_SUCCESS or DICOM_ERROR_FORMAT, the function L_DicomDirInsertFile will stop adding new files and will return the same value returned by the callback function. Therefore, to keep adding the DICOM files, the callback function should return DICOM_SUCCESS, or DICOM_ERROR_FORMAT if only the current file is to be skipped (which can be done during the first call).

The function L_DicomDirInsertFile will stop adding new files if an error occurred and it will return an error value.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

DICOMDIRCALLBACK

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.