|
PACS System 0.1.0
PACS DICOM system library
|
Comprehensive DICOM test data generator. More...
#include <test_data_generator.h>

Static Public Member Functions | |
| static core::dicom_dataset | ct (const std::string &study_uid="") |
| Generate a CT Image dataset. | |
| static core::dicom_dataset | mr (const std::string &study_uid="") |
| Generate an MR Image dataset. | |
| static core::dicom_dataset | xa (const std::string &study_uid="") |
| Generate a single-frame XA Image dataset. | |
| static core::dicom_dataset | us (const std::string &study_uid="") |
| Generate a single-frame US Image dataset. | |
| static core::dicom_dataset | xa_cine (uint32_t frames=30, const std::string &study_uid="") |
| Generate a multi-frame XA cine dataset. | |
| static core::dicom_dataset | us_cine (uint32_t frames=60, const std::string &study_uid="") |
| Generate a multi-frame US cine dataset. | |
| static core::dicom_dataset | enhanced_ct (uint32_t frames=100, const std::string &study_uid="") |
| Generate an Enhanced CT multi-frame dataset. | |
| static core::dicom_dataset | enhanced_mr (uint32_t frames=50, const std::string &study_uid="") |
| Generate an Enhanced MR multi-frame dataset. | |
| static multi_modal_study | patient_journey (const std::string &patient_id, const std::vector< std::string > &modalities={"CT", "MR", "XA"}) |
| Generate a complete multi-modal patient study. | |
| static core::dicom_dataset | worklist (const std::string &patient_id="", const std::string &modality="CT") |
| Generate a worklist item dataset. | |
| static core::dicom_dataset | large (size_t target_size_mb) |
| Generate a large dataset for stress testing. | |
| static core::dicom_dataset | unicode () |
| Generate a dataset with Unicode patient names. | |
| static core::dicom_dataset | with_private_tags (const std::string &creator_id="TEST PRIVATE CREATOR") |
| Generate a dataset with private tags. | |
| static core::dicom_dataset | invalid (invalid_dataset_type type) |
| Generate an intentionally invalid dataset. | |
| static std::string | generate_uid (const std::string &root="1.2.826.0.1.3680043.9.9999") |
| Generate a unique UID for testing. | |
| static std::string | current_date () |
| Get current date in DICOM DA format (YYYYMMDD) | |
| static std::string | current_time () |
| Get current time in DICOM TM format (HHMMSS) | |
Static Private Member Functions | |
| static void | add_patient_module (core::dicom_dataset &ds, const std::string &patient_name, const std::string &patient_id, const std::string &birth_date="19800101", const std::string &sex="M") |
| Add common patient module attributes. | |
| static void | add_study_module (core::dicom_dataset &ds, const std::string &study_uid, const std::string &accession_number, const std::string &study_id, const std::string &description) |
| Add common study module attributes. | |
| static void | add_series_module (core::dicom_dataset &ds, const std::string &series_uid, const std::string &modality, const std::string &series_number, const std::string &description) |
| Add common series module attributes. | |
| static void | add_image_pixel_module (core::dicom_dataset &ds, uint16_t rows, uint16_t columns, uint16_t bits_allocated, uint16_t bits_stored, uint16_t samples_per_pixel=1, const std::string &photometric="MONOCHROME2") |
| Add common image pixel module attributes. | |
| static void | add_pixel_data (core::dicom_dataset &ds, uint16_t rows, uint16_t columns, uint16_t bits_allocated, uint16_t samples_per_pixel=1, uint16_t fill_value=512) |
| Generate pixel data for single-frame image. | |
| static void | add_multiframe_pixel_data (core::dicom_dataset &ds, uint16_t rows, uint16_t columns, uint16_t bits_allocated, uint32_t num_frames, uint16_t samples_per_pixel=1) |
| Generate pixel data for multi-frame image. | |
Comprehensive DICOM test data generator.
Provides static methods to generate various DICOM datasets for testing. All generated datasets contain valid DICOM structures suitable for storage, query, and retrieval operations.
Example usage:
Definition at line 94 of file test_data_generator.h.
|
staticprivate |
Add common image pixel module attributes.
Definition at line 139 of file test_data_generator.cpp.
References kcenon::pacs::core::tags::bits_allocated, kcenon::pacs::core::tags::bits_stored, kcenon::pacs::core::tags::columns, kcenon::pacs::encoding::CS, kcenon::pacs::core::tags::high_bit, kcenon::pacs::core::tags::photometric_interpretation, kcenon::pacs::core::tags::pixel_representation, kcenon::pacs::core::tags::rows, kcenon::pacs::core::tags::samples_per_pixel, kcenon::pacs::core::dicom_dataset::set_numeric(), kcenon::pacs::core::dicom_dataset::set_string(), and kcenon::pacs::encoding::US.
Referenced by ct(), enhanced_ct(), enhanced_mr(), invalid(), large(), mr(), patient_journey(), unicode(), us(), us_cine(), with_private_tags(), xa(), and xa_cine().


