Hi Luiz
The correct method would be as follows:
function _FindTag(DicomTags : TIEDicomTags; Group: Word; Element: Word): PIEDicomTag;
procedure _ParseTags(tags: TIEDicomTags);
var
i, j: integer;
tag: PIEDicomTag;
begin
for i := 0 to tags.Count - 1 do
begin
// GET DATA
tag := tags.GetTag(i);
if ( tag^.Group = Group ) and ( tag^.Element = Element ) then
begin
Result := tag;
Exit;
end;
// PARSE ANY CHILDREN
if assigned( tag.Children ) then
begin
// tag.Children is a TObjectList object, where each item is a TIEDicomTags object to pass recursively into ShowRawTags
for j := 0 to tag.Children.Count - 1 do
begin
_ParseTags( tag.Children[j] as TIEDicomTags );
// Found tag?
if Result <> nil then
Exit;
end;
end;
end;
end;
begin
result := nil;
_ParseTags( DicomTags );
end;
procedure TMainForm.Button1Click(Sender: TObject);
var
a1: PIEDicomTag;
s: string;
tb: TStream;
begin
a1 := _FindTag( ImageEnMView1.MIO.Params[0].DICOM_Tags, $7FE0, $0010 );
if not assigned( a1 ) then
exit;
tb:=TMemoryStream.Create;
try
tb.Size := a1.DataLen;
tb.Write( a1.Data, tb.Size );
tb.Position := 0;
if ImageEnView1.io.LoadFromStream( tb ) = False then
Raise Exception.Create( 'Load Error');
finally
tb.Free;
end;
end;
However the format of the image in "Pixel Data" is not recognized by ImageEn.
Nigel
Xequte Software
www.xequte.com
nigel@xequte.com