L_DicomFindNextDescendant

#include "Ltdic.h"

L_LTDIC_API pDICOMELEMENT L_DicomFindNextDescendant(hDS, pParent, pElement, bNextLevelOnly)

Returns a pointer to the next item in the Data Set with a specific tag.

Parameter Description
hDS A DICOM handle.
pParent Pointer to a parent DICOMELEMENT structure within the Data Set.
pElement Pointer to a child DICOMELEMENT structure of pParent.
bNextLevelOnly Flag that indicates how the Data Set will be evaluated. Possible values are:
Value Meaning
TRUE Search for items in the next level only.
FALSE Search for items recursively in all of the next levels.

Returns

!NULL A pointer to a DICOMELEMENT structure that contains the next item in the Data Set having the specified tag.
NULL No item with the specified tag was found.

Comments

NOTE: Call L_DicomFindFirstDescendant before calling L_DicomFindNextDescendant. L_DicomFindNextDescendant does not specify a tag to use when searching. However, the tag that was used in the last call to L_DicomFindFirstDescendant is used by default when searching.

This function finds the next descendant of the pElement that has a DICOM tag equivalent to the nTag argument (L_DicomFindFirstDescendant), where the entire search is rooted at the Parent element (i.e. pParent).

The diagram below represents DICOM elements stored in a DICOM dataset.

Behavior when bNextLevelOnly is TRUE:

Returns the next element on the next level of pParent with that has a tag equivalent to the nTag argument used in the previous call to L_DicomFindFirstDescendant. Elements included in the search include child elements in the next level only, starting with the element pointed to by pElement. .

Example 1

bNextLevelOnly TRUE

pParent points to element 1

pElement points to element 8

Searches elements 11, 12 and returns the first element that matches the nTag argument used in the previous call to L_DicomFindFirstDescendant.

Example 2

bNextLevelOnly TRUE

pParent points to element 2

pElement points to element 3

Searches elements 4, 7 and returns the first element that matches the nTag argument used in the previous call to L_DicomFindFirstDescendant.

Example 3

bNextLevelOnly TRUE

pParent pointing to element 4

pElement points to element 5

Searches eSearches element 6 only, and returns element 6 if it has a tag of the nTag ent used in the previous call to L_DicomFindFirstDescendant.

Example 4

bNextLevelOnly TRUE

pParent pointing to element 1

pElement points to element 12

Returns NULL.

Behavior when bNextLevelOnly is FALSE:

Returns the next item that has a tag equivalent to the nTag argument used in the previous call to L_DicomFindFirstDescendant ( a pre-order search algorithm rooted at pParent.)

Example 5

bNextLevelOnly FALSE

pParent pointing to element 1

pElement points to element 4

Searches elements 5, 6, 7, 8, 9, 10, 11, 12 and returns the first element that matches the nTag argument used in the previous call to L_DicomFindFirstDescendant.

Example 6

bNextLevelOnly FALSE

pParent pointing to element 2

pElement points to element 4

Searches elements 5, 6, 7 and returns the first element that matches the nTag argument used in the previous call to L_DicomFindFirstDescendant.

Example 7

bNextLevelOnly FALSE

pParent pointing to element 4

pElement points to element 5

Searches eSearches element 6 only, and returns element 6 if is has a tag of nTag argument used in the previous call to L_DicomFindFirstDescendant

The following functions will also help you find elements in the Data Set with a specific tag:

L_DicomFindFirstDescendant

L_DicomFindFirstElement

L_DicomFindLastElement

L_DicomFindPrevElement

The following functions will help you find specific modules in the Data Set:

L_DicomFindModule

L_DicomFindIndexModule

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.

Platforms

Win32, x64, Linux.

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS DICOM C API Help
Click or drag to resize