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 ?
On Jul 16, 8:16 am, budhik <bud...@yahoo.com> 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".
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.
> On Jul 16, 8:16 am, budhik <bud...@yahoo.com> 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 :
> On Jul 16, 4:47 pm, Thomas Freier <Tho...@soft-gate.de> wrote:
> > On Jul 16, 8:16 am, budhik <bud...@yahoo.com> 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 :
> 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.
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 :
- 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
> 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 :
> - 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.
> On Jul 17, 6:57 pm, David Clunie <dclu...@dclunie.com> 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 :
> > - 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!
> On Jul 17, 5:27 pm, budhik <bud...@yahoo.com> wrote:
> > On Jul 17, 6:57 pm, David Clunie <dclu...@dclunie.com> 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 :
> > > - 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) :
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 ?