GetDoubleValue Example for Delphi
Procedure TForm1.TestProc6();
var
nCount: Integer;
x: Integer;
nRet: Integer;
begin
LEADDicomDS1.EnableMethodErrors:= False;
//move to the root element
LEADDicomDS1.MoveFirstElement (False);
LEADDicomDS1.MoveRootElement ();
//insert a new element for the Double Values
LEADDicomDS1.InsertElement (False, TAG_REFERENCE_PIXEL_PHYSICAL_VALUE_X, VR_FD, False, 0);
Edit1.Visible:= True;
Edit1.Text:= '';
//insert some Double values into the element
LEADDicomDS1.DoubleValueCount:= 5;
for x:= 0 to 5 - 1 do
LEADDicomDS1.DoubleValues[x]:= 10 * x * 199.77;
//set the floats
nRet:= LEADDicomDS1.SetDoubleValue(5);
if(nRet <> 0)then
begin
ShowMessage('Error');
Exit;
end;
LEADDicomDS1.DoubleValueCount:= 0; //free the values
Edit1.Visible:= True;
Edit1.Text:= '';
//get the value count
nCount:= LEADDicomDS1.GetValueCount ();
ShowMessage('There are ' + IntToStr(nCount) + ' values!');
//get the values
nRet:= LEADDicomDS1.GetDoubleValue(0, nCount);
if(nRet = 0)then
begin
for x:= 0 To LEADDicomDS1.DoubleValueCount - 1 do
//display each value separated by a ' X '
Edit1.Text:= Edit1.Text + ' X ' + FloatToStr(LEADDicomDS1.DoubleValues[x]);
end;
LEADDicomDS1.EnableMethodErrors:= True;
end;