You are using some DICOM terms in the wrong way. From your post it is clear that you dont really know what a sequence attribute is. Here's a short explanation:
- A special case among the DICOM data types is the sequence („Sequence of Items“, SQ), which can be used to create hierarchical data structures
- Attribute value is an order list of so-called „Items“
- An item is a frame structure containing a complete DICOM data set
Therefore, the value of a sequence is a list of DICOM data sets which again may contain sequences, and so on.
- Most of the time, all items of a sequence have the same structure (analogy: an array of structs in C/C++)
- There are a few sequences, though, where each item may have a different structure.
So actually, when you look at this
Code: Select all
(0018,6011) SQ (Sequence with explicit length #=1) # 140, 1 SequenceOfUltrasoundRegions
(fffe,e000) na (Item with explicit length #=11) # 132, 1 Item
(0018,6012) US 1 # 2, 1 RegionSpatialFormat
(0018,6014) US 1 # 2, 1 RegionDataType
(0018,6016) UL 2 # 4, 1 RegionFlags
(0018,6018) UL 84 # 4, 1 RegionLocationMinX0
(0018,601a) UL 98 # 4, 1 RegionLocationMinY0
(0018,601c) UL 1009 # 4, 1 RegionLocationMaxX1
(0018,601e) UL 758 # 4, 1 RegionLocationMaxY1
(0018,6024) US 3 # 2, 1 PhysicalUnitsXDirection
(0018,6026) US 3 # 2, 1 PhysicalUnitsYDirection
(0018,602c) FD 0.00663887 # 8, 1 PhysicalDeltaX
(0018,602e) FD 0.00663887 # 8, 1 PhysicalDeltaY
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
you could say that
- (0018,6011) is a sequence attribute
- this sequence attribute contains one item
- this one item contains (a dataset that consists of) 11 attributes
In order to make the notion of a sequence clear to you, here is another example of a sequence:
Code: Select all
(0018,6011) SQ (Sequence with explicit length #=2) # 140, 1 SequenceOfUltrasoundRegions
(fffe,e000) na (Item with explicit length #=11) # 132, 1 Item
(0018,6012) US 1 # 2, 1 RegionSpatialFormat
(0018,6014) US 1 # 2, 1 RegionDataType
(0018,6016) UL 2 # 4, 1 RegionFlags
(0018,6018) UL 84 # 4, 1 RegionLocationMinX0
(0018,601a) UL 98 # 4, 1 RegionLocationMinY0
(0018,601c) UL 1009 # 4, 1 RegionLocationMaxX1
(0018,601e) UL 758 # 4, 1 RegionLocationMaxY1
(0018,6024) US 3 # 2, 1 PhysicalUnitsXDirection
(0018,6026) US 3 # 2, 1 PhysicalUnitsYDirection
(0018,602c) FD 0.00663887 # 8, 1 PhysicalDeltaX
(0018,602e) FD 0.00663887 # 8, 1 PhysicalDeltaY
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e000) na (Item with explicit length #=11) # 132, 1 Item
(0018,6012) US 1 # 2, 1 RegionSpatialFormat
(0018,6014) US 1 # 2, 1 RegionDataType
(0018,6016) UL 2 # 4, 1 RegionFlags
(0018,6018) UL 74 # 4, 1 RegionLocationMinX0
(0018,601a) UL 88 # 4, 1 RegionLocationMinY0
(0018,601c) UL 1019 # 4, 1 RegionLocationMaxX1
(0018,601e) UL 768 # 4, 1 RegionLocationMaxY1
(0018,6024) US 3 # 2, 1 PhysicalUnitsXDirection
(0018,6026) US 3 # 2, 1 PhysicalUnitsYDirection
(0018,602c) FD 0.00763887 # 8, 1 PhysicalDeltaX
(0018,602e) FD 0.00763887 # 8, 1 PhysicalDeltaY
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
For this sequence you could say that
- (0018,6011) is a sequence attribute
- this sequence attribute contains two items
- these two items each contain (a dataset that consists of) 11 attributes
(Regarding sequences, look at part 3 of the DICOM standard in any IOD description. Attributes inside a sequence are labeled with the ">" character.)
Now regarding your question: Actually I think you would like to query the number of items within a sequence attribute. (In the first example above, this query would return "1", in the second example above, this query would return "2".) You can easiliy do this, see the following example:
Code: Select all
DcmSequenceOfItems *sequenceElement;
...
// if the sequence contains exactly one empty item
if( sequenceElement->card() == 1 )
{
// if the first item of the sequence element is empty
if( sequenceElement->getItem(0)->card() == 0 )
{
// do something
...
}
else
{
// do something else if the first item of the sequence is not empty
...
}
}
I hope this answers your question.