Iterating inside a sequence

51 views
Skip to first unread message

javier....@alma3d.com

unread,
Mar 19, 2014, 11:55:15 AM3/19/14
to nano...@googlegroups.com
Hi All, 

I'm trying to read all occurrences from an element inside a sequence. After searching in this ggoogle group I wrote this code but I don't know how to carry on. Indeed I have that

(003a,0200) is a sequence that have n (003a,0208) sequences, and inside this, I want to read (0008,0100) value. To do this my code is like:


$CDSeq = $dicom->dataset_value( $WFitems, 0x003A, 0x0200);
$CDitems = $dicom->dataset_value( $CDSeq, 0xFFFE, 0xE000);

$CSSeq = $dicom->dataset_value( $CDitems, 0x003A, 0x0208);
$CSitems = $dicom->dataset_value( $CSSeq, 0xFFFE, 0xE000);

$value = $dicom->dataset_value( $CSitems, 0x0008, 0x0100);


At this point, I have the first  (0008,0100)  value, but I don't know the way to get (0008,0100) value from next (003a,0208) sequence.

Thanks for your help



Nano.

unread,
Mar 20, 2014, 2:00:56 AM3/20/14
to nano...@googlegroups.com
Hi Javier,

I don't have a correct answer at this point, but I will recommend you to take a look at this gist https://gist.github.com/nanodocumet/7034466 and also at the code of the dumper tool.

Certainly dealing with sequences is a weak point in Nanodicom.

If you have an anonymized sample dicom file I might be able to take a look of it.

Regards,

Nano.


--
You received this message because you are subscribed to the Google Groups "nanodicom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nanodicom+...@googlegroups.com.
To post to this group, send email to nano...@googlegroups.com.
Visit this group at http://groups.google.com/group/nanodicom.
For more options, visit https://groups.google.com/d/optout.

javier....@alma3d.com

unread,
Mar 20, 2014, 4:13:20 AM3/20/14
to nano...@googlegroups.com
Hi Nano,

thank you so much for answer me in a few time. As you can see, mi code is based on this https://gist.github.com/nanodocumet/7034466, but in this sample,
$seq is the first sequence with (0x0054, 0x0016) tag, but there's no sample to get the next sequence with the same tag. I've attached an anonymized dicom to show you my situation. 
In this file you can see something like this:

....

    (003a,0200) SQ (Sequence with undefined length #=12)    # u/l, 1 ChannelDefinitionSequence
      (fffe,e000) na (Item with undefined length #=10)        # u/l, 1 Item
        (003a,0208) SQ (Sequence with undefined length #=1)     # u/l, 1 ChannelSourceSequence
          (fffe,e000) na (Item with undefined length #=4)         # u/l, 1 Item
            (0008,0100) SH [5.6.3-9-1]                              #  10, 1 CodeValue

....

        (003a,0208) SQ (Sequence with undefined length #=1)     # u/l, 1 ChannelSourceSequence
          (fffe,e000) na (Item with undefined length #=4)         # u/l, 1 Item
            (0008,0100) SH [5.6.3-9-2]                              #  10, 1 CodeValue

...

so I just want to get all   (0008,0100) values, something like: "5.6.3-9-1", "5.6.3-9-2", "5.6.3-9-61", and so on.
anonimus_dicom.zip

Nano.

unread,
Mar 24, 2014, 3:13:45 PM3/24/14
to nano...@googlegroups.com
Hi Javier,

Thanks for the dicom file. It helped troubleshooting.


You will need to download the latest version of the code: https://github.com/nanodocumet/Nanodicom

Hope that helps.

Thanks!

Nano.


javier....@alma3d.com

unread,
Mar 25, 2014, 10:12:25 AM3/25/14
to nano...@googlegroups.com
Hi Nano,

I get the latest version and it seems that everything works.

thank you so much,

Javier
Reply all
Reply to author
Forward
0 new messages