Table of Contents

Class DicomPresentationContext

Namespace
FellowOakDicom.Network
Assembly
fo-dicom.core.dll

Representation of a presentation context.

public class DicomPresentationContext
Inheritance
DicomPresentationContext
Inherited Members
Extension Methods

Constructors

DicomPresentationContext(byte, DicomUID)

Initializes a new instance of the DicomPresentationContext class.

public DicomPresentationContext(byte pcid, DicomUID abstractSyntax)

Parameters

pcid byte

The presentation context ID.

abstractSyntax DicomUID

The abstract syntax associated with the presentation context.

DicomPresentationContext(byte, DicomUID, bool?, bool?)

Initializes a new instance of the DicomPresentationContext class.

public DicomPresentationContext(byte pcid, DicomUID abstractSyntax, bool? userRole, bool? providerRole)

Parameters

pcid byte

The presentation context ID.

abstractSyntax DicomUID

The abstract syntax associated with the presentation context.

userRole bool?

Indicates whether SCU role is supported.

providerRole bool?

Indicates whether SCP role is supported.

Properties

AbstractSyntax

Gets the abstact syntax associated with the presentation context.

public DicomUID AbstractSyntax { get; }

Property Value

DicomUID

AcceptedTransferSyntax

Gets the accepted transfer syntax, if defined, otherwise

null
.
public DicomTransferSyntax AcceptedTransferSyntax { get; }

Property Value

DicomTransferSyntax

ID

Gets the presentation context ID.

public byte ID { get; }

Property Value

byte

ProviderRole

Gets an indicator whether presentation context supports an SCU role. If undefined, default value is assumed.

public bool? ProviderRole { get; }

Property Value

bool?

Result

Gets the association negotiation result.

public DicomPresentationContextResult Result { get; }

Property Value

DicomPresentationContextResult

UserRole

Gets an indicator whether presentation context supports an SCU role. If undefined, default value is assumed.

public bool? UserRole { get; }

Property Value

bool?

Methods

AcceptTransferSyntaxes(params DicomTransferSyntax[])

Compares a list of transfer syntaxes accepted by the SCP against the list of transfer syntaxes proposed by the SCU. Sets the presentation context Result to DicomPresentationContextResult.Accept if an accepted transfer syntax is found. If no accepted transfer syntax is found, the presentation context Result is set to DicomPresentationContextResult.RejectTransferSyntaxesNotSupported.

public bool AcceptTransferSyntaxes(params DicomTransferSyntax[] acceptedTransferSyntaxes)

Parameters

acceptedTransferSyntaxes DicomTransferSyntax[]

Transfer syntaxes that the SCP accepts for the proposed abstract syntax.

Returns

bool

Returns true if an accepted transfer syntax was found. Returns false if no accepted transfer syntax was found.

AcceptTransferSyntaxes(DicomTransferSyntax[], bool)

Compares a list of transfer syntaxes accepted by the SCP against the list of transfer syntaxes proposed by the SCU. Sets the presentation context Result to DicomPresentationContextResult.Accept if an accepted transfer syntax is found. If no accepted transfer syntax is found, the presentation context Result is set to DicomPresentationContextResult.RejectTransferSyntaxesNotSupported.

public bool AcceptTransferSyntaxes(DicomTransferSyntax[] acceptedTransferSyntaxes, bool scpPriority)

Parameters

acceptedTransferSyntaxes DicomTransferSyntax[]

Transfer syntaxes that the SCP accepts for the proposed abstract syntax.

scpPriority bool

If set to true, transfer syntaxes will be accepted in the order specified by acceptedTransferSyntaxes. If set to false, transfer syntaxes will be accepted in the order proposed by the SCU.

Returns

bool

Returns true if an accepted transfer syntax was found. Returns false if no accepted transfer syntax was found.

AddTransferSyntax(DicomTransferSyntax)

Add transfer syntax.

public void AddTransferSyntax(DicomTransferSyntax ts)

Parameters

ts DicomTransferSyntax

Transfer syntax to add to presentation context.

ClearTransferSyntaxes()

Clear all supported transfer syntaxes.

public void ClearTransferSyntaxes()

GetResultDescription()

Get user-friendly description of negotiation result.

public string GetResultDescription()

Returns

string

User-friendly description of negotiation result.

GetScpRolePresentationContext(DicomUID, params DicomTransferSyntax[])

Get presentation context valid for C-GET requests for the specified abstractSyntax.

public static DicomPresentationContext GetScpRolePresentationContext(DicomUID abstractSyntax, params DicomTransferSyntax[] transferSyntaxes)

Parameters

abstractSyntax DicomUID

Abstract syntax for which presentation context should be generated.

transferSyntaxes DicomTransferSyntax[]

Supported transfer syntaxes. If

null
or empty, ImplicitVRLittleEndian is added as default transfer syntax.

Returns

DicomPresentationContext

Presentation context valid for C-GET requests for the specified abstractSyntax.

GetScpRolePresentationContextsFromStorageUids(DicomStorageCategory, params DicomTransferSyntax[])

Get storage category collection of presentation contexts valid for C-GET requests.

public static IEnumerable<DicomPresentationContext> GetScpRolePresentationContextsFromStorageUids(DicomStorageCategory storageCategory, params DicomTransferSyntax[] transferSyntaxes)

Parameters

storageCategory DicomStorageCategory

Storage category for which the sub-set of presentation context should be selected.

transferSyntaxes DicomTransferSyntax[]

Supported transfer syntaxes.

Returns

IEnumerable<DicomPresentationContext>

Collection of presentation contexts valid for C-GET requests.

GetScpRolePresentationContextsFromStorageUids(string, params DicomTransferSyntax[])

Get, potentially filtered, collection of presentation contexts valid for C-GET requests.

public static IEnumerable<DicomPresentationContext> GetScpRolePresentationContextsFromStorageUids(string filter, params DicomTransferSyntax[] transferSyntaxes)

Parameters

filter string

Filter to apply when selecting a sub-set of active storage UID:s, or null to select all.

transferSyntaxes DicomTransferSyntax[]

Supported transfer syntaxes.

Returns

IEnumerable<DicomPresentationContext>

Collection of presentation contexts valid for C-GET requests.

GetTransferSyntaxes()

Get read-only list of supported transfer syntaxes.

public IList<DicomTransferSyntax> GetTransferSyntaxes()

Returns

IList<DicomTransferSyntax>

HasTransferSyntax(DicomTransferSyntax)

Checks whether presentation context contains ts.

public bool HasTransferSyntax(DicomTransferSyntax ts)

Parameters

ts DicomTransferSyntax

Transfer syntax to check.

Returns

bool
true
if ts is supported,
false
otherwise.

RemoveTransferSyntax(DicomTransferSyntax)

Remove transfer syntax.

public void RemoveTransferSyntax(DicomTransferSyntax ts)

Parameters

ts DicomTransferSyntax

Transfer syntax to remove from presentation context.

SetResult(DicomPresentationContextResult)

Sets the Result of this presentation context.

The preferred method of accepting presentation contexts is to call one of the AcceptTransferSyntaxes methods.

public void SetResult(DicomPresentationContextResult result)

Parameters

result DicomPresentationContextResult

Result status to return for this proposed presentation context.

SetResult(DicomPresentationContextResult, DicomTransferSyntax)

Sets the Result and AcceptedTransferSyntax of this presentation context.

The preferred method of accepting presentation contexts is to call one of the AcceptTransferSyntaxes methods.

public void SetResult(DicomPresentationContextResult result, DicomTransferSyntax acceptedTransferSyntax)

Parameters

result DicomPresentationContextResult

Result status to return for this proposed presentation context.

acceptedTransferSyntax DicomTransferSyntax

Accepted transfer syntax for this proposed presentation context.