MoveFirstTag Example for Delphi
procedure TForm1.MoveTag1Click(Sender: TObject);
{ DisplayItem is a local procedure within MoveTag1Click }
procedure DisplayItem;
var
sItem, sOut: String;
begin
LEADDicom1.EnableMethodErrors := true;
try
sItem := IntToHex(LEADDicom1.CurrentTag.Code, 8);
sOut := 'Current Tag Info:'#13 +
'Code: ' + Copy(sItem, 1, 4) + ':' + Copy(sItem, 5, 4)+#13;
sItem := IntToHex(LEADDicom1.CurrentTag.Mask, 8);
sOut := sOut + 'Mask: ' + Copy(sItem, 1, 4) + ':' + Copy(sItem, 5, 4)+#13;
sOut := sOut + 'Name: ' + LEADDicom1.CurrentTag.Name+#13;
Case LEADDicom1.CurrentTag.VR of
VR_AE: sItem := 'AE';
VR_AS: sItem := 'AS';
VR_AT: sItem := 'AT';
VR_CS: sItem := 'CS';
VR_DA: sItem := 'DA';
VR_DS: sItem := 'DS';
VR_DT: sItem := 'DT';
VR_FD: sItem := 'FD';
VR_FL: sItem := 'FL';
VR_IS: sItem := 'IS';
VR_LO: sItem := 'LO';
VR_LT: sItem := 'LT';
VR_OB: sItem := 'OB';
VR_OW: sItem := 'OW';
VR_PN: sItem := 'PN';
VR_SH: sItem := 'SH';
VR_SL: sItem := 'SL';
VR_SQ: sItem := 'SQ';
VR_SS: sItem := 'SS';
VR_ST: sItem := 'ST';
VR_TM: sItem := 'TM';
VR_UI: sItem := 'UI';
VR_UL: sItem := 'UL';
VR_UN: sItem := 'UN';
VR_US: sItem := 'US';
VR_UT: sItem := 'UT';
else sItem := IntToStr(LEADDicom1.CurrentTag.VR);
End;
sOut := sOut + 'VR: ' + sItem +#13;
sOut := sOut + 'MinVM: ' + IntToStr(LEADDicom1.CurrentTag.MinVM)+#13;
sOut := sOut + 'MaxVM: ' + IntToStr(LEADDicom1.CurrentTag.MaxVM)+#13;
sOut := sOut + 'DivideVM: ' + IntToStr(LEADDicom1.CurrentTag.DivideVM);
ShowMessage(sOut);
except
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
end;
end; { DisplayItem }
begin { MoveTag1Click }
LEADDicom1.MoveFirstTag();
DisplayItem();
LEADDicom1.MoveNextTag();
DisplayItem();
LEADDicom1.MoveLastTag();
DisplayItem();
LEADDicom1.MovePrevTag();
DisplayItem();
end;