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
 Dicom Tags
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Ronald Ruijs

Netherlands
24 Posts

Posted - Mar 24 2020 :  13:27:26  Show Profile  Reply
Hello,

Refer to attached Dicom Image, a multiframe (9 frames) that has per-frame different pixel spacing. I tried to acces those, using Per-frame Functional Groups Sequence ($5200, $9230).

Code:


  with IO.Params.DICOM_Tags do
  begin
    n := IndexOf($5200, $9230);

    if n >= 0 then
    begin
      c := GetTagChildren(n);
    end;

    ShowMessage(IntToStr(c.count);
  end;


I expected c.count to 9, equal to the number of frames. Instead, I got 1.

Am I using correct way to acces sequence, or is there somehing else I missed?

I also loaded this image in your demo project "Dicom". When displaying raw dicom tags, you can see that there is something strange with indentation, which increases with every frame. Same image checked with DCMTK (Offis) gave correct xml, with correct indentation (no nesting tags that should not be nested).

Regards, Ronald





attach/Ronald Ruijs/2020324132633_mr.zip
376.14 KB

xequte

38127 Posts

Posted - Mar 27 2020 :  17:16:02  Show Profile  Reply
Hi Ronald

In this file $5200,$9230 is sequence (SQ) with a single item. This item then contains 14 items. You can get these 14 items with:

var
  tags: TIEDicomTags;
  tag: PIEDicomTag;
  children: TObjectList;
begin
  imageenview.io.loadfromfiledicom('mr.dcm');
  tags := imageenview.IO.Params.DICOM_Tags;
  tag := tags.GetTag($5200, $9230);
  if (tag <> nil) then
  begin
    tags := tag^.Children[0] as TIEDicomTags;   // first item contains the actual sequence
    showmessage(inttostr(tags.Count));
  end;
end;



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Ronald Ruijs

Netherlands
24 Posts

Posted - Mar 27 2020 :  17:28:21  Show Profile  Reply
Hi Nigel,

Thank you for the reply. However, refer to attached xml representation, created with Offis DCMTK, which shows that $5200,$9230 is a sequence with 9 items, as expected per dicom standard http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.16.html).
Given the "Increasing indentation", could it be that ImageEn is missing a sequence ending somewhere?

Regards, Ronald


attach/Ronald Ruijs/2020327173426_mr.zip
9.5 KB
Go to Top of Page

xequte

38127 Posts

Posted - Mar 30 2020 :  05:48:47  Show Profile  Reply
Thanks for the feedback, Ronald. Upon investigation it turns out we are not reading the structure correctly on some types of DICOM. We have a fix. Can you please email me to test it.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: