GetElementLevel Example for C++Builder
Cardinal x, uLevel;
/* Navigate the Data Set: a List, not: a Tree */
/* Move to the 20th element, and then find that element"s level in the Tree */
LEADDicom1->EnableMethodErrors = true;
try
{
/* move to first element in Data Set */
LEADDicom1->MoveFirstElement(false);
/* move to the 20th element */
for(x=2; x<=20; x++)
LEADDicom1->MoveNextElement(false);
LEADDicom1->FindTag(LEADDicom1->CurrentElement->Tag);
uLevel = LEADDicom1->GetElementLevel();
ShowMessage("Element: " + LEADDicom1->CurrentTag->Name + " at level " + IntToStr(uLevel));
}
catch(ELEADDicomError *e)
{
ShowMessage("Error Number: " + IntToStr(LEADDicom1->Error));
}