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
byteThe presentation context ID.
abstractSyntax
DicomUIDThe 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
byteThe presentation context ID.
abstractSyntax
DicomUIDThe 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
AcceptedTransferSyntax
Gets the accepted transfer syntax, if defined, otherwise
null
.
public DicomTransferSyntax AcceptedTransferSyntax { get; }
Property Value
ID
Gets the presentation context ID.
public byte ID { get; }
Property Value
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
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. Returnsfalse
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
boolIf set to
true
, transfer syntaxes will be accepted in the order specified byacceptedTransferSyntaxes
. If set tofalse
, transfer syntaxes will be accepted in the order proposed by the SCU.
Returns
- bool
Returns
true
if an accepted transfer syntax was found. Returnsfalse
if no accepted transfer syntax was found.
AddTransferSyntax(DicomTransferSyntax)
Add transfer syntax.
public void AddTransferSyntax(DicomTransferSyntax ts)
Parameters
ts
DicomTransferSyntaxTransfer 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
DicomUIDAbstract syntax for which presentation context should be generated.
transferSyntaxes
DicomTransferSyntax[]Supported transfer syntaxes. If
or empty, ImplicitVRLittleEndian is added as default transfer syntax.null
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
DicomStorageCategoryStorage 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
stringFilter 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
HasTransferSyntax(DicomTransferSyntax)
Checks whether presentation context contains ts
.
public bool HasTransferSyntax(DicomTransferSyntax ts)
Parameters
ts
DicomTransferSyntaxTransfer syntax to check.
Returns
- bool
iftrue
ts
is supported,
otherwise.false
RemoveTransferSyntax(DicomTransferSyntax)
Remove transfer syntax.
public void RemoveTransferSyntax(DicomTransferSyntax ts)
Parameters
ts
DicomTransferSyntaxTransfer 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
DicomPresentationContextResultResult 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
DicomPresentationContextResultResult status to return for this proposed presentation context.
acceptedTransferSyntax
DicomTransferSyntaxAccepted transfer syntax for this proposed presentation context.