Re: HELP : sequence data element in DICOM - DICOM

This is a discussion on Re: HELP : sequence data element in DICOM - DICOM ; On Jul 16, 8:16*am, budhik wrote: > Hi, I'm not so clear about sequence data element in DICOM > specification and its encoding scheme. > Is there any one can describe a sample of the implementation of the > "SQ" ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Re: HELP : sequence data element in DICOM

  1. Re: HELP : sequence data element in DICOM

    On Jul 16, 8:16*am, budhik wrote:
    > Hi, I'm not so clear about sequence data element in DICOM
    > specification and its encoding scheme.
    > Is there any one can describe a sample of the implementation of the
    > "SQ" data element and its encoding scheme ?
    >
    > Best regards,
    > Budhi


    Again as David told you, use the version with undefined length. it is
    not so difficult.
    It is an example only make sure you understand the concept what needs
    to implement.
    You could implement to add the Item Tag and Delimiters kind of fixed.
    Assuming Transfer Syntax is Explicit Little Endian, let's say you want
    to encode a Tag 0054, 0012 SQ
    Start the sequence with:
    54 00 12 00 53 51 00 00 FF FF FF FF
    FE FF 00 E0 FF FF FF FF < 1st
    Item
    xxxxxxxxxxxxxxxxxx < Tags
    of your first item (see posting with UID)
    FE FF oD E0 00 00 00 00 < Item
    Delimiter
    FE FF 00 E0 FF FF FF FF < 2nd
    Item
    xxxxxxxxxxxxxxxxxx < Tags
    of your 2nd item (see posting with UID)
    FE FF 0D E0 00 00 00 00 < Item
    Delimiter
    FE FF DD E0 00 00 00 00 <
    Sequence Delimiter
    Note there are no VR's in the Delimiter "Tag".

    Thomas

  2. Re: HELP : sequence data element in DICOM

    Look for a tool called DICOM Inspector .NET. It opens any existing
    DICOM file and shows both DICOM and HEX interpretation at the same
    time.
    I am not the author of that tool. Might help you if you need more
    examples.


  3. Re: HELP : sequence data element in DICOM

    On Jul 16, 4:47 pm, Thomas Freier wrote:
    > On Jul 16, 8:16 am, budhik wrote:
    >
    > > Hi, I'm not so clear about sequence data element in DICOM
    > > specification and its encoding scheme.
    > > Is there any one can describe a sample of the implementation of the
    > > "SQ" data element and its encoding scheme ?

    >
    > > Best regards,
    > > Budhi

    >
    > Again as David told you, use the version with undefined length. it is
    > not so difficult.
    > It is an example only make sure you understand the concept what needs
    > to implement.
    > You could implement to add the Item Tag and Delimiters kind of fixed.
    > Assuming Transfer Syntax is Explicit Little Endian, let's say you want
    > to encode a Tag 0054, 0012 SQ
    > Start the sequence with:
    > 54 00 12 00 53 51 00 00 FF FF FF FF
    > FE FF 00 E0 FF FF FF FF < 1st
    > Item
    > xxxxxxxxxxxxxxxxxx < Tags
    > of your first item (see posting with UID)
    > FE FF oD E0 00 00 00 00 < Item
    > Delimiter
    > FE FF 00 E0 FF FF FF FF < 2nd
    > Item
    > xxxxxxxxxxxxxxxxxx < Tags
    > of your 2nd item (see posting with UID)
    > FE FF 0D E0 00 00 00 00 < Item
    > Delimiter
    > FE FF DD E0 00 00 00 00 <
    > Sequence Delimiter
    > Note there are no VR's in the Delimiter "Tag".
    >
    > Thomas


    Hi Thomas,

    Yes, I'm trying to follow David's recommendation.

    Let's say, I have a sequence A that contains sequence B and sequence
    C. Sequence B contains 3 items, and sequence C contains 2 items.
    Let's say, the structure is :

    Sequence A (0054, 0012 SQ)
    > Sequence B (0055, 0015 SQ)
    >> Item B1 (0011, 0001 - UI - "Blood flow")
    >> Item B2 (0011, 0002 - DS - 110)
    >> Item B3 (0011, 0003 - AE - "Brad Pit")

    > Sequence C (0056, 0020 SQ)
    >> Item C1 (0022, 0001 - UI - "Blood pressure")
    >> Item C2 (0022, 0002 - DS - 200)


    What is the correct syntax in explicit little endian ?

    Regards,
    Budhi

  4. Re: HELP : sequence data element in DICOM

    On Jul 16, 3:41*pm, budhik wrote:
    > On Jul 16, 4:47 pm, Thomas Freier wrote:
    >
    >
    >
    >
    >
    > > On Jul 16, 8:16 am, budhik wrote:

    >
    > > > Hi, I'm not so clear about sequence data element in DICOM
    > > > specification and its encoding scheme.
    > > > Is there any one can describe a sample of the implementation of the
    > > > "SQ" data element and its encoding scheme ?

    >
    > > > Best regards,
    > > > Budhi

    >
    > > Again as David told you, use the version with undefined length. it is
    > > not so difficult.
    > > It is an example only make sure you understand the concept what needs
    > > to implement.
    > > You could implement to add the Item Tag and Delimiters kind of fixed.
    > > Assuming Transfer Syntax is Explicit Little Endian, let's say you want
    > > to encode a Tag 0054, 0012 SQ
    > > Start the sequence with:
    > > 54 00 12 00 53 51 00 00 FF FF FF FF
    > > FE FF 00 E0 FF FF FF FF * * * * * * * * * * * ** * * * * * *< 1st
    > > Item
    > > xxxxxxxxxxxxxxxxxx * * * * * * * * * * * * * * * * * * * * * * *< Tags
    > > of your first item (see posting with UID)
    > > FE FF oD E0 00 00 00 00 * * * * * * * * * * * ** * * * * * * *< Item
    > > Delimiter
    > > FE FF 00 E0 FF FF FF FF * * * * * * * * * * * ** * * * * * *< 2nd
    > > Item
    > > xxxxxxxxxxxxxxxxxx * * * * * * * * * * * * * * * * * * * * * * *< Tags
    > > of your 2nd item (see posting with UID)
    > > FE FF 0D E0 00 00 00 00 * * * * * * * * * * * ** * * * * * * < Item
    > > Delimiter
    > > FE FF DD E0 00 00 00 00 * * * * * * * * * * * ** * * * * * * <
    > > Sequence Delimiter
    > > Note there are no VR's in the Delimiter "Tag".

    >
    > > Thomas

    >
    > Hi Thomas,
    >
    > Yes, I'm trying to follow David's recommendation.
    >
    > Let's say, I have a sequence A that contains sequence B and sequence
    > C. Sequence B contains 3 items, and sequence C contains 2 items.
    > Let's say, the structure is :
    >
    > Sequence A (0054, 0012 SQ)
    >
    > > * * Sequence B (0055, 0015 SQ)
    > >> * * * * *Item B1 (0011, 0001 - UI - "Blood flow")
    > >> * * * * *Item B2 (0011, 0002 - DS - 110)
    > >> * * * * *Item B3 (0011, 0003 - AE - "Brad Pit")

    > > * * Sequence C (0056, 0020 SQ)
    > >> * * * * *Item C1 (0022, 0001 - UI - "Blood pressure")
    > >> * * * * *Item C2 (0022, 0002 - DS - 200)

    >
    > What is the correct syntax in explicit little endian ?
    >
    > Regards,
    > Budhi- Hide quoted text -
    >
    > - Show quoted text -


    Budhi,
    honestly it's "hard work" to encode this things manually kind of
    hopless. You can't do it by examples only, but rather have to program
    the rules into your software.
    Having said that if you do need more samples:
    Get the DICOM Hex tool and have a look at some examples, you will
    instantly see.
    Or you follow the example I posted before and simply replace the
    xxxxxxxx with another sequence starting with the Tag
    55 00 15 00 53 51 00 FF FF FF FF .... to get a nested structure. It
    is very straightforward.

    Thomas

  5. Re: HELP : sequence data element in DICOM

    Hi Budhi

    budhik wrote:

    > Let's say, I have a sequence A that contains sequence B and sequence
    > C. Sequence B contains 3 items, and sequence C contains 2 items.
    > Let's say, the structure is :
    >
    > Sequence A (0054, 0012 SQ)
    >> Sequence B (0055, 0015 SQ)
    >>> Item B1 (0011, 0001 - UI - "Blood flow")
    >>> Item B2 (0011, 0002 - DS - 110)
    >>> Item B3 (0011, 0003 - AE - "Brad Pit")

    >> Sequence C (0056, 0020 SQ)
    >>> Item C1 (0022, 0001 - UI - "Blood pressure")
    >>> Item C2 (0022, 0002 - DS - 200)


    This is wrong in many ways:

    - a Sequence Item is a complete data set, not a single data element,
    and it begins with a Sequence Item tag (FFFE,E000), and in the
    undefined length form (recommended) ends with the Item Delimitation
    tag (FFFE,E00D)

    - within the Sequence Item is the data set, i.e., another numerically
    sorted list of data elements, which in turn may contain sequence
    as well

    - your incorrect example items that are data elements are also wrong,
    even if they were valid items, in that they are private data elements
    (odd group) but are not of the correct data element range - data
    element ranges 00xx encode the private creator for the block of
    private elements xx00

    - things with a VR of UI are unique identifiers (1.2.nnn...), not plain
    text strings like "blood flow"

    - things with a VR of AE are application entity titles, not plain
    text strings like "Brad Pit"

    - if you are going to send things like "blood flow" and "blood pressure"
    do not do this as private elements - these should be in annotations or
    acquisition context in the waveform object or in separate SR objects

    David

  6. Re: HELP : sequence data element in DICOM

    On Jul 17, 6:57 pm, David Clunie wrote:
    > Hi Budhi
    >
    > budhik wrote:
    > > Let's say, I have a sequence A that contains sequence B and sequence
    > > C. Sequence B contains 3 items, and sequence C contains 2 items.
    > > Let's say, the structure is :

    >
    > > Sequence A (0054, 0012 SQ)
    > >> Sequence B (0055, 0015 SQ)
    > >>> Item B1 (0011, 0001 - UI - "Blood flow")
    > >>> Item B2 (0011, 0002 - DS - 110)
    > >>> Item B3 (0011, 0003 - AE - "Brad Pit")
    > >> Sequence C (0056, 0020 SQ)
    > >>> Item C1 (0022, 0001 - UI - "Blood pressure")
    > >>> Item C2 (0022, 0002 - DS - 200)

    >
    > This is wrong in many ways:
    >
    > - a Sequence Item is a complete data set, not a single data element,
    > and it begins with a Sequence Item tag (FFFE,E000), and in the
    > undefined length form (recommended) ends with the Item Delimitation
    > tag (FFFE,E00D)
    >
    > - within the Sequence Item is the data set, i.e., another numerically
    > sorted list of data elements, which in turn may contain sequence
    > as well
    >
    > - your incorrect example items that are data elements are also wrong,
    > even if they were valid items, in that they are private data elements
    > (odd group) but are not of the correct data element range - data
    > element ranges 00xx encode the private creator for the block of
    > private elements xx00
    >
    > - things with a VR of UI are unique identifiers (1.2.nnn...), not plain
    > text strings like "blood flow"
    >
    > - things with a VR of AE are application entity titles, not plain
    > text strings like "Brad Pit"
    >
    > - if you are going to send things like "blood flow" and "blood pressure"
    > do not do this as private elements - these should be in annotations or
    > acquisition context in the waveform object or in separate SR objects
    >
    > David


    Hmm.... ok....

    Btw, for the VR of "OW", should I treat them with the same way as
    "SQ" ?
    I mean, should I use same nested tags as sequence ?
    I have an "OW" for 5400,100a and 5400,1010 that contains original
    signals of 12-lead ECG.

    Please advise,
    Budhi

  7. Re: HELP : sequence data element in DICOM

    On Jul 17, 5:27*pm, budhik wrote:
    > On Jul 17, 6:57 pm, David Clunie wrote:
    >
    >
    >
    >
    >
    > > Hi Budhi

    >
    > > budhik wrote:
    > > > Let's say, I have a sequence A that contains sequence B and sequence
    > > > C. Sequence B contains 3 items, and sequence C contains 2 items.
    > > > Let's say, the structure is :

    >
    > > > Sequence A (0054, 0012 SQ)
    > > >> * * Sequence B (0055, 0015 SQ)
    > > >>> * * * * *Item B1 (0011, 0001 - UI - "Blood flow")
    > > >>> * * * * *Item B2 (0011, 0002 - DS - 110)
    > > >>> * * * * *Item B3 (0011, 0003 - AE - "Brad Pit")
    > > >> * * Sequence C (0056, 0020 SQ)
    > > >>> * * * * *Item C1 (0022, 0001 - UI - "Blood pressure")
    > > >>> * * * * *Item C2 (0022, 0002 - DS - 200)

    >
    > > This is wrong in many ways:

    >
    > > - a Sequence Item is a complete data set, not a single data element,
    > > * *and it begins with a Sequence Item tag (FFFE,E000), and in the
    > > * *undefined length form (recommended) ends with the Item Delimitation
    > > * *tag (FFFE,E00D)

    >
    > > - within the Sequence Item is the data set, i.e., another numerically
    > > * *sorted list of data elements, which in turn may contain sequence
    > > * *as well

    >
    > > - your incorrect example items that are data elements are also wrong,
    > > * *even if they were valid items, in that they are private data elements
    > > * *(odd group) but are not of the correct data element range - data
    > > * *element ranges 00xx encode the private creator for the block of
    > > * *private elements xx00

    >
    > > - things with a VR of UI are unique identifiers (1.2.nnn...), not plain
    > > * *text strings like "blood flow"

    >
    > > - things with a VR of AE are application entity titles, not plain
    > > * *text strings like "Brad Pit"

    >
    > > - if you are going to send things like "blood flow" and "blood pressure"
    > > * *do not do this as private elements - these should be in annotations or
    > > * *acquisition context in the waveform object or in separate SR objects

    >
    > > David

    >
    > Hmm.... ok....
    >
    > Btw, for the VR of "OW", should I treat them with the same way as
    > "SQ" ?
    > I mean, should I use same nested tags as sequence ?
    > I have an "OW" for 5400,100a and 5400,1010 that contains original
    > signals of 12-lead ECG.
    >
    > Please advise,
    > Budhi- Hide quoted text -
    >
    > - Show quoted text -


    Hi Budhi,

    I think you can find information about this in Section 8.3 WAVEFORM
    DATA AND RELATED DATA ELEMENTS of DICOM Standard PDF No. 5. "Data
    Structures & Encoding" (Experts, if I am wrong please correct! )

    If I come across any other information will let you know.
    All the Best!

    Thanks.
    Prashant

  8. Re: HELP : sequence data element in DICOM

    On Jul 17, 9:49 pm, PacificPrashant wrote:
    > On Jul 17, 5:27 pm, budhik wrote:
    >
    >
    >
    > > On Jul 17, 6:57 pm, David Clunie wrote:

    >
    > > > Hi Budhi

    >
    > > > budhik wrote:
    > > > > Let's say, I have a sequence A that contains sequence B and sequence
    > > > > C. Sequence B contains 3 items, and sequence C contains 2 items.
    > > > > Let's say, the structure is :

    >
    > > > > Sequence A (0054, 0012 SQ)
    > > > >> Sequence B (0055, 0015 SQ)
    > > > >>> Item B1 (0011, 0001 - UI - "Blood flow")
    > > > >>> Item B2 (0011, 0002 - DS - 110)
    > > > >>> Item B3 (0011, 0003 - AE - "Brad Pit")
    > > > >> Sequence C (0056, 0020 SQ)
    > > > >>> Item C1 (0022, 0001 - UI - "Blood pressure")
    > > > >>> Item C2 (0022, 0002 - DS - 200)

    >
    > > > This is wrong in many ways:

    >
    > > > - a Sequence Item is a complete data set, not a single data element,
    > > > and it begins with a Sequence Item tag (FFFE,E000), and in the
    > > > undefined length form (recommended) ends with the Item Delimitation
    > > > tag (FFFE,E00D)

    >
    > > > - within the Sequence Item is the data set, i.e., another numerically
    > > > sorted list of data elements, which in turn may contain sequence
    > > > as well

    >
    > > > - your incorrect example items that are data elements are also wrong,
    > > > even if they were valid items, in that they are private data elements
    > > > (odd group) but are not of the correct data element range - data
    > > > element ranges 00xx encode the private creator for the block of
    > > > private elements xx00

    >
    > > > - things with a VR of UI are unique identifiers (1.2.nnn...), not plain
    > > > text strings like "blood flow"

    >
    > > > - things with a VR of AE are application entity titles, not plain
    > > > text strings like "Brad Pit"

    >
    > > > - if you are going to send things like "blood flow" and "blood pressure"
    > > > do not do this as private elements - these should be in annotations or
    > > > acquisition context in the waveform object or in separate SR objects

    >
    > > > David

    >
    > > Hmm.... ok....

    >
    > > Btw, for the VR of "OW", should I treat them with the same way as
    > > "SQ" ?
    > > I mean, should I use same nested tags as sequence ?
    > > I have an "OW" for 5400,100a and 5400,1010 that contains original
    > > signals of 12-lead ECG.

    >
    > > Please advise,
    > > Budhi- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Hi Budhi,
    >
    > I think you can find information about this in Section 8.3 WAVEFORM
    > DATA AND RELATED DATA ELEMENTS of DICOM Standard PDF No. 5. "Data
    > Structures & Encoding" (Experts, if I am wrong please correct! )
    >
    > If I come across any other information will let you know.
    > All the Best!
    >
    > Thanks.
    > Prashant


    I already see it, actually.

    Well... let's say I have 12-lead ECG signals (the numbers are in
    decimal/float) :

    2.471310 0.000000 0.028690 3.764345 3.721310 0.014345 0.027228
    0.000183 0.038740 0.042029 0.000000 0.000000
    2.390177 0.020284 0.130107 3.794770 3.630035 0.075195 0.123650
    0.000647 0.176115 0.191053 0.015533 0.009868
    2.300134 0.097415 0.297280 3.801225 3.501427 0.197348 0.282920
    0.010754 0.403556 0.437369 0.077483 0.055046
    2.243407 0.237025 0.493618 3.759784 3.374894 0.365321 0.470268
    0.052002 0.671834 0.727533 0.196039 0.154307
    2.219190 0.416453 0.697264 3.682178 3.260963 0.556858 0.664729
    0.137032 0.950845 1.028743 0.356180 0.303389

    Column 1 : ECG Lead I
    Column 2 : ECG Lead II
    Column 3 : ECG Lead III
    Column 4 : ECG Lead aVR
    Column 5 : ECG Lead aVL
    Column 6 : ECG Lead aVF
    Column 7 : ECG Lead 1
    Column 8 : ECG Lead 2
    Column 9 : ECG Lead 3
    Column 10 : ECG Lead 4
    Column 11 : ECG Lead 5
    Column 12 : ECG Lead 6

    For (5400,100a) I will use 1 row only, the VR is "OW".
    For (5400,1010) I will use all rows, the VR is "OW" also. I can do it
    by using looping of course.

    If I'm right, each column will become items in (5400,100a) either
    (5400,1010).

    So, the structure of (5400,100a) should be :

    00 54 0a 10 4F 57 00 00 FF FF FF FF
    FE FF 00 E0 FF FF FF FF < 1stItem
    column1
    < column1
    FE FF oD E0 00 00 00 00 < Item
    Delimiter
    FE FF 00 E0 FF FF FF FF < 2nd
    Item
    column2
    < column2
    FE FF 0D E0 00 00 00 00 < Item
    Delimiter
    .........
    nnnnnnnnnn <
    continued until column12
    .........
    FE FF DD E0 00 00 00 00 <
    Sequence Delimiter

    And for (5400,1010) will be looped until all signals placed as items.

    The question is :

    Is it true, it should be like that, or my algorithm is wrong ? What it
    should be ?

    Please advise,
    Budhi

+ Reply to Thread