LDicomDS::CreatePrivateCreatorDataElement

#include "Ltdic.h"

L_UINT16 LDicomDS::CreatePrivateCreatorDataElement(pElement, uElementGroup, uElementNumber, pszIdCode, ppPrivateCreatorDataElement)

Creates a Private Creator Data Element to reserve private data elements. This feature is available in version 16 or higher.

Parameters

pDICOMELEMENT pElement

Pointer to a DICOMELEMENT structure that contains an item in the Data Set. The inserted item will be inserted at the same level as this item.

L_UINT16 uElementGroup

Group number of the private creator data element.

L_UINT16 uElementNumber

Element number of the private creator data element.

L_TCHAR * pszIdCode

String identifier that is assigned to the private creator data element.

pDICOMELEMENT * ppPrivateCreatorDataElement

Pointer to the created private creator data element.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

A DICOM Data Set can have private data which is stored in private tags. Private tags are reserved by adding a Private Creator Data Element to the data set. Elements of the form (gggg,0010-00FF) represent private creator data elements. More specifically:

Private Creator Data Elements are elements of the form (gggg,eeee) where

1. gggg is a four-digit hexadecimal group number

2. eeee is a four-digit hexadecimal element number

3. gggg is odd

4. gggg is NOT 0001, 0003, 0005, 0007 or FFFF

5. eeee is in the range 0010 to 00FF

6. Value Represenation is LO (Long String).

7. Value Multiplicity is 1

A private creator data element of the form (gggg,00ee) reserves the following 256 elements, which can be of any value reprentation:

(gggg, ee00)

(gggg, ee01)

(gggg, ee02)

(gggg, eeFF).

For example, suppose you want to add the following three private elements to a DICOM data set:

(0017,1201)

(0017,1203)

(0017,1205)

You would first reserve the elements by adding the corresponding private creator data element (0017, 0012).

When using LDicomDS::CreatePrivateCreatorDataElement, the created private creator data element is on the same level as the element pointed to by argument pElement. If pElement is NULL, the private creator data element is created at the top or first level.

If parameter uElementNumber is 0xFFFF, the private creator data element is created with the first available element number in group uGroupNumber.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

This example displays all the Private Creator Data Elements and corresponding private elements in a data set.

#define MSG_BUFFER_SIZE 1000 
void DumpElement(TCHAR *pszMsgBox, pDICOMELEMENT p, TCHAR *pszMsg) 
{ 
   if (p == NULL) 
      return; 
 
   WCHAR szMsgTemp[100]={0}; 
   wsprintf(szMsgTemp, L"%s (%.4x,%.4x)\n", pszMsg ? pszMsg : L"", p->nTag >> 0x10, p->nTag & 0xFFFF); 
   _tcscat_s(pszMsgBox, MSG_BUFFER_SIZE, szMsgTemp); 
} 
 
 
L_VOID DumpPrivateElements(TCHAR *pszMsgBox, LDicomDS &ds, pDICOMELEMENT pPrivateCreatorDataElement) 
{ 
   pDICOMELEMENT p = ds.FindFirstPrivateElement(pPrivateCreatorDataElement); 
   while (p != NULL) 
   { 
      DumpElement(pszMsgBox, p, L"\t"); 
      p = ds.FindNextPrivateElement(p, pPrivateCreatorDataElement); 
   } 
} 
 
L_INT LDicomDS_FindFirstPrivateCreatorDataElementExample(LDicomDS &ds, pDICOMELEMENT pRoot, L_BOOL bTree) 
{ 
   L_INT nRet = DICOM_SUCCESS; 
   pDICOMELEMENT pPrivateCreatorDataElement = NULL; 
   TCHAR szMsgBox[MSG_BUFFER_SIZE] = {0}; 
 
 
   pPrivateCreatorDataElement = ds.FindFirstPrivateCreatorDataElement(pRoot, bTree, NULL, 0); 
   while (pPrivateCreatorDataElement ) 
   { 
      DumpElement(szMsgBox, pPrivateCreatorDataElement, L"*** Private Creator Data Element"); 
      DumpPrivateElements(szMsgBox, ds, pPrivateCreatorDataElement); 
      pPrivateCreatorDataElement = ds.FindNextPrivateCreatorDataElement(pPrivateCreatorDataElement, bTree, NULL, 0); 
   } 
 
   MessageBox(NULL, szMsgBox, L"Private Elements", MB_OK); 
   return nRet; 
} 

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

LEADTOOLS DICOM C++ Class Library Help