FindLastElement Example for C++Builder
/* Find the last image element and display it */
LEADDicom1->EnableMethodErrors = true;
try
{
/* move to last element in Data Set */
LEADDicom1->MoveLastElement(false);
LEADDicom1->FindLastElement(TAG_PIXEL_DATA, false);
LEADDicom1->GetBitmapValue(0, 0, ORDER_RGB);
LEADImage1->Bitmap = LEADDicom1->Bitmap;
LEADDicom1->Bitmap = 0;
LEADDicom1->FindTag(LEADDicom1->CurrentElement->Tag);
ShowMessage("Element: " + LEADDicom1->CurrentTag->Name);
/* find each image */
while(true)
{
LEADDicom1->FindPrevElement(false);
LEADDicom1->GetBitmapValue(0, 0, ORDER_RGB);
LEADImage1->Bitmap = LEADDicom1->Bitmap;
LEADDicom1->Bitmap = 0;
LEADDicom1->FindTag(LEADDicom1->CurrentElement->Tag);
ShowMessage("Element: " + LEADDicom1->CurrentTag->Name);
}
}
catch(ELEADDicomError *e)
{
ShowMessage("No More Images");
}