pydicom.sequence.Sequence¶
- class pydicom.sequence.Sequence(iterable: Iterable[Dataset] | None = None)[source]¶
Class to hold multiple
Datasetin alist.This class is derived from
MultiValueand as such enforces that all items added to the list areDatasetinstances. In order to do this, a validator is substituted for type_constructor when constructing theMultiValuesuper class.- __init__(iterable: Iterable[Dataset] | None = None) None[source]¶
Initialize a list of
Dataset.- Parameters:
iterable (list-like of dataset.Dataset, optional) – An iterable object (e.g.
list,tuple) containingDataset. If not used then an emptySequenceis generated.
Methods
__init__([iterable])Initialize a list of
Dataset.append(val)Append a
Datasetto the sequence.clear()count(value)extend(val)index(value, [start, [stop]])Raises ValueError if the value is not present.
insert(position, val)Insert a
Datasetinto 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(*args, **kwargs)Attributes
Return a weak reference to the parent Dataset
Return a weak reference to the parent
Dataset.