16PACS Server - Complete DICOM Archive
18Usage: pacs_server [OPTIONS]
21 --port <port> Port to listen on (default: 11112)
22 --ae-title <title> Application Entity title (default: MY_PACS)
23 --storage-dir <path> Storage directory for DICOM files (default: ./archive)
24 --db-path <path> SQLite database path (default: ./pacs.db)
25 --log-level <level> Log level: trace, debug, info, warning, error, critical
27 --max-associations <n> Maximum concurrent associations (default: 50)
28 --help, -h Show this help message
30Supported DICOM Services:
31 - C-ECHO (Verification)
33 - C-FIND (Query - Patient/Study Root)
34 - C-MOVE/C-GET (Retrieve)
35 - MWL (Modality Worklist)
36 - MPPS (Modality Performed Procedure Step)
39 # Start with default settings
42 # Start on custom port with custom AE title
43 pacs_server --port 104 --ae-title MAIN_PACS
45 # Specify storage and database locations
46 pacs_server --storage-dir /data/dicom --db-path /data/pacs.db
52 -> std::optional<pacs_server_config> {
56 for (
int i = 1; i < argc; ++i) {
57 const std::string_view arg = argv[i];
59 if (arg ==
"--help" || arg ==
"-h") {
64 if (arg ==
"--port") {
66 std::cerr <<
"Error: --port requires a value\n";
70 config.
server.
port =
static_cast<uint16_t
>(std::stoi(argv[++i]));
71 }
catch (
const std::exception& e) {
72 std::cerr <<
"Error: Invalid port number\n";
78 if (arg ==
"--ae-title") {
80 std::cerr <<
"Error: --ae-title requires a value\n";
85 std::cerr <<
"Error: AE title must be 16 characters or less\n";
91 if (arg ==
"--storage-dir") {
93 std::cerr <<
"Error: --storage-dir requires a value\n";
100 if (arg ==
"--db-path") {
102 std::cerr <<
"Error: --db-path requires a value\n";
109 if (arg ==
"--log-level") {
111 std::cerr <<
"Error: --log-level requires a value\n";
117 if (level !=
"trace" && level !=
"debug" && level !=
"info" &&
118 level !=
"warning" && level !=
"error" && level !=
"critical") {
119 std::cerr <<
"Error: Invalid log level: " << level <<
"\n";
120 std::cerr <<
"Valid levels: trace, debug, info, warning, error, critical\n";
126 if (arg ==
"--max-associations") {
128 std::cerr <<
"Error: --max-associations requires a value\n";
133 }
catch (
const std::exception& e) {
134 std::cerr <<
"Error: Invalid max-associations value\n";
140 std::cerr <<
"Error: Unknown option: " << arg <<
"\n";
141 std::cerr <<
"Use --help for usage information\n";
Configuration management for PACS Server sample.
std::filesystem::path path
Path to SQLite database file.
std::string level
Log level: "trace", "debug", "info", "warning", "error", "critical".
Complete PACS server configuration.
database_config database
Database settings.
logging_config logging
Logging settings.
static void print_help()
Print help message to stdout.
server_network_config server
Server network settings.
storage_config storage
Storage settings.
static auto parse_args(int argc, char *argv[]) -> std::optional< pacs_server_config >
Parse configuration from command line arguments.
uint16_t port
Port to listen on.
std::string ae_title
Application Entity Title for this server (max 16 chars)
size_t max_associations
Maximum concurrent associations (0 = unlimited)
std::filesystem::path directory
Root directory for DICOM file storage.