|
PACS System 0.1.0
PACS DICOM system library
|
Wrapper class for DCMTK command-line tools. More...
#include <dcmtk_tool.h>

Static Public Member Functions | |
| static bool | is_available () |
| Check if DCMTK is available on the system. | |
| static std::optional< std::string > | version () |
| Get DCMTK version string. | |
| static dcmtk_result | echoscu (const std::string &host, uint16_t port, const std::string &called_ae, const std::string &calling_ae="ECHOSCU", std::chrono::seconds timeout=std::chrono::seconds{30}) |
| Run C-ECHO (echoscu) client. | |
| static dcmtk_result | storescu (const std::string &host, uint16_t port, const std::string &called_ae, const std::vector< std::filesystem::path > &files, const std::string &calling_ae="STORESCU", std::chrono::seconds timeout=std::chrono::seconds{60}) |
| Run C-STORE (storescu) client. | |
| static dcmtk_result | findscu (const std::string &host, uint16_t port, const std::string &called_ae, const std::string &query_level, const std::vector< std::pair< std::string, std::string > > &keys, const std::string &calling_ae="FINDSCU", std::chrono::seconds timeout=std::chrono::seconds{30}) |
| Run C-FIND (findscu) client. | |
| static dcmtk_result | movescu (const std::string &host, uint16_t port, const std::string &called_ae, const std::string &dest_ae, const std::string &query_level, const std::vector< std::pair< std::string, std::string > > &keys, const std::string &calling_ae="MOVESCU", std::chrono::seconds timeout=std::chrono::seconds{120}) |
| Run C-MOVE (movescu) client. | |
| static std::chrono::seconds | default_scp_startup_timeout () |
| Default startup timeout for DCMTK SCP servers. | |
| static background_process_guard | storescp (uint16_t port, const std::string &ae_title, const std::filesystem::path &output_dir, std::chrono::seconds startup_timeout=default_scp_startup_timeout()) |
| Start C-STORE SCP (storescp) server. | |
| static background_process_guard | echoscp (uint16_t port, const std::string &ae_title, std::chrono::seconds startup_timeout=default_scp_startup_timeout()) |
| Start C-ECHO SCP (echoscp) server. | |
Static Private Member Functions | |
| static std::string | find_tool_path (const std::string &tool_name) |
| Find the full path to a DCMTK tool. | |
| static dcmtk_result | run_tool (const std::string &tool_name, const std::vector< std::string > &args, std::chrono::seconds timeout) |
| Run a DCMTK tool and capture output. | |
| static process_launcher::pid_type | start_tool_background (const std::string &tool_name, const std::vector< std::string > &args) |
| Start a DCMTK tool in background. | |
Wrapper class for DCMTK command-line tools.
Provides static methods to invoke DCMTK CLI tools with standardized timeout handling, error checking, and output parsing.
Definition at line 60 of file dcmtk_tool.h.
|
inlinestatic |
Default startup timeout for DCMTK SCP servers.
Uses adaptive timeout based on environment:
Definition at line 259 of file dcmtk_tool.h.
References kcenon::pacs::integration_test::is_ci_environment().

|
inlinestatic |
Start C-ECHO SCP (echoscp) server.
| port | Port to listen on |
| ae_title | AE title for server |
| startup_timeout | Maximum time to wait for server to start (default: adaptive based on environment) |
Definition at line 311 of file dcmtk_tool.h.
References kcenon::pacs::integration_test::process_launcher::invalid_pid, start_tool_background(), kcenon::pacs::integration_test::background_process_guard::stop(), and kcenon::pacs::integration_test::process_launcher::wait_for_port().
Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
inlinestatic |
Run C-ECHO (echoscu) client.
| host | Server host address |
| port | Server port |
| called_ae | Called AE title |
| calling_ae | Calling AE title (default: ECHOSCU) |
| timeout | Operation timeout |
Definition at line 111 of file dcmtk_tool.h.
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

|
inlinestaticprivate |
Find the full path to a DCMTK tool.
| tool_name | Name of the tool (e.g., "echoscu") |
Definition at line 344 of file dcmtk_tool.h.
Referenced by run_tool(), and start_tool_background().

|
inlinestatic |
Run C-FIND (findscu) client.
| host | Server host address |
| port | Server port |
| called_ae | Called AE title |
| query_level | Query/Retrieve level (PATIENT, STUDY, SERIES, IMAGE) |
| keys | Query keys as tag-value pairs (e.g., {"PatientID", "TEST001"}) |
| calling_ae | Calling AE title (default: FINDSCU) |
| timeout | Operation timeout |
Definition at line 171 of file dcmtk_tool.h.
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

|
inlinestatic |
Check if DCMTK is available on the system.
Definition at line 70 of file dcmtk_tool.h.
References kcenon::pacs::integration_test::dcmtk_result::exit_code, and run_tool().
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
inlinestatic |
Run C-MOVE (movescu) client.
| host | Server host address |
| port | Server port |
| called_ae | Called AE title |
| dest_ae | Destination AE title |
| query_level | Query/Retrieve level |
| keys | Query keys as tag-value pairs |
| calling_ae | Calling AE title (default: MOVESCU) |
| timeout | Operation timeout |
Definition at line 217 of file dcmtk_tool.h.
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

|
inlinestaticprivate |
Run a DCMTK tool and capture output.
| tool_name | Name of the tool |
| args | Command-line arguments |
| timeout | Maximum execution time |
Definition at line 371 of file dcmtk_tool.h.
References kcenon::pacs::integration_test::dcmtk_result::duration, kcenon::pacs::integration_test::dcmtk_result::exit_code, find_tool_path(), kcenon::pacs::integration_test::process_launcher::run(), kcenon::pacs::integration_test::dcmtk_result::stderr_output, kcenon::pacs::integration_test::dcmtk_result::stdout_output, and kcenon::pacs::integration_test::dcmtk_result::timed_out.
Referenced by is_available(), and version().


|
inlinestaticprivate |
Start a DCMTK tool in background.
| tool_name | Name of the tool |
| args | Command-line arguments |
Definition at line 396 of file dcmtk_tool.h.
References find_tool_path(), and kcenon::pacs::integration_test::process_launcher::start_background().
Referenced by echoscp(), and storescp().


|
inlinestatic |
Start C-STORE SCP (storescp) server.
| port | Port to listen on |
| ae_title | AE title for server |
| output_dir | Directory to store received files |
| startup_timeout | Maximum time to wait for server to start (default: adaptive based on environment) |
Definition at line 274 of file dcmtk_tool.h.
References kcenon::pacs::integration_test::process_launcher::invalid_pid, start_tool_background(), kcenon::pacs::integration_test::background_process_guard::stop(), and kcenon::pacs::integration_test::process_launcher::wait_for_port().
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
inlinestatic |
Run C-STORE (storescu) client.
| host | Server host address |
| port | Server port |
| called_ae | Called AE title |
| files | DICOM files to send |
| calling_ae | Calling AE title (default: STORESCU) |
| timeout | Operation timeout |
Definition at line 138 of file dcmtk_tool.h.
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

|
inlinestatic |
Get DCMTK version string.
Definition at line 79 of file dcmtk_tool.h.
References run_tool(), and kcenon::pacs::integration_test::dcmtk_result::stdout_output.
Referenced by TEST_CASE().

