FindFirstElement Example for Delphi
{ Find the first image element and display it }
LEADDicom1.EnableMethodErrors := true;
try
begin
{ 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 do
begin
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);
end;
end;
except
ShowMessage('No More Images');
end;