#include "Ltdic.h"
pDICOMELEMENT LDicomDS::GetChildElement(pElement, bVolatile)
pDICOMELEMENT pElement; |
pointer to a DICOMELEMENT structure |
L_BOOL bVolatile; |
flag that indicates the type of element to retrieve |
Returns a pointer to the item in the Data Set that contains the first child of the specified item.
Parameter | Description | |
pElement | Pointer to a DICOMELEMENT structure that contains an item in the Data Set. | |
bVolatile | 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. |
!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
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 |
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;
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET