Class Sequence

Class Sequence

Namespace: Aspose.Medical.Dicom.Elements
Assembly: Aspose.Medical.dll (25.11.0)

Encapsulates the Sequence of Items (SQ) VR type. https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html#:~:text=SQ-,Sequence%20of%20Items,-Value%20is%20a .

public sealed class Sequence : IElement, IEnumerable<dataset>, IEnumerable

Inheritance

object Sequence

Implements

IElement , IEnumerable<dataset> , IEnumerable

Inherited Members

object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

Sequence(Tag, IEnumerable<dataset>)

Initializes a new instance of the Aspose.Medical.Dicom.Elements.Sequence.

public Sequence(Tag tag, IEnumerable<dataset> items)

Parameters

tag Tag

Element’s tag.

items IEnumerable < Dataset &gt;

Sequence items (nested datasets).

Properties

Count

The number of elements contained in this element. Read-only System.Int32.

public int Count { get; }

Property Value

int

Items

The dataset items constituting the sequence. Read-only System.Collections.Generic.IReadOnlyCollection`1 of Aspose.Medical.Dicom.Dataset.

public Dataset[] Items { get; }

Property Value

Dataset []

Tag

The DICOM tag associated with the element. Read-only Aspose.Medical.Dicom.Elements.IElement.Tag.

public Tag Tag { get; }

Property Value

Tag

ValueRepresentation

The Value Representation of the element. Read-only Aspose.Medical.Dicom.Elements.IElement.ValueRepresentation.

public ValueRepresentation ValueRepresentation { get; }

Property Value

ValueRepresentation

Methods

Get<t>(int)

Returns the element’s value at the specified position.

public T Get<t>(int index)

Parameters

index int

The zero-based index of the element to retrieve.

Returns

T

The T value.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value.

Get<t>(Index)

Returns the element’s value at the specified position.

public T Get<t>(Index index)

Parameters

index Index

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

Returns

T

The T value.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value.

Get(int)

Gets the element at the given index

public Dataset Get(int index)

Parameters

index int

Index of an element to retrieve.

Returns

Dataset

The Aspose.Medical.Dicom.Dataset at the given index.

Exceptions

IndexOutOfRangeException

index is less than 0 or index is equal to or greater than Aspose.Medical.Dicom.Elements.Sequence.Count.

GetEnumerator()

public IEnumerator<dataset> GetEnumerator()

Returns

IEnumerator < Dataset &gt;

GetOrDefault<t>(int)

Returns the element’s value at the specified position or a default value if the index is out of range.

public T? GetOrDefault<t>(int index)

Parameters

index int

The zero-based index of the element value to retrieve.

Returns

T?

The T value.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value.

GetOrDefault<t>(Index)

Returns the element’s value at the specified position or a default value if the index is out of range.

public T? GetOrDefault<t>(Index index)

Parameters

index Index

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

Returns

T?

The T value.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value.

GetValues<t>()

Returns the element’s values.

public Span<t> GetValues<t>()

Returns

Span <t>

The element’s data.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value.

GetValues()

Returns the element’s values.

public Span<dataset> GetValues()

Returns

Span < Dataset &gt;

The element’s data.

GetValues<t>(Range)

Returns the element’s values at the specified range.

public Span<t> GetValues<t>(Range range)

Parameters

range Range

The range of the element values to retrieve.

Returns

Span <t>

The element’s data.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value.

GetValues(Range)

Returns the element’s values at the specified range.

public Span<dataset> GetValues(Range range)

Parameters

range Range

The range of the element values to retrieve.

Returns

Span < Dataset &gt;

The element’s data.

ToString()

public override string ToString()

Returns

string

TryGetValue<t>(int, out T?)

Gets the element’s value at the specified position.

public bool TryGetValue<t>(int index, out T? value)

Parameters

index int

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

value T?

When this method returns, contains the value at the specified position (index); otherwise, contains the default value for the type of the value parameter.

Returns

bool

true if the element value could be extracted; otherwise, false.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value.

TryGetValue<t>(Index, out T?)

Gets the element’s value at the specified position.

public bool TryGetValue<t>(Index index, out T? value)

Parameters

index Index

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

value T?

When this method returns, contains the value at the specified position (index); otherwise, contains the default value for the type of the value parameter.

Returns

bool

true if the element value could be extracted; otherwise, false.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Sequence can only return Dataset as a value. </t></t></t></t></t></t></t></t></t></t></dataset></dataset>