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
stringDICOM host.
port
intPort.
tlsInitiator
ITlsInitiatorif null then no TLS is enabled, otherwise the handler to initiate TLS security.
callingAe
stringCalling Application Entity Title.
calledAe
stringCalled Application Entity Title.
clientOptions
DicomClientOptionsThe options that further modify the behavior of this DICOM client
serviceOptions
DicomServiceOptionsThe options that modify the behavior of the base DICOM service
loggerFactory
ILoggerFactoryThe log manager that will be used to extract a default logger
advancedDicomClientConnectionFactory
IAdvancedDicomClientConnectionFactoryThe 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
AdditionalPresentationContexts
Gets or sets additional presentation contexts to negotiate with association.
public List<DicomPresentationContext> AdditionalPresentationContexts { get; set; }
Property Value
CalledAe
Called Application Entity Title.
public string CalledAe { get; }
Property Value
CallingAe
Calling Application Entity Title.
public string CallingAe { get; }
Property Value
ClientOptions
Gets or sets options to control behavior of this DICOM client.
public DicomClientOptions ClientOptions { get; set; }
Property Value
FallbackEncoding
Gets or sets the fallback encoding.
public Encoding FallbackEncoding { get; set; }
Property Value
Host
DICOM host.
public string Host { get; }
Property Value
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
Logger
Gets or sets the logger that will be used by this DicomClient
public ILogger Logger { get; set; }
Property Value
OnCStoreRequest
Gets or sets the handler of a client C-STORE request.
public DicomClientCStoreRequestHandler OnCStoreRequest { get; set; }
Property Value
OnNEventReportRequest
Gets or sets the handler of client N-EVENT-REPORT-RQ
public DicomClientNEventReportRequestHandler OnNEventReportRequest { get; set; }
Property Value
Port
Port.
public int Port { get; }
Property Value
RequireSuccessfulUserIdentityNegotiation
Gets or sets whether to require a successful user identity negotiation during association.
public bool RequireSuccessfulUserIdentityNegotiation { get; set; }
Property Value
ServiceOptions
Gets or sets options to control behavior of DicomService base class.
public DicomServiceOptions ServiceOptions { get; set; }
Property Value
TlsInitiator
A handler to initiate TLS security, if null then TLS is not enabled.
public ITlsInitiator TlsInitiator { get; }
Property Value
UserIdentityNegotiation
Gets or sets the user identity to negotiate with association.
public DicomUserIdentityNegotiation UserIdentityNegotiation { get; set; }
Property Value
Methods
AddRequestAsync(DicomRequest)
Enqueues a new DICOM request for execution.
public Task AddRequestAsync(DicomRequest dicomRequest)
Parameters
dicomRequest
DicomRequestThe DICOM request to send
Returns
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
NegotiateAsyncOps(int, int)
Set negotiation asynchronous operations.
public void NegotiateAsyncOps(int invoked = 0, int performed = 0)
Parameters
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
CancellationTokenThe cancellation token that can abort the send process if necessary
cancellationMode
DicomClientCancellationModeThe cancellation mode that determines the cancellation behavior
Returns
Events
AssociationAccepted
Triggers when an association is accepted
public event EventHandler<AssociationAcceptedEventArgs> AssociationAccepted
Event Type
AssociationRejected
Triggers when an association is rejected.
public event EventHandler<AssociationRejectedEventArgs> AssociationRejected
Event Type
AssociationReleased
Representation of the DICOM association released event.
public event EventHandler AssociationReleased
Event Type
AssociationRequestTimedOut
Representation of the DICOM association request timed out event.
public event EventHandler<AssociationRequestTimedOutEventArgs> AssociationRequestTimedOut
Event Type
RequestTimedOut
Triggered when a DICOM request times out.
public event EventHandler<RequestTimedOutEventArgs> RequestTimedOut
Event Type
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