FindLastElement Example for Delphi
{ 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 do
begin
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);
end;
except
ShowMessage('No More Images');
end;