MoveFirstVR Example for Delphi
Procedure TForm1.DisplayItem();
var
nRestrict: Integer;
begin
LEADDicomDS1.EnableMethodErrors:= True;
//display the items information
Case (LEADDicomDS1.DefaultInterface.Get_CurrentVR().Code) of
VR_AE:
Edit1.Text := 'AE';
VR_AS:
Edit1.Text := 'AS';
VR_AT:
Edit1.Text := 'AT';
VR_CS:
Edit1.Text := 'CS';
VR_DA:
Edit1.Text := 'DA';
VR_DS:
Edit1.Text := 'DS';
VR_DT:
Edit1.Text := 'DT';
VR_FD:
Edit1.Text := 'FD';
VR_FL:
Edit1.Text := 'FL';
VR_IS:
Edit1.Text := 'IS';
VR_LO:
Edit1.Text := 'LO';
VR_LT:
Edit1.Text := 'LT';
VR_OB:
Edit1.Text := 'OB';
VR_OW:
Edit1.Text := 'OW';
VR_PN:
Edit1.Text := 'PN';
VR_SH:
Edit1.Text := 'SH';
VR_SL:
Edit1.Text := 'SL';
VR_SQ:
Edit1.Text := 'SQ';
VR_SS:
Edit1.Text := 'SS';
VR_ST:
Edit1.Text := 'ST';
VR_TM:
Edit1.Text := 'TM';
VR_UI:
Edit1.Text := 'UI';
VR_UL:
Edit1.Text := 'UL';
VR_UN:
Edit1.Text := 'UN';
VR_US:
Edit1.Text := 'US';
VR_UT:
Edit1.Text := 'UT'
else
Edit1.Text := IntToStr(LEADDicomDS1.DefaultInterface.Get_CurrentVR().Code)
end;
Edit2.Text := LEADDicomDS1.DefaultInterface.Get_CurrentVR().Name;
Edit3.Text := IntToStr(LEADDicomDS1.DefaultInterface.Get_CurrentVR().Length);
nRestrict:= LEADDicomDS1.DefaultInterface.Get_CurrentVR().Restrict;
nRestrict:= (nRestrict And (Not DICOM_VR_BINARY));
nRestrict:= (nRestrict And (Not DICOM_VR_STRING));
nRestrict:= (nRestrict And (Not DICOM_VR_TEXT));
Case (nRestrict) of
DICOM_VR_FIXED:
Edit4.Text:= 'Fixed';
DICOM_VR_MAXIMUM:
Edit4.Text := 'Maximum';
DICOM_VR_MAXIMUM_GROUP:
Edit4.Text := 'Maximum Group';
DICOM_VR_ANY:
Edit4.Text := 'Any Length';
DICOM_VR_NOT_APPLICABLE:
Edit4.Text := 'Not Applicable';
DICOM_VR_MAX:
Edit4.Text := 'Max';
else
Edit4.Text := IntToStr(LEADDicomDS1.DefaultInterface.Get_CurrentVR().Restrict);
end;
Edit5.Text := IntToStr(LEADDicomDS1.DefaultInterface.Get_CurrentVR().UnitSize);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
LEADDicomDS1.EnableMethodErrors:= True;
LEADDicomDS1.MoveFirstVR ();
DisplayItem();
ShowMessage('wait');
LEADDicomDS1.MoveNextVR ();
DisplayItem();
ShowMessage('wait');
LEADDicomDS1.MoveLastVR ();
DisplayItem();
ShowMessage('wait');
LEADDicomDS1.MovePrevVR ();
DisplayItem();
ShowMessage('wait');
end;