GetFloatValue Example for Delphi
var
uCount, x: Cardinal;
nRet: Integer;
begin
LEADDicom1.EnableMethodErrors := false;
{ move to the root element }
LEADDicom1.MoveFirstElement(false);
LEADDicom1.MoveRootElement();
{ insert a new element for the Float Values }
LEADDicom1.InsertElement(false, TAG_TABLE_OF_PARAMETER_VALUES, VR_FL, false, 0);
{ insert some float values into the element }
LEADDicom1.FloatValueCount := 5;
For x := 0 To 5 - 1 do
LEADDicom1.FloatValues[x] := x * 1.99;
{ set the floats }
nRet := LEADDicom1.SetFloatValue(5);
If nRet <> SUCCESS Then
begin
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
Exit;
end;
LEADDicom1.FloatValueCount := 0; { free the values }
Memo1.Lines.Clear();
{ get the value count }
uCount := LEADDicom1.GetValueCount();
ShowMessage('There are ' + IntToStr(uCount) + ' values!');
{ get the values }
nRet := LEADDicom1.GetFloatValue(0, uCount);
If nRet = SUCCESS Then
For x := 0 To LEADDicom1.FloatValueCount - 1 do
{ display each value in a new line }
Memo1.Lines.Add(FloatToStr(LEADDicom1.FloatValues[x]));
LEADDicom1.EnableMethodErrors := true;
ShowMessage('wait');
End;