Table of Contents

Class DicomClient

Namespace
FellowOakDicom.Network.Client
Assembly
fo-dicom.core.dll
public class DicomClient : IDicomClient
Inheritance
DicomClient
Implements
Inherited Members
Extension Methods

Constructors

DicomClient(string, int, ITlsInitiator, string, string, DicomClientOptions, DicomServiceOptions, ILoggerFactory, IAdvancedDicomClientConnectionFactory)

Initializes an instance of DicomClient.

public DicomClient(string host, int port, ITlsInitiator tlsInitiator, string callingAe, string calledAe, DicomClientOptions clientOptions, DicomServiceOptions serviceOptions, ILoggerFactory loggerFactory, IAdvancedDicomClientConnectionFactory advancedDicomClientConnectionFactory)

Parameters

host string

DICOM host.

port int

Port.

tlsInitiator ITlsInitiator

if null then no TLS is enabled, otherwise the handler to initiate TLS security.

callingAe string

Calling Application Entity Title.

calledAe string

Called Application Entity Title.

clientOptions DicomClientOptions

The options that further modify the behavior of this DICOM client

serviceOptions DicomServiceOptions

The options that modify the behavior of the base DICOM service

loggerFactory ILoggerFactory

The log manager that will be used to extract a default logger

advancedDicomClientConnectionFactory IAdvancedDicomClientConnectionFactory

The advanced DICOM client factory that will be used to actually send the requests

Properties

AdditionalExtendedNegotiations

Gets or sets extended negotiation items to negotiate with association.

public List<DicomExtendedNegotiation> AdditionalExtendedNegotiations { get; set; }

Property Value

List<DicomExtendedNegotiation>

AdditionalPresentationContexts

Gets or sets additional presentation contexts to negotiate with association.

public List<DicomPresentationContext> AdditionalPresentationContexts { get; set; }

Property Value

List<DicomPresentationContext>

CalledAe

Called Application Entity Title.

public string CalledAe { get; }

Property Value

string

CallingAe

Calling Application Entity Title.

public string CallingAe { get; }

Property Value

string

ClientOptions

Gets or sets options to control behavior of this DICOM client.

public DicomClientOptions ClientOptions { get; set; }

Property Value

DicomClientOptions

FallbackEncoding

Gets or sets the fallback encoding.

public Encoding FallbackEncoding { get; set; }

Property Value

Encoding

Host

DICOM host.

public string Host { get; }

Property Value

string

IsSendRequired

Gets whether a new send invocation is required. Send needs to be called if there are requests in queue and client is not connected.

public bool IsSendRequired { get; }

Property Value

bool

Logger

Gets or sets the logger that will be used by this DicomClient

public ILogger Logger { get; set; }

Property Value

ILogger

OnCStoreRequest

Gets or sets the handler of a client C-STORE request.

public DicomClientCStoreRequestHandler OnCStoreRequest { get; set; }

Property Value

DicomClientCStoreRequestHandler

OnNEventReportRequest

Gets or sets the handler of client N-EVENT-REPORT-RQ

public DicomClientNEventReportRequestHandler OnNEventReportRequest { get; set; }

Property Value

DicomClientNEventReportRequestHandler

Port

Port.

public int Port { get; }

Property Value

int

RequireSuccessfulUserIdentityNegotiation

Gets or sets whether to require a successful user identity negotiation during association.

public bool RequireSuccessfulUserIdentityNegotiation { get; set; }

Property Value

bool

ServiceOptions

Gets or sets options to control behavior of DicomService base class.

public DicomServiceOptions ServiceOptions { get; set; }

Property Value

DicomServiceOptions

TlsInitiator

A handler to initiate TLS security, if null then TLS is not enabled.

public ITlsInitiator TlsInitiator { get; }

Property Value

ITlsInitiator

UserIdentityNegotiation

Gets or sets the user identity to negotiate with association.

public DicomUserIdentityNegotiation UserIdentityNegotiation { get; set; }

Property Value

DicomUserIdentityNegotiation

Methods

AddRequestAsync(DicomRequest)

Enqueues a new DICOM request for execution.

public Task AddRequestAsync(DicomRequest dicomRequest)

Parameters

dicomRequest DicomRequest

The DICOM request to send

Returns

Task

AddRequestsAsync(IEnumerable<DicomRequest>)

Enqueues new DICOM requests for execution. When you have many requests, this method is recommended over calling AddRequestAsync(DicomRequest) multiple times.

public Task AddRequestsAsync(IEnumerable<DicomRequest> dicomRequests)

Parameters

dicomRequests IEnumerable<DicomRequest>

The DICOM requests to send

Returns

Task

NegotiateAsyncOps(int, int)

Set negotiation asynchronous operations.

public void NegotiateAsyncOps(int invoked = 0, int performed = 0)

Parameters

invoked int

Asynchronous operations invoked.

performed int

Asynchronous operations performed.

NegotiateUserIdentity(DicomUserIdentityNegotiation)

Set negotiation of user identity.

public void NegotiateUserIdentity(DicomUserIdentityNegotiation userIdentity)

Parameters

userIdentity DicomUserIdentityNegotiation

SendAsync(CancellationToken, DicomClientCancellationMode)

Sends existing requests to DICOM service. Note that subsequent calls, when the DICOM client is already sending its requests, will be completely ignored. If you want to cancel the process, be sure to cancel the cancellation token that was passed into the first call.

public Task SendAsync(CancellationToken cancellationToken = default, DicomClientCancellationMode cancellationMode = DicomClientCancellationMode.ImmediatelyReleaseAssociation)

Parameters

cancellationToken CancellationToken

The cancellation token that can abort the send process if necessary

cancellationMode DicomClientCancellationMode

The cancellation mode that determines the cancellation behavior

Returns

Task

Events

AssociationAccepted

Triggers when an association is accepted

public event EventHandler<AssociationAcceptedEventArgs> AssociationAccepted

Event Type

EventHandler<AssociationAcceptedEventArgs>

AssociationRejected

Triggers when an association is rejected.

public event EventHandler<AssociationRejectedEventArgs> AssociationRejected

Event Type

EventHandler<AssociationRejectedEventArgs>

AssociationReleased

Representation of the DICOM association released event.

public event EventHandler AssociationReleased

Event Type

EventHandler

AssociationRequestTimedOut

Representation of the DICOM association request timed out event.

public event EventHandler<AssociationRequestTimedOutEventArgs> AssociationRequestTimedOut

Event Type

EventHandler<AssociationRequestTimedOutEventArgs>

RequestTimedOut

Triggered when a DICOM request times out.

public event EventHandler<RequestTimedOutEventArgs> RequestTimedOut

Event Type

EventHandler<RequestTimedOutEventArgs>

StateChanged

Whenever the DICOM client changes state, an event will be emitted containing the old state and the new state. The current DICOM client implementation is no longer state based, and has been rewritten as a wrapper around the new IAdvancedDicomClientConnection This event handler is still supported for backwards compatibility reasons, but may be removed in the future.

public event EventHandler<StateChangedEventArgs> StateChanged

Event Type

EventHandler<StateChangedEventArgs>