Called for each DICOM file enumerated by L_DicomDirInsertFile.
#include "ltdic.h"
L_UINT16 pEXT_CALLBACK YourFunction(hDicomDir, pszFileName, hDS, uStatus, pUserData)
A handle to the DICOMDIR
Character string that contains the name of the file being added to the DICOM Directory.
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.
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. |
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.
Value | Meaning |
---|---|
0 | DICOM_SUCCESS |
> DICOM_SUCCESS | An error occurred. Refer to Return Codes. |
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:
The callback function is called just after trying to load the Data Set in the file and before actually adding the file to the Dicom Directory. If the Data Set was loaded successfully, the parameter pDataSet specifies the loaded Data Set and the parameter uStatus is set to DICOMDIR_INSERTDICOMFILE_PREADD. To skip the addition of the file, the callback function should return DICOM_ERROR_FORMAT. If the Data Set wasn't loaded successfully, the parameter pDataSet is set to NULL and the parameter uStatus is set to an error code.
The callback function is called the second time just after trying to add the loaded Data Set to the DICOM Directory. The parameter pDataSet specifies the loaded Data Set. If the Data Set was added successfully, the parameter uStatus is set to DICOM_SUCCESS. Otherwise, it is set to an error code. This call to the callback function is not made if a loading failure was reported in the first call to the callback function, or the file addition was skipped in the first call to the callback function.
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.
Win32, x64
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document