FindFirstElement Example for C++Builder
/* Find the first image element and display it */
LEADDicom1->EnableMethodErrors = true;
try
{
/* move to first element in Data Set */
LEADDicom1->MoveFirstElement(false);
LEADDicom1->FindFirstElement(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->FindNextElement(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");
}