#include "Ltdic.h"
pDICOMELEMENT LDicomDS::GetChildElement(pElement, bVolatile)
Returns a pointer to the item in the Data Set that contains the first child of the specified item.
Pointer to a DICOMELEMENT structure that contains an item in the Data Set.
Flag that indicates the type of child element to retrieve. Possible values are:
Value | Meaning |
---|---|
TRUE | Retrieve any child element, volatile or non-volatile. |
FALSE | Retrieve a non-volatile child element. |
Value | Meaning |
---|---|
!NULL | A pointer to a DICOMELEMENT structure that contains the item in the Data Set that is the first child of the item specified in pElement. |
NULL | pElement has no child items. |
The child is the offspring one level lower than the specified item. If the specified item has no child items, this function will return NULL. For example:
If the passed pointer points to: | The function returns a pointer to: |
---|---|
Item 1 | NULL |
Item 2 | Item 3 |
Item 4 | Item 5 |
Item 6 | NULL |
The following functions will also help you navigate the Data Set:
A volatile element is an element that can be changed or destroyed in the process of inserting or setting an image. A non-volatile element is an element that must be changed manually. It is not changed or destroyed by inserting or setting an image.
For example, a grayscale image has elements TAG_SMALLEST_IMAGE_PIXEL_VALUE, TAG_LARGEST_IMAGE_PIXEL_VALUE, etc. If the image is changed to a color image, these elements disappear and the following elements appear: TAG_RED_PALETTE_COLOR_LOOKUP_TABLE_DESCRIPTOR, etc. These are volatile elements since they are changed or destroyed when an image is changed or set.
To retrieve a child element that must be changed manually, i.e. is not volatile, set bVolatile to FALSE. To retrieve a child element that may be either volatile or non-volatile, set bVolatile to TRUE.
Required DLLs and Libraries
Win32, x64
This example displays the elements in the Data Set.
L_VOID ShowTree(L_INT nLevel, LDicomDS *pDS, pDICOMELEMENT pParentElement)
{
pDICOMELEMENT pElement;
pDICOMTAG pTag;
L_TCHAR szUnknown[]=TEXT("Unknown");
L_TCHAR *p;
if (pParentElement == NULL)
{
pElement = pDS->GetFirstElement(pParentElement, TRUE, FALSE);
}
else
{
pElement = pDS->GetChildElement(pParentElement, FALSE);
}
while (pElement != NULL)
{
pTag = LDicomTag::Find(pElement->nTag);
if (pTag != NULL)
{
p = pTag->pszName;
}
else
{
p = szUnknown;
}
for (L_INT i = 0; i<nLevel; i++)
{
OutputDebugString(TEXT("--- "));
}
OutputDebugString(p);
OutputDebugString(TEXT("\n"));
if (pDS->GetChildElement(pElement, FALSE) != NULL)
{
ShowTree(nLevel + 1, pDS, pElement);
}
pElement = pDS->GetNextElement(pElement, TRUE, FALSE);
}
}
L_INT LDicomDS_GetChildElementExample()
{
LDicomDS* pDS;
pDS = new LDicomDS(NULL);
pDS->InitDS( CLASS_XA_BIPLANE_IMAGE_STORAGE_RETIRED, 0);
ShowTree(0, pDS, NULL);
delete pDS;
return DICOM_SUCCESS;
}
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