ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Read dicom image icon
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jwest

Brazil
67 Posts

Posted - May 23 2016 :  08:14:31  Show Profile  Reply
Hi,

Please, How could I read this icon:

(0088,0200) Icon Image Sequence (SQ) : ""
(0028,0002) Samples per Pixel (US) : "1"
(0028,0004) Photometric Interpretation (CS) : "MONOCHROME2 "
(0028,0010) Rows (US) : "128"
(0028,0011) Columns (US) : "128"
(0028,0100) Bits Allocated (US) : "8"
(0028,0101) Bits Stored (US) : "8"
(0028,0102) High Bit (US) : "7"
(7FE0,0010) Pixel Data (OW) : "џСгМХЖЛЫЧвЯжиаЩнрнклхтычхџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ"

I am doing the next, but no image is showing in imageenview.
ieview_ico:TImageEnView;
....
.....

var  a1,b1: PIEDicomTag;
         i: Integer;
         s:string;
         tb:Tstream;
    begin
        a1 := aTags.GetTag($88, $200);
        if not assigned(a1) then exit;
        if assigned(a1.Children) then begin
            b1:=TIEDicomTags(a1.Children[0]).GetTag($7FE0,$0010);
            tb:=TMemoryStream.Create;
            try
             tb.Size:=b1.DataLen;
             i:=tb.Write(b1.Data,tb.Size);
             tb.Position:=0;;
             ieview_ico.io.LoadFromStream(tb);
            finally
              tb.Free;
            end;
        end;
    end;

xequte

38978 Posts

Posted - May 23 2016 :  18:49:56  Show Profile  Reply
Hi

Can you attach your source DICOM file?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

jwest

Brazil
67 Posts

Posted - May 23 2016 :  20:06:19  Show Profile  Reply
Hi, Mr Nigel

I canДt post the file using the file attach of the forum.

My file is a DICOMDIR file.

I create this dicomdir with dcmdir from dcmcache.

Link to file:

https://dl.dropboxusercontent.com/u/91247895/dicomdir.zip

I didnДt attached the FILE0 file(mentioned into dicomdir file), because itДs not necessary for now. Only to know, FILE0 is only a copy of original dicom image used for dcmdir to create the DICOMDIR.

Luiz
Go to Top of Page

xequte

38978 Posts

Posted - May 24 2016 :  19:51:06  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: