Class FragmentSequence

Class FragmentSequence

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

Represents fragment sequences of DICOM pixel data. Intended for handling encapsulated (compressed) pixel data.

public abstract class FragmentSequence : IElement, IEnumerable<byte[]>, IEnumerable

Inheritance

object FragmentSequence

Derived

OtherByteFragment , OtherWordFragment

Implements

IElement , IEnumerable<byte[]> , IEnumerable

Inherited Members

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

Constructors

FragmentSequence(Tag)

Represents fragment sequences of DICOM pixel data. Intended for handling encapsulated (compressed) pixel data.

protected FragmentSequence(Tag tag)

Parameters

tag Tag

Properties

Count

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

public int Count { get; }

Property Value

int

Fragments

The collection of fragments. Read-only System.Byte[][].

public byte[][]? Fragments { get; }

Property Value

byte [][]?

OffsetTable

The fragment offset table. Read-only System.UInt32[].

public uint[]? OffsetTable { get; }

Property Value

uint []?

Tag

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

public Tag Tag { get; }

Property Value

Tag

ValueRepresentation

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

public abstract ValueRepresentation ValueRepresentation { get; }

Property Value

ValueRepresentation

Methods

AddFragment(Span<byte>)

Adds the given fragment to the collection of fragments.

public void AddFragment(Span<byte> fragment)

Parameters

fragment Span < byte &gt;

Create(Tag, ValueRepresentation)

Creates a new Aspose.Medical.Dicom.Elements.FragmentSequence with the given tag and vr.

public static FragmentSequence Create(Tag tag, ValueRepresentation vr)

Parameters

tag Tag

Fragment sequence tag.

vr ValueRepresentation

Value representation of a fragment sequence.

Returns

FragmentSequence

The Aspose.Medical.Dicom.Elements.FragmentSequence.

Exceptions

MedicalApiException

Invalid Fragment Sequence VR.

Create(Tag, ValueRepresentation, byte[][])

Creates a new Aspose.Medical.Dicom.Elements.FragmentSequence with the given tag and vr.

public static FragmentSequence Create(Tag tag, ValueRepresentation vr, byte[][] fragments)

Parameters

tag Tag

Fragment sequence tag.

vr ValueRepresentation

Value representation of a fragment sequence.

fragments byte [][]

Byte data (fragments) of a fragment sequence.

Returns

FragmentSequence

The Aspose.Medical.Dicom.Elements.FragmentSequence.

Exceptions

MedicalApiException

Invalid Fragment Sequence VR.

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

No fragments. Fragment Sequence can only return fragment (byte’s array).

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

No fragments. Fragment Sequence can only return fragment (byte’s array).

GetEnumerator()

public IEnumerator<byte[]> GetEnumerator()

Returns

IEnumerator < byte []&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

Fragment Sequence can only return fragment (byte’s array).

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

Fragment Sequence can only return fragment (byte’s array).

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

Fragment Sequence can only return fragment (byte’s array).

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

Fragment Sequence can only return fragment (byte’s array).

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

Fragment Sequence can only return fragment (byte’s array).

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

Fragment Sequence can only return fragment (byte’s array). </t></t></t></t></t></t></t></t></byte[]></t></t></byte></byte[]></byte[]>