pydicom.sequence.Sequence¶
-
class
pydicom.sequence.
Sequence
(iterable: Optional[Iterable[pydicom.dataset.Dataset]] = None)[source]¶ Class to hold multiple
Dataset
in alist
.This class is derived from
MultiValue
and as such enforces that all items added to the list areDataset
instances. In order to do this, a validator is substituted for type_constructor when constructing theMultiValue
super class.-
__init__
(iterable: Optional[Iterable[pydicom.dataset.Dataset]] = None) → None[source]¶ Initialize a list of
Dataset
.
Methods
__init__
([iterable])Initialize a list of
Dataset
.append
(val)Append a
Dataset
to the sequence.clear
()count
(value)extend
(val)index
(value, [start, [stop]])Raises ValueError if the value is not present.
insert
(position, val)Insert a
Dataset
into the sequence.pop
([index])Raise IndexError if list is empty or index is out of range.
remove
(value)S.remove(value) – remove first occurrence of value.
reverse
()S.reverse() – reverse IN PLACE
sort
([key, reverse])Attributes
Return a weak reference to the parent
Dataset
.-
append
(val: pydicom.dataset.Dataset) → None[source]¶ Append a
Dataset
to the sequence.
-
extend
(val: Iterable[pydicom.dataset.Dataset]) → None[source]¶
-