CONFORMANCECALLBACK Function

#include "ltdic.h"

L_BOOL pEXT_CALLBACK YourFunction(pElement, nFlags, pUserData)

pDICOMELEMENT pElement;

/* a DICOM handle */

L_UINT16 nFlags;

/* flag that indicates any errors */

L_VOID * pUserData;

/* pointer to additional data */

Processes each Data Element of the Data Set to determine conformance.

Parameter

Description

pElement

A DICOM handle.

nFlags

Flag that indicates errors associated with the Data Element. Possible values are given below and may be combined using the bitwise OR ( | ) operator.

 

Value

Meaning

 

CALLBACK_ERROR_UNKNOWN_CLASS

[0x0001] Error- improper class code.

 

CALLBACK_ERROR_UNKNOWN_TAG

[0x0002] Error - improper tag value.

 

CALLBACK_ERROR_UNKNOWN_VR

[0x0004] Error - unknown Value Representation code.

 

CALLBACK_ERROR_WRONG_VR

[0x0008] Error - incorrect Value Representation code.

 

CALLBACK_ERROR_MIN_VM

[0x0010] Error - improper minimum value multiplicity value.

 

CALLBACK_ERROR_MAX_VM

[0x0020] Error - improper maximum value multiplicity value.

 

CALLBACK_ERROR_DIVIDE_VM

[0x0040] Error - improper value multiplicity divisor.

 

CALLBACK_ERROR_IMAGE

[0x0080] Error - improper image.

 

CALLBACK_ERROR_ELEMENT

[0x0100] Error - improper element or element length.

 

CALLBACK_ERROR_ELEMENT_EXISTS

[0x0200] Error - element already exists.

 

CALLBACK_ERROR_MEMORY

[0x0400] Error - out of memory.

pUserData

Void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the LDicomDS::ConformanceDS function.)

 

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

TRUE

The Data Set conforms to the standard.

FALSE

The Data Set does not conform to the standard.

Comments

The LDicomDS::ConformanceDS function calls your callback function to verify each Data Element in the DataSet.

The purpose of this callback function is just to verify that the data provided in the Data Set conforms to the standard.

Set nFlags with the appropriate error message for any inconsistency encountered. For example, if a Data Element has a Value Representation of VR_FD (Floating Point Double) and the Value Field has an integer value, set the CALLBACK_ERROR_VR error in nFlags and return False.

Platforms

Win32, x64

Example

For an example, refer to LDicomDS::ConformanceDS.