LDicomIOD::Insert
#include "Ltdic.h"
static pDICOMIOD LDicomIOD::Insert(pNeighbor, bChild, nCode, pszName, nType, nUsage, pszDescription)
pDICOMIOD pNeighbor; |
/* pointer to a DICOMIOD structure */ |
L_BOOL bChild; |
/* flag that indicates where to insert the item */ |
L_UINT32 nCode; |
/* code */ |
L_TCHAR * pszName; |
/* name of the inserted item */ |
L_UCHAR nType; |
/* type */ |
L_UINT16 nUsage; |
/* usage */ |
L_TCHAR * pszDescription; |
/* description */ |
Inserts a new item in the IOD Structure.
Parameter |
Description | |
pNeighbor |
Pointer to a DICOMIOD structure that contains an item in the IOD Structure. The inserted item will be inserted as a neighbor to this item, or as a child, depending on the value of bChild. | |
bChild |
Flag that indicates where to insert the item. Possible values are: | |
|
Value |
Meaning |
|
TRUE |
The new item will be inserted as the last child of pNeighbor. |
|
FALSE |
The new item will be inserted as the last sibling of pNeighbor. |
nCode |
Code value that indicates which Information Object Definition you are inserting. The information object may be a Class, a Module or a Tag. For lists of default values, refer to Data Element Tag Constants, IOD Class Constants, and IOD Module Constants. | |
pszName |
Character string that contains the name of the inserted item. | |
nType |
The type of Information Object Definition you are working with. Possible values are: | |
|
Value |
Meaning |
|
IOD_TYPE_CLASS |
[0x00] Class type Information Object Definition. |
|
IOD_TYPE_MODULE |
[0x01] Module type Information Object Definition. |
|
IOD_TYPE_ELEMENT |
[0x02] Element type Information Object Definition. |
nUsage |
Value that indicates whether the Information Object is mandatory, conditional or optional, and the type of usage. For a list of possible values, refer to IOD Usage Constants. For more information on mandatory, conditional and optional usage, refer to An Overview of Dicom or the DICOM Spec. | |
pszDescription |
Character string that contains a description of the inserted Information Object Definition. |
Returns
!NULL |
A pointer to a DICOMIOD structure containing the newly inserted item. |
NULL |
Not enough memory to insert the item. |
Comments
The illustrations below show how items are added to the IOD Structure (internally maintained as a tree), based on the value of bChild.
For the sake of these illustrations, the order of siblings is top to bottom. Therefore, since added items become the last sibling or the last child, these are drawn at the bottom of the appropriate group of items.
In this illustration, pNeighbor points to Item 1 and bChild is False. The new item is added as the last sibling of Item 1.
In this illustration, pNeighbor points to Item 1 and bChild is True. The new item is added as the last child of Item 1.
Required DLLs and Libraries
LTDIC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
|
Topics: |
Example
This example inserts a new class in the IOD table.
L_INT LDicomIOD_InsertExample() { pDICOMIOD pClass; pDICOMIOD pModule; pDICOMIOD pElement; /* Inserts a new class */ pClass = LDicomIOD::Insert(NULL, FALSE, 7000, TEXT("New Class"), IOD_TYPE_CLASS, 0, TEXT("")); /* Inserts a module in the class */ pModule = LDicomIOD::Insert(pClass, TRUE, 7000, TEXT("AAA Module"), IOD_TYPE_MODULE, IOD_USAGE_M, TEXT("This is a module")); /* Inserts an element in the module */ pElement = LDicomIOD::Insert(pModule, TRUE, TAG_CONTENT_DATE, TEXT("XXX Element"), IOD_TYPE_MODULE, IOD_USAGE_1, TEXT("This is an element")); /* Inserts an element in the module */ pElement = LDicomIOD::Insert(pModule, TRUE, TAG_INSTITUTION_NAME, TEXT("YYY Element"), IOD_TYPE_MODULE, IOD_USAGE_3, TEXT("This is an element")); return DICOM_SUCCESS; }