The PACS Framework is an extensible system that allows the user to easily add additional support without having to change the core server implementation. This extensibility is provided through the use of addins. These addins allow you to respond to specific DICOM messages as well as to provide a service log, AE title management, message notification, etc.
The following tutorials are available:
- Implementing a C-STORE AddIn
- Implementing a DICOM Log AddIn
- Implementing a Storage Commit
- Implementing AddIn Options
For a more detailed implementation of logging, refer to the Leadtools.AddIn.DicomLog example.
The following sections describe how to use the PACS Framework:
The PACS Framework consists of the following components:
- Service Manager - The service manager is a sample application that uses the LEADTOOLS Dicom Service Admin SDK for DICOM service administration.
- AddIn - Manager - The DICOM Service acts as the manager of the addins. When the service starts it loads all the available addins. Once the addins are loaded the server extracts the interfaces that are important for its operation.
- Log Service - The log service is implemented by developer- supplied addins. There is a choice to implement two predefined logging services (Service Log, Audit Log). The Service Log consists of information relevant to the DICOM Service. A default implementation of this is already provided that logs all service-related messages to the event log. The Audit log is used to log DICOM audit messages. Developers will have to provide an implementation for this interface.
- Secure Communications - The PACS Framework provides an interface for developers to provide secure communications. If a server is marked as secure an implementation of this interface must be provided to provide the security parameters.
- Service start: This runs the Windows Service that is implementing the DICOM Server.
- License Check: Checks to see whether the user has provided the correct MedicalServer unlock code. If the correct code has not been provided the service will not run.
- Initialize addins: The service loads all DLLs in the Server working directory. The server checks for all the addin interfaces. If a valid interface is found, the addin is registered with the server service.
- Start Server: If for some reason the server cannot start (duplicate port, IP unavailable, etc.), the service will not run.
- Register Base Services: Some services are required for the
service to function correctly. This process provides default
implementations for the following services:
- IServiceLog: Provides a default log for the service. It writes log entries to the event log.
- IDicomRequest: Provides a default implementation for addins to issue a DICOM request. This implementation should rarely be overridden
- IAETitle: Provides a default implementation for managing DICOM AETitles.
- Start Administrative Interface: This interface allows an application to communicate with the running service. The interface is implemented via named pipes.
At this point the server is up and ready to begin receiving DICOM connections. The server takes the presentation context information from the registered addins and validates it with the Associate request sent from a client. When a valid DICOM message is sent to the server, it checks to see if the specific presentation context pair is registered by an addin. If the context pair is registered, the addin is called to process the DICOM Message. Server processing for that client does not continue until the addin has finished processing or the timeout has been reached for addin processing.
3.Installing and Managing Servers The PACS Framework includes a sample Service Management application that allows you to install and manage DICOM Server Services. The Service Management applications uses the DICOM Service Admin SDK to manage the PACS Framework services. The following figure shows the LEADTOOLS DICOM Service Manager:
The icons listed under the AddIn Options display all the available options for installed addins. Double click on the icon option to display a settings dialog.
![](IconAddDicomService.jpg)
The Add New Server dialog has the following fields:
Settings Tab
- AE Title - Server AE Title
- Implementation Class UID - Server implementation class
- Description - Server description
- Implementation Version Name - Server implementation version name
- IP Address - Server IP Address
- Temporary Directory - Location of the temporary files. DICOM uses temporary files during the course of creating a dataset. If this parameter is not specified DICOM temporary files are kept in the Windows temporary file location.
- Port - Server port to listen on.
- Max Clients - Maximum number of clients that are allowed to connect to server.
- Server Secure - Check to make this a secure server.
- Allow Anonymous - Check to allow anonymous user access. If you will be performing C-MOVE-RQ to clients there, the AE information will have to be specified.
- Enable Service Log - Enable service logging (a default implementation is provided that logs to the Windows event log).
- Multiple ConnectionsAllows same AE title to connect multiple times from the same IP address.
The Add New Server dialog Advanced tab is shown in the following figure:
The Add New Server dialog Advanced tab has the following fields:
Advanced Tab
- Service Display Name - Name to display in the Windows Service Manager application. If no name is specified the display name defaults to: Dicom Server [Ae Title].
- Max Pdu Length - Maximum length of data transfer. If no value is specified the max length defaults to 16384 bytes.
- Timeouts
- Client - Amount of time before a disconnect if data isn't received from a client.
- Reconnect - Amount of time for the server to reconnect to a client and perform some operation.
- AddIn - Amount of time for an addin to process a DICOM request.
- Socket Options
- No Delay - Disables the Nagle algorithm for send coalescing. This socket option is included for backward compatibility with Windows Sockets 1.1.
- Receive Buffer - Specifies the total per-socket buffer space reserved for receives. If no buffer size is specified it defaults to 29696 bytes.
- Send Buffer - Specifies the total per-socket buffer space reserved for sends. If no buffer size is specified it defaults to 29696 bytes.Start Mode - Set the start mode of the windows server.
- Start Mode
- Automatic - Service to be started automatically by the Service Control Manager during system startup.
- Manual - Service to be manually started.
- Disabled - Service can no longer be started.
- Copy dataset image during message notification- Disabling this option will only copy image related tags of the dataset during a message notification. Enabling this option could adversely impact the performance of the server.
After a service is created a new directory will be created in the application folder based on the AE Title. For instance, if your application directory is c:\Dicom Servers\ and you created a service with the AE Title "STORE"; the new directory will be c:\Dicom Servers\STORE\. This directory contains all of the settings for the new server. The following directories are:
- Settings.xml - Holds all the settings for the service.
- AddIns Directory - All addins created for the server need to be placed in this directory. In order to have the addin available for each server it will have to be placed in each server's addin directory.
Edit DICOM Server Service.
Delete DICOM Server Service. This action will delete the service from Windows. However, the service directory will remain.
Start the currently selected service.
Pause the currently selected service. Pause services will not be able to accept incoming connections. However, existing connections will continue to function normally.
Stop the currently selected service.
Start all available DICOM Server services.
Stop all available DICOM Server services.
AE Titles Tab This tab allows you to add/edit AE title information. The server register IAeTitle implementation will be responsible for handling the Service Manger requests. The following actions are available with the AE Titles Tab.
Add AE Title - Add an AE title to the server. Click the Add AE Title button to open the following dialog:
The following fields are on this dialog:
- AE Title - Client AE title. AE Titles should be unique among clients.
- Host Name - Host name of the client. If a host name is specified you cannot specify an IP address.
- IP Address - IP Address of client. If an IP address is specified you cannot specify a host name.
- Port - Client reconnect port.
- Secure Port - Client reconnect secure port. If a secure port is specified it will be used instead of the port.
Edit AE Title.
Delete AE Title.
Client Tab Use this tab to view connect client information. The following information is available for each connected client:
- IP Address - IP address of the connected client.
- AE Title - AE Title of the connected client.
- Connected Time - The time the client connected.
- Last Action - The last action performed by the client.
The following actions are available for the client:
View client association.
Disconnect client.
4. Server Administrative Interface Each server implements an administrative interface that allows an application to perform actions against it. Use the interface to add AE titles and retrieve client information.
The administrative interface is implemented using named pipes.
A named pipe is a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. All instances of a named pipe share the same pipe name, but each instance has its own buffers and handles, and provides a separate conduit for client/server communication. The use of instances enables multiple pipe clients to use the same named pipe simultaneously.
The name of the created pipe is the AE Title of the server created in the DICOM Server Service. The created server service uses duplex pipes for messages and notifications. The PACS Framework provides a ServiceMessage class that encapsulates the details needed for sending messages to and receiving messages from the DICOM server service. The following message/notifications are support by the server services:
ServiceMessage Class
-
Properties
- Message - The message this applies to. See below for a description of messages.
- Service - The name of the service this message is for.
- Success - True to signify the message was a success, false otherwise. This is generally set by the service in response to the message.
- Error - Error message that occurred during the processing of the message.
- Data - The additional data to send with the messages. All items assigned to the Data property needs to be serializable.
Messages
- GetAeTitles - Get a list of all AE titles on the
server.
- Message Info Message = MessageNames.GetAeTitles
- Response Info Message = MessageNames.GetAeTitles Data[0] = List<AeInfo>
- AddAeTitle - Add an AE title to the server.
- Message Info Message = MessageNames.AddAeTitle Data[0] = AeInfo
- Response Info Message = MessageNames.AddAeTitle Data[0] = AeInfo
- UpdateAeTitle - Update an existing AE title.
- Message Info Message = MessageNames.UpdateAeTitle Data[0] = Old AE title Data[1] = AeInfo
- Response Info Messages.MessageNames.UpdateAeTitle Data[0] = Old AE title Data[1] = AeInfo
- RemoveAeTitle - Remove an AE title.
- Message Info Message = MessageNames.RemoveAeTitle Data[0] = AE title
- Response Info Messages.MessageNames.UpdateAeTitle Data[0] = AE title
- DisconnectClient - Disconnect client from server.
- Message Info Message = MessageNames.DisconnectClient Data[0] = ClientInfo
Notifications
- ClientConnect - Received when a client connects to the
server.
- Notification Info Message = MessageNames.ClientConnect Data[0] = ClientInfo
- ClientAssociated - Received after a client has
associated.
- Notification Info Message = MessageNames.ClientAssociated Data[0] = ClientInfo
- ClientDisconnected - Received after a client has
disconnected.
- Notification Info Message = MessageNames.ClientDisconnect Data[0] = ClientInfo
- ClientAction - Received after a client has received a
Dicom Message. Will display the name of the last action performed.
- Notification Info Message = MessageNames.ClientAction Data[0] = Action Data[1] = Ae Title
See Also
Programming With PACS Client Framework
Dicom AddIn
Dicom Scu
Dicom Server
Medical Workstation Diagram |
PACS Framework Client-Server Diagram |
Programming with PACS Client Framework |
Programming with PACS Server Framework |