|
staticprivate |
Generate pixel data for multi-frame image.
Definition at line 184 of file test_data_generator.cpp.
References kcenon::pacs::core::dicom_dataset::insert(), kcenon::pacs::encoding::IS, number_of_frames, kcenon::pacs::encoding::OB, kcenon::pacs::encoding::OW, kcenon::pacs::core::tags::pixel_data, kcenon::pacs::core::dicom_dataset::set_string(), and kcenon::pacs::core::dicom_element::set_value().
Referenced by enhanced_ct(), enhanced_mr(), us_cine(), and xa_cine().


|
staticprivate |
Add common patient module attributes.
Definition at line 96 of file test_data_generator.cpp.
References kcenon::pacs::encoding::CS, kcenon::pacs::encoding::DA, kcenon::pacs::encoding::LO, kcenon::pacs::core::tags::patient_birth_date, kcenon::pacs::core::tags::patient_id, kcenon::pacs::core::tags::patient_name, kcenon::pacs::core::tags::patient_sex, kcenon::pacs::encoding::PN, and kcenon::pacs::core::dicom_dataset::set_string().
Referenced by ct(), enhanced_ct(), enhanced_mr(), invalid(), large(), mr(), patient_journey(), unicode(), us(), us_cine(), with_private_tags(), worklist(), xa(), and xa_cine().


|
staticprivate |
Generate pixel data for single-frame image.
Definition at line 159 of file test_data_generator.cpp.
References kcenon::pacs::core::dicom_dataset::insert(), kcenon::pacs::encoding::OB, kcenon::pacs::encoding::OW, kcenon::pacs::core::tags::pixel_data, and kcenon::pacs::core::dicom_element::set_value().
Referenced by ct(), invalid(), large(), mr(), patient_journey(), unicode(), us(), with_private_tags(), and xa().


|
staticprivate |
Add common series module attributes.
Definition at line 125 of file test_data_generator.cpp.
References kcenon::pacs::encoding::CS, generate_uid(), kcenon::pacs::encoding::IS, kcenon::pacs::encoding::LO, kcenon::pacs::core::tags::modality, kcenon::pacs::core::tags::series_description, kcenon::pacs::core::tags::series_instance_uid, kcenon::pacs::core::tags::series_number, kcenon::pacs::core::dicom_dataset::set_string(), and kcenon::pacs::encoding::UI.
Referenced by ct(), enhanced_ct(), enhanced_mr(), invalid(), large(), mr(), patient_journey(), unicode(), us(), us_cine(), with_private_tags(), xa(), and xa_cine().


|
staticprivate |
Add common study module attributes.
Definition at line 109 of file test_data_generator.cpp.
References kcenon::pacs::core::tags::accession_number, current_date(), current_time(), kcenon::pacs::encoding::DA, generate_uid(), kcenon::pacs::encoding::LO, kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::encoding::SH, kcenon::pacs::core::tags::study_date, kcenon::pacs::core::tags::study_description, kcenon::pacs::core::tags::study_id, kcenon::pacs::core::tags::study_instance_uid, kcenon::pacs::core::tags::study_time, kcenon::pacs::encoding::TM, and kcenon::pacs::encoding::UI.
Referenced by ct(), enhanced_ct(), enhanced_mr(), invalid(), large(), mr(), patient_journey(), unicode(), us(), us_cine(), with_private_tags(), xa(), and xa_cine().


|
staticnodiscard |
Generate a CT Image dataset.
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 229 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), generate_uid(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
staticnodiscard |
Get current date in DICOM DA format (YYYYMMDD)
Definition at line 62 of file test_data_generator.cpp.
Referenced by add_study_module(), kcenon::pacs::integration_test::TEST_CASE(), and worklist().

|
staticnodiscard |
Get current time in DICOM TM format (HHMMSS)
Definition at line 77 of file test_data_generator.cpp.
Referenced by add_study_module(), and kcenon::pacs::integration_test::TEST_CASE().

|
staticnodiscard |
Generate an Enhanced CT multi-frame dataset.
| frames | Number of frames (default: 100) |
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 378 of file test_data_generator.cpp.
References add_image_pixel_module(), add_multiframe_pixel_data(), add_patient_module(), add_series_module(), add_study_module(), kcenon::pacs::encoding::CS, generate_uid(), kcenon::pacs::core::tags::image_type, kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate an Enhanced MR multi-frame dataset.
| frames | Number of frames (default: 50) |
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 402 of file test_data_generator.cpp.
References add_image_pixel_module(), add_multiframe_pixel_data(), add_patient_module(), add_series_module(), add_study_module(), kcenon::pacs::encoding::CS, generate_uid(), kcenon::pacs::core::tags::image_type, kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate a unique UID for testing.
| root | Root UID prefix (default: test UID root) |
Definition at line 53 of file test_data_generator.cpp.
Referenced by add_series_module(), add_study_module(), ct(), enhanced_ct(), enhanced_mr(), invalid(), large(), mr(), patient_journey(), kcenon::pacs::integration_test::TEST_CASE(), unicode(), us(), us_cine(), with_private_tags(), worklist(), xa(), and xa_cine().

|
staticnodiscard |
Generate an intentionally invalid dataset.
Creates datasets with specific types of errors for testing error handling and validation logic.
| type | Type of invalidity to introduce |
Definition at line 596 of file test_data_generator.cpp.
References kcenon::pacs::core::tags::accession_number, add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), kcenon::pacs::integration_test::corrupted_pixel_data, generate_uid(), kcenon::pacs::core::dicom_dataset::insert(), kcenon::pacs::integration_test::invalid_vr, kcenon::pacs::integration_test::missing_patient_id, kcenon::pacs::integration_test::missing_sop_class_uid, kcenon::pacs::integration_test::missing_sop_instance_uid, kcenon::pacs::integration_test::missing_study_instance_uid, kcenon::pacs::encoding::OB, kcenon::pacs::integration_test::oversized_value, kcenon::pacs::core::tags::patient_id, kcenon::pacs::core::tags::pixel_data, kcenon::pacs::core::dicom_dataset::remove(), kcenon::pacs::core::dicom_dataset::set_numeric(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::dicom_element::set_value(), kcenon::pacs::encoding::SH, kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, kcenon::pacs::core::tags::study_instance_uid, kcenon::pacs::encoding::UI, and kcenon::pacs::encoding::US.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate a large dataset for stress testing.
Creates a dataset with pixel data approaching the target size. Useful for testing memory handling and transfer performance.
| target_size_mb | Target size in megabytes |
Definition at line 515 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), generate_uid(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate an MR Image dataset.
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 248 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), generate_uid(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
staticnodiscard |
Generate a complete multi-modal patient study.
Creates a realistic patient study with multiple modalities, all sharing the same Study Instance UID and patient information.
| patient_id | Patient identifier |
| modalities | List of modality codes (e.g., {"CT", "MR", "XA"}) |
Definition at line 430 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), generate_uid(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, kcenon::pacs::encoding::UI, kcenon::pacs::services::sop_classes::us_image_storage_uid, and kcenon::pacs::services::sop_classes::xa_image_storage_uid.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate a dataset with Unicode patient names.
Tests character set handling with international characters including CJK, Arabic, Hebrew, and special symbols.
Definition at line 542 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), kcenon::pacs::encoding::CS, generate_uid(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, kcenon::pacs::core::tags::specific_character_set, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate a single-frame US Image dataset.
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 300 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), generate_uid(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, kcenon::pacs::encoding::UI, and kcenon::pacs::services::sop_classes::us_image_storage_uid.
Referenced by kcenon::pacs::integration_test::TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
staticnodiscard |
Generate a multi-frame US cine dataset.
| frames | Number of frames (default: 60) |
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 354 of file test_data_generator.cpp.
References add_image_pixel_module(), add_multiframe_pixel_data(), add_patient_module(), add_series_module(), add_study_module(), kcenon::pacs::encoding::DS, generate_uid(), kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, kcenon::pacs::encoding::UI, and kcenon::pacs::services::sop_classes::us_multiframe_image_storage_uid.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate a dataset with private tags.
Creates a dataset containing custom private tags for testing private tag preservation during storage and retrieval.
| creator_id | Private creator identifier |
Definition at line 565 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), kcenon::pacs::encoding::DS, generate_uid(), kcenon::pacs::encoding::IS, kcenon::pacs::encoding::LO, kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE().


|
staticnodiscard |
Generate a worklist item dataset.
| patient_id | Patient identifier (auto-generated if empty) |
| modality | Scheduled modality (default: "CT") |
Definition at line 483 of file test_data_generator.cpp.
References kcenon::pacs::core::tags::accession_number, add_patient_module(), kcenon::pacs::encoding::AE, kcenon::pacs::encoding::CS, current_date(), kcenon::pacs::encoding::DA, generate_uid(), kcenon::pacs::encoding::LO, kcenon::pacs::core::tags::modality, kcenon::pacs::core::tags::requested_procedure_id, kcenon::pacs::core::tags::scheduled_procedure_step_description, kcenon::pacs::core::tags::scheduled_procedure_step_start_date, kcenon::pacs::core::tags::scheduled_procedure_step_start_time, kcenon::pacs::core::tags::scheduled_station_ae_title, kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::encoding::SH, kcenon::pacs::core::tags::study_instance_uid, kcenon::pacs::encoding::TM, and kcenon::pacs::encoding::UI.
Referenced by kcenon::pacs::integration_test::TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
staticnodiscard |
Generate a single-frame XA Image dataset.
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 267 of file test_data_generator.cpp.
References add_image_pixel_module(), add_patient_module(), add_pixel_data(), add_series_module(), add_study_module(), kcenon::pacs::encoding::DS, generate_uid(), kcenon::pacs::encoding::IS, kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, kcenon::pacs::encoding::UI, and kcenon::pacs::services::sop_classes::xa_image_storage_uid.
Referenced by kcenon::pacs::integration_test::TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
staticnodiscard |
Generate a multi-frame XA cine dataset.
| frames | Number of frames (default: 30) |
| study_uid | Study Instance UID (auto-generated if empty) |
Definition at line 323 of file test_data_generator.cpp.
References add_image_pixel_module(), add_multiframe_pixel_data(), add_patient_module(), add_series_module(), add_study_module(), kcenon::pacs::encoding::DS, generate_uid(), kcenon::pacs::encoding::IS, kcenon::pacs::core::dicom_dataset::set_string(), kcenon::pacs::core::tags::sop_class_uid, kcenon::pacs::core::tags::sop_instance_uid, kcenon::pacs::encoding::UI, and kcenon::pacs::services::sop_classes::xa_image_storage_uid.
Referenced by kcenon::pacs::integration_test::TEST_CASE(), and TEST_CASE().

