PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::integration_test::test_data_generator Class Reference

Comprehensive DICOM test data generator. More...

#include <test_data_generator.h>

Collaboration diagram for kcenon::pacs::integration_test::test_data_generator:
Collaboration graph

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.
 

Detailed Description

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:

// Generate a simple CT dataset
// Generate XA cine with 30 frames
// Generate a multi-modal study
auto study = test_data_generator::patient_journey("PATIENT001", {"CT", "MR", "XA"});
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 ct(const std::string &study_uid="")
Generate a CT Image dataset.
static core::dicom_dataset xa(const std::string &study_uid="")
Generate a single-frame XA Image dataset.
static core::dicom_dataset xa_cine(uint32_t frames=30, const std::string &study_uid="")
Generate a multi-frame XA cine dataset.

Definition at line 94 of file test_data_generator.h.

Member Function Documentation

◆ add_image_pixel_module()

void kcenon::pacs::integration_test::test_data_generator::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" )
staticprivate

Add common image pixel module attributes.

Definition at line 139 of file test_data_generator.cpp.

146 {
147
148 ds.set_numeric<uint16_t>(core::tags::rows, encoding::vr_type::US, rows);
149 ds.set_numeric<uint16_t>(core::tags::columns, encoding::vr_type::US, columns);
152 ds.set_numeric<uint16_t>(core::tags::high_bit, encoding::vr_type::US,
153 static_cast<uint16_t>(bits_stored - 1));
154 ds.set_numeric<uint16_t>(core::tags::pixel_representation, encoding::vr_type::US, 0);
157}
constexpr dicom_tag high_bit
High Bit.
constexpr dicom_tag bits_allocated
Bits Allocated.
constexpr dicom_tag rows
Rows.
constexpr dicom_tag columns
Columns.
constexpr dicom_tag bits_stored
Bits Stored.
constexpr dicom_tag pixel_representation
Pixel Representation.
constexpr dicom_tag samples_per_pixel
Samples per Pixel.
constexpr dicom_tag photometric_interpretation
Photometric Interpretation.
@ US
Unsigned Short (2 bytes)
@ CS
Code String (16 chars max, uppercase + digits + space + underscore)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_multiframe_pixel_data()

void kcenon::pacs::integration_test::test_data_generator::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 )
staticprivate

Generate pixel data for multi-frame image.

Definition at line 184 of file test_data_generator.cpp.

190 {
191
192 // Add Number of Frames attribute
193 constexpr core::dicom_tag number_of_frames{0x0028, 0x0008};
194 ds.set_string(number_of_frames, encoding::vr_type::IS, std::to_string(num_frames));
195
196 size_t frame_size = static_cast<size_t>(rows) * columns * samples_per_pixel;
197 size_t total_pixels = frame_size * num_frames;
198
199 // Use random generator for more realistic data
200 std::mt19937 gen(42); // Fixed seed for reproducibility
201
202 if (bits_allocated == 8) {
203 std::uniform_int_distribution<uint16_t> dist(0, 255);
204 std::vector<uint8_t> pixel_data(total_pixels);
205 for (size_t i = 0; i < total_pixels; ++i) {
206 pixel_data[i] = static_cast<uint8_t>(dist(gen));
207 }
208 core::dicom_element pixel_elem(core::tags::pixel_data, encoding::vr_type::OB);
209 pixel_elem.set_value(std::span<const uint8_t>(pixel_data.data(), pixel_data.size()));
210 ds.insert(std::move(pixel_elem));
211 } else {
212 std::uniform_int_distribution<uint16_t> dist(0, 4095);
213 std::vector<uint16_t> pixel_data(total_pixels);
214 for (size_t i = 0; i < total_pixels; ++i) {
215 pixel_data[i] = dist(gen);
216 }
217 core::dicom_element pixel_elem(core::tags::pixel_data, encoding::vr_type::OW);
218 pixel_elem.set_value(std::span<const uint8_t>(
219 reinterpret_cast<const uint8_t*>(pixel_data.data()),
220 pixel_data.size() * sizeof(uint16_t)));
221 ds.insert(std::move(pixel_elem));
222 }
223}
constexpr dicom_tag pixel_data
Pixel Data.
@ OB
Other Byte (variable length)
@ IS
Integer String (12 chars max)
@ OW
Other Word (variable length)
constexpr dicom_tag number_of_frames

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_patient_module()

void kcenon::pacs::integration_test::test_data_generator::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" )
staticprivate

Add common patient module attributes.

Definition at line 96 of file test_data_generator.cpp.

101 {
102
103 ds.set_string(core::tags::patient_name, encoding::vr_type::PN, patient_name);
104 ds.set_string(core::tags::patient_id, encoding::vr_type::LO, patient_id);
105 ds.set_string(core::tags::patient_birth_date, encoding::vr_type::DA, birth_date);
107}
constexpr dicom_tag patient_id
Patient ID.
constexpr dicom_tag patient_birth_date
Patient's Birth Date.
constexpr dicom_tag patient_sex
Patient's Sex.
constexpr dicom_tag patient_name
Patient's Name.
@ DA
Date (8 chars, format: YYYYMMDD)
@ LO
Long String (64 chars max)
@ PN
Person Name (64 chars max per component group)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_pixel_data()

void kcenon::pacs::integration_test::test_data_generator::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 )
staticprivate

Generate pixel data for single-frame image.

Definition at line 159 of file test_data_generator.cpp.

165 {
166
167 size_t pixel_count = static_cast<size_t>(rows) * columns * samples_per_pixel;
168
169 if (bits_allocated == 8) {
170 std::vector<uint8_t> pixel_data(pixel_count, static_cast<uint8_t>(fill_value & 0xFF));
171 core::dicom_element pixel_elem(core::tags::pixel_data, encoding::vr_type::OB);
172 pixel_elem.set_value(std::span<const uint8_t>(pixel_data.data(), pixel_data.size()));
173 ds.insert(std::move(pixel_elem));
174 } else {
175 std::vector<uint16_t> pixel_data(pixel_count, fill_value);
176 core::dicom_element pixel_elem(core::tags::pixel_data, encoding::vr_type::OW);
177 pixel_elem.set_value(std::span<const uint8_t>(
178 reinterpret_cast<const uint8_t*>(pixel_data.data()),
179 pixel_data.size() * sizeof(uint16_t)));
180 ds.insert(std::move(pixel_elem));
181 }
182}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_series_module()

void kcenon::pacs::integration_test::test_data_generator::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 )
staticprivate

Add common series module attributes.

Definition at line 125 of file test_data_generator.cpp.

130 {
131
133 series_uid.empty() ? generate_uid() : series_uid);
134 ds.set_string(core::tags::modality, encoding::vr_type::CS, modality);
135 ds.set_string(core::tags::series_number, encoding::vr_type::IS, series_number);
136 ds.set_string(core::tags::series_description, encoding::vr_type::LO, description);
137}
static std::string generate_uid(const std::string &root="1.2.826.0.1.3680043.9.9999")
Generate a unique UID for testing.
constexpr dicom_tag modality
Modality.
constexpr dicom_tag series_number
Series Number.
constexpr dicom_tag series_description
Series Description.
constexpr dicom_tag series_instance_uid
Series Instance UID.
@ UI
Unique Identifier (64 chars max)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_study_module()

void kcenon::pacs::integration_test::test_data_generator::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 )
staticprivate

Add common study module attributes.

Definition at line 109 of file test_data_generator.cpp.

114 {
115
117 study_uid.empty() ? generate_uid() : study_uid);
120 ds.set_string(core::tags::accession_number, encoding::vr_type::SH, accession_number);
121 ds.set_string(core::tags::study_id, encoding::vr_type::SH, study_id);
122 ds.set_string(core::tags::study_description, encoding::vr_type::LO, description);
123}
static std::string current_time()
Get current time in DICOM TM format (HHMMSS)
static std::string current_date()
Get current date in DICOM DA format (YYYYMMDD)
constexpr dicom_tag study_description
Study Description.
constexpr dicom_tag accession_number
Accession Number.
constexpr dicom_tag study_time
Study Time.
constexpr dicom_tag study_instance_uid
Study Instance UID.
constexpr dicom_tag study_id
Study ID.
constexpr dicom_tag study_date
Study Date.
@ TM
Time (14 chars max, format: HHMMSS.FFFFFF)
@ SH
Short String (16 chars max)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ct()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::ct ( const std::string & study_uid = "")
staticnodiscard

Generate a CT Image dataset.

Parameters
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for CT Image Storage

Definition at line 229 of file test_data_generator.cpp.

229 {
230 core::dicom_dataset ds;
231
232 add_patient_module(ds, "TEST^CT^PATIENT", "TESTCT001", "19800101", "M");
233 add_study_module(ds, study_uid, "ACCCT001", "STUDYCT001", "CT Integration Test");
234 add_series_module(ds, "", "CT", "1", "CT Test Series");
235
236 // SOP Common
238 "1.2.840.10008.5.1.4.1.1.2"); // CT Image Storage
240
241 // Image Pixel Module
242 add_image_pixel_module(ds, 64, 64, 16, 12);
243 add_pixel_data(ds, 64, 64, 16, 1, 512);
244
245 return ds;
246}
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_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_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_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_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.
constexpr dicom_tag sop_instance_uid
SOP Instance UID.
constexpr dicom_tag sop_class_uid
SOP Class UID.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ current_date()

std::string kcenon::pacs::integration_test::test_data_generator::current_date ( )
staticnodiscard

Get current date in DICOM DA format (YYYYMMDD)

Returns
Date string

Definition at line 62 of file test_data_generator.cpp.

62 {
63 auto now = std::chrono::system_clock::now();
64 auto time_t_now = std::chrono::system_clock::to_time_t(now);
65 std::tm tm_now{};
66#ifdef _WIN32
67 localtime_s(&tm_now, &time_t_now);
68#else
69 localtime_r(&time_t_now, &tm_now);
70#endif
71
72 std::ostringstream oss;
73 oss << std::put_time(&tm_now, "%Y%m%d");
74 return oss.str();
75}

Referenced by add_study_module(), kcenon::pacs::integration_test::TEST_CASE(), and worklist().

Here is the caller graph for this function:

◆ current_time()

std::string kcenon::pacs::integration_test::test_data_generator::current_time ( )
staticnodiscard

Get current time in DICOM TM format (HHMMSS)

Returns
Time string

Definition at line 77 of file test_data_generator.cpp.

77 {
78 auto now = std::chrono::system_clock::now();
79 auto time_t_now = std::chrono::system_clock::to_time_t(now);
80 std::tm tm_now{};
81#ifdef _WIN32
82 localtime_s(&tm_now, &time_t_now);
83#else
84 localtime_r(&time_t_now, &tm_now);
85#endif
86
87 std::ostringstream oss;
88 oss << std::put_time(&tm_now, "%H%M%S");
89 return oss.str();
90}

Referenced by add_study_module(), and kcenon::pacs::integration_test::TEST_CASE().

Here is the caller graph for this function:

◆ enhanced_ct()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::enhanced_ct ( uint32_t frames = 100,
const std::string & study_uid = "" )
staticnodiscard

Generate an Enhanced CT multi-frame dataset.

Parameters
framesNumber of frames (default: 100)
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for Enhanced CT Image Storage

Definition at line 378 of file test_data_generator.cpp.

378 {
379 core::dicom_dataset ds;
380
381 add_patient_module(ds, "TEST^ENHCT^PATIENT", "TESTENHCT001", "19650110", "M");
382 add_study_module(ds, study_uid, "ACCENHCT001", "STUDYENHCT001", "Enhanced CT Test");
383 add_series_module(ds, "", "CT", "1", "Enhanced CT Volume");
384
385 // SOP Common - Enhanced CT Image Storage
387 "1.2.840.10008.5.1.4.1.1.2.1"); // Enhanced CT
389
390 // Image Pixel Module (use smaller size for enhanced multi-frame)
391 add_image_pixel_module(ds, 128, 128, 16, 12);
392
393 // Enhanced-specific: Image Type
395 "ORIGINAL\\PRIMARY\\VOLUME\\NONE");
396
397 add_multiframe_pixel_data(ds, 128, 128, 16, frames);
398
399 return ds;
400}
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.
constexpr dicom_tag image_type
Image Type.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enhanced_mr()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::enhanced_mr ( uint32_t frames = 50,
const std::string & study_uid = "" )
staticnodiscard

Generate an Enhanced MR multi-frame dataset.

Parameters
framesNumber of frames (default: 50)
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for Enhanced MR Image Storage

Definition at line 402 of file test_data_generator.cpp.

402 {
403 core::dicom_dataset ds;
404
405 add_patient_module(ds, "TEST^ENHMR^PATIENT", "TESTENHMR001", "19720520", "F");
406 add_study_module(ds, study_uid, "ACCENHMR001", "STUDYENHMR001", "Enhanced MR Test");
407 add_series_module(ds, "", "MR", "1", "Enhanced MR Volume");
408
409 // SOP Common - Enhanced MR Image Storage
411 "1.2.840.10008.5.1.4.1.1.4.1"); // Enhanced MR
413
414 // Image Pixel Module (use smaller size for enhanced multi-frame)
415 add_image_pixel_module(ds, 128, 128, 16, 12);
416
417 // Enhanced-specific: Image Type
419 "ORIGINAL\\PRIMARY\\VOLUME\\NONE");
420
421 add_multiframe_pixel_data(ds, 128, 128, 16, frames);
422
423 return ds;
424}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_uid()

std::string kcenon::pacs::integration_test::test_data_generator::generate_uid ( const std::string & root = "1.2.826.0.1.3680043.9.9999")
staticnodiscard

Generate a unique UID for testing.

Parameters
rootRoot UID prefix (default: test UID root)
Returns
Unique UID string

Definition at line 53 of file test_data_generator.cpp.

53 {
54 static std::atomic<uint64_t> counter{0};
55 auto now = std::chrono::system_clock::now();
56 auto timestamp = std::chrono::duration_cast<std::chrono::milliseconds>(
57 now.time_since_epoch()).count();
58
59 return root + "." + std::to_string(timestamp) + "." + std::to_string(++counter);
60}
@ counter
Monotonic increasing value.

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().

Here is the caller graph for this function:

◆ invalid()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::invalid ( invalid_dataset_type type)
staticnodiscard

Generate an intentionally invalid dataset.

Creates datasets with specific types of errors for testing error handling and validation logic.

Parameters
typeType of invalidity to introduce
Returns
Invalid DICOM dataset

Definition at line 596 of file test_data_generator.cpp.

596 {
597 core::dicom_dataset ds;
598
599 // Start with a valid base dataset
600 add_patient_module(ds, "TEST^INVALID^DATASET", "TESTINVALID001", "19901010", "M");
601 add_study_module(ds, "", "ACCINVALID001", "STUDYINVALID001", "Invalid Dataset Test");
602 add_series_module(ds, "", "OT", "1", "Invalid Series");
603
604 // Set SOP Common (will be modified based on type)
606 "1.2.840.10008.5.1.4.1.1.7");
608
609 add_image_pixel_module(ds, 64, 64, 8, 8);
610 add_pixel_data(ds, 64, 64, 8);
611
612 // Now introduce the specific invalidity
613 switch (type) {
615 ds.remove(core::tags::sop_class_uid);
616 break;
617
620 break;
621
623 ds.remove(core::tags::patient_id);
624 break;
625
628 break;
629
631 // Set a numeric value where UI is expected
632 ds.set_numeric<uint16_t>(core::tags::sop_class_uid, encoding::vr_type::US, 12345);
633 break;
634
636 // Remove proper pixel data and add truncated data
637 ds.remove(core::tags::pixel_data);
638 std::vector<uint8_t> corrupted(100, 0xFF); // Way too small
639 core::dicom_element pixel_elem(core::tags::pixel_data, encoding::vr_type::OB);
640 pixel_elem.set_value(std::span<const uint8_t>(corrupted.data(), corrupted.size()));
641 ds.insert(std::move(pixel_elem));
642 break;
643 }
644
646 // SH VR has max 16 characters - exceed it
648 "THIS_ACCESSION_NUMBER_IS_WAY_TOO_LONG_FOR_SH_VR");
649 break;
650 }
651
652 return ds;
653}
@ oversized_value
Value exceeds VR length limit.
@ missing_study_instance_uid
Missing Study Instance UID.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ large()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::large ( size_t target_size_mb)
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.

Parameters
target_size_mbTarget size in megabytes
Returns
DICOM dataset with large pixel data

Definition at line 515 of file test_data_generator.cpp.

515 {
516 core::dicom_dataset ds;
517
518 add_patient_module(ds, "TEST^LARGE^DATASET", "TESTLARGE001", "19700101", "M");
519 add_study_module(ds, "", "ACCLARGE001", "STUDYLARGE001", "Large Dataset Test");
520 add_series_module(ds, "", "OT", "1", "Large Test Series");
521
522 // SOP Common - Secondary Capture
524 "1.2.840.10008.5.1.4.1.1.7");
526
527 // Calculate dimensions to achieve target size
528 // target_size_mb * 1024 * 1024 = rows * columns * 2 (16-bit)
529 size_t total_bytes = target_size_mb * 1024 * 1024;
530 size_t total_pixels = total_bytes / 2;
531
532 // Use square dimensions
533 uint16_t dimension = static_cast<uint16_t>(std::sqrt(static_cast<double>(total_pixels)));
534 dimension = (std::min)(dimension, static_cast<uint16_t>(4096)); // Cap at 4096x4096
535
536 add_image_pixel_module(ds, dimension, dimension, 16, 12);
537 add_pixel_data(ds, dimension, dimension, 16, 1, 1024);
538
539 return ds;
540}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mr()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::mr ( const std::string & study_uid = "")
staticnodiscard

Generate an MR Image dataset.

Parameters
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for MR Image Storage

Definition at line 248 of file test_data_generator.cpp.

248 {
249 core::dicom_dataset ds;
250
251 add_patient_module(ds, "TEST^MR^PATIENT", "TESTMR001", "19900215", "F");
252 add_study_module(ds, study_uid, "ACCMR001", "STUDYMR001", "MR Integration Test");
253 add_series_module(ds, "", "MR", "1", "T1 FLAIR");
254
255 // SOP Common
257 "1.2.840.10008.5.1.4.1.1.4"); // MR Image Storage
259
260 // Image Pixel Module
261 add_image_pixel_module(ds, 64, 64, 16, 12);
262 add_pixel_data(ds, 64, 64, 16, 1, 256);
263
264 return ds;
265}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ patient_journey()

multi_modal_study kcenon::pacs::integration_test::test_data_generator::patient_journey ( const std::string & patient_id,
const std::vector< std::string > & modalities = {"CT", "MR", "XA"} )
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.

Parameters
patient_idPatient identifier
modalitiesList of modality codes (e.g., {"CT", "MR", "XA"})
Returns
Multi-modal study containing all generated datasets

Definition at line 430 of file test_data_generator.cpp.

432 {
433
434 multi_modal_study study;
435 study.patient_id = patient_id.empty() ? "PATJOURNEY001" : patient_id;
436 study.patient_name = "TEST^MULTIMODAL^PATIENT";
437 study.study_uid = generate_uid();
438
439 for (const auto& modality : modalities) {
440 core::dicom_dataset ds;
441
442 add_patient_module(ds, study.patient_name, study.patient_id, "19750101", "M");
443 add_study_module(ds, study.study_uid, "ACCMULTI001", "STUDYMULTI001",
444 "Multi-Modal Patient Journey");
445
446 std::string series_desc = modality + " Series";
447 add_series_module(ds, "", modality, std::to_string(study.datasets.size() + 1), series_desc);
448
449 // Set SOP Class based on modality
450 std::string sop_class_uid;
451 uint16_t rows = 64, columns = 64, bits = 16;
452
453 if (modality == "CT") {
454 sop_class_uid = "1.2.840.10008.5.1.4.1.1.2";
455 } else if (modality == "MR") {
456 sop_class_uid = "1.2.840.10008.5.1.4.1.1.4";
457 } else if (modality == "XA") {
459 rows = 512;
460 columns = 512;
461 } else if (modality == "US") {
463 rows = 480;
464 columns = 640;
465 bits = 8;
466 } else {
467 // Default to Secondary Capture for unknown modalities
468 sop_class_uid = "1.2.840.10008.5.1.4.1.1.7";
469 }
470
471 ds.set_string(core::tags::sop_class_uid, encoding::vr_type::UI, sop_class_uid);
473
474 add_image_pixel_module(ds, rows, columns, bits, static_cast<uint16_t>(bits - 4));
475 add_pixel_data(ds, rows, columns, bits);
476
477 study.datasets.push_back(std::move(ds));
478 }
479
480 return study;
481}
constexpr std::string_view us_image_storage_uid
US Image Storage SOP Class UID (single-frame)
Definition us_storage.h:39
constexpr std::string_view xa_image_storage_uid
XA Image Storage SOP Class UID (single/multi-frame)
Definition xa_storage.h:47

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unicode()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::unicode ( )
staticnodiscard

Generate a dataset with Unicode patient names.

Tests character set handling with international characters including CJK, Arabic, Hebrew, and special symbols.

Returns
DICOM dataset with Unicode patient information

Definition at line 542 of file test_data_generator.cpp.

542 {
543 core::dicom_dataset ds;
544
545 // Set specific character set for Unicode
546 ds.set_string(core::tags::specific_character_set, encoding::vr_type::CS, "ISO 2022 IR 149");
547
548 // Unicode patient names (Korean, Japanese, Chinese examples)
549 add_patient_module(ds, "홍^길동", "TESTUNICODE001", "19801225", "M");
550 add_study_module(ds, "", "ACCUNICODE001", "STUDYUNICODE001",
551 "Unicode Test Study - 유니코드 테스트");
552 add_series_module(ds, "", "OT", "1", "Unicode Series - 한글 시리즈");
553
554 // SOP Common - Secondary Capture
556 "1.2.840.10008.5.1.4.1.1.7");
558
559 add_image_pixel_module(ds, 64, 64, 8, 8);
560 add_pixel_data(ds, 64, 64, 8);
561
562 return ds;
563}
constexpr dicom_tag specific_character_set
Specific Character Set.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ us()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::us ( const std::string & study_uid = "")
staticnodiscard

Generate a single-frame US Image dataset.

Parameters
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for US Image Storage

Definition at line 300 of file test_data_generator.cpp.

300 {
301 core::dicom_dataset ds;
302
303 add_patient_module(ds, "TEST^US^PATIENT", "TESTUS001", "19850305", "M");
304 add_study_module(ds, study_uid, "ACCUS001", "STUDYUS001", "US Integration Test");
305 add_series_module(ds, "", "US", "1", "Cardiac Echo");
306
307 // SOP Common
311
312 // Image Pixel Module (640x480 typical for US)
313 add_image_pixel_module(ds, 480, 640, 8, 8);
314 add_pixel_data(ds, 480, 640, 8, 1, 64);
315
316 return ds;
317}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ us_cine()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::us_cine ( uint32_t frames = 60,
const std::string & study_uid = "" )
staticnodiscard

Generate a multi-frame US cine dataset.

Parameters
framesNumber of frames (default: 60)
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for multi-frame US Image Storage

Definition at line 354 of file test_data_generator.cpp.

354 {
355 core::dicom_dataset ds;
356
357 add_patient_module(ds, "TEST^USCINE^PATIENT", "TESTUSCINE001", "19880422", "F");
358 add_study_module(ds, study_uid, "ACCUSCINE001", "STUDYUSCINE001", "US Cine Test");
359 add_series_module(ds, "", "US", "1", "Cardiac Cine Loop");
360
361 // SOP Common - US Multi-frame Image Storage
365
366 // Image Pixel Module (640x480 typical for US)
367 add_image_pixel_module(ds, 480, 640, 8, 8);
368
369 // US-specific attributes
370 constexpr core::dicom_tag frame_time{0x0018, 0x1063};
371 ds.set_string(frame_time, encoding::vr_type::DS, "33.33"); // ~30 fps
372
373 add_multiframe_pixel_data(ds, 480, 640, 8, frames);
374
375 return ds;
376}
@ DS
Decimal String (16 chars max)
constexpr std::string_view us_multiframe_image_storage_uid
US Multi-frame Image Storage SOP Class UID (cine loops)
Definition us_storage.h:43
constexpr core::dicom_tag frame_time
Frame Time (0018,1063) - time between frames in ms.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ with_private_tags()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::with_private_tags ( const std::string & creator_id = "TEST PRIVATE CREATOR")
staticnodiscard

Generate a dataset with private tags.

Creates a dataset containing custom private tags for testing private tag preservation during storage and retrieval.

Parameters
creator_idPrivate creator identifier
Returns
DICOM dataset with private tags

Definition at line 565 of file test_data_generator.cpp.

565 {
566 core::dicom_dataset ds;
567
568 add_patient_module(ds, "TEST^PRIVATE^TAGS", "TESTPRIVATE001", "19851231", "F");
569 add_study_module(ds, "", "ACCPRIVATE001", "STUDYPRIVATE001", "Private Tags Test");
570 add_series_module(ds, "", "OT", "1", "Private Tags Series");
571
572 // SOP Common - Secondary Capture
574 "1.2.840.10008.5.1.4.1.1.7");
576
577 // Add private creator identification
578 constexpr core::dicom_tag private_creator_tag{0x0011, 0x0010};
579 ds.set_string(private_creator_tag, encoding::vr_type::LO, creator_id);
580
581 // Add private data elements
582 constexpr core::dicom_tag private_data_tag_1{0x0011, 0x1001};
583 constexpr core::dicom_tag private_data_tag_2{0x0011, 0x1002};
584 constexpr core::dicom_tag private_data_tag_3{0x0011, 0x1003};
585
586 ds.set_string(private_data_tag_1, encoding::vr_type::LO, "Private String Value");
587 ds.set_string(private_data_tag_2, encoding::vr_type::DS, "123.456");
588 ds.set_string(private_data_tag_3, encoding::vr_type::IS, "42");
589
590 add_image_pixel_module(ds, 64, 64, 8, 8);
591 add_pixel_data(ds, 64, 64, 8);
592
593 return ds;
594}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ worklist()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::worklist ( const std::string & patient_id = "",
const std::string & modality = "CT" )
staticnodiscard

Generate a worklist item dataset.

Parameters
patient_idPatient identifier (auto-generated if empty)
modalityScheduled modality (default: "CT")
Returns
DICOM dataset for Modality Worklist

Definition at line 483 of file test_data_generator.cpp.

485 {
486
487 core::dicom_dataset ds;
488
489 std::string pid = patient_id.empty() ? "TESTWL001" : patient_id;
490 add_patient_module(ds, "WORKLIST^TEST^PATIENT", pid, "19850520", "M");
491
492 // Scheduled Procedure Step
494 current_date());
496 "090000");
497 ds.set_string(core::tags::modality, encoding::vr_type::CS, modality);
499 modality + "_SCANNER");
501 modality + " Examination");
502
503 // Requested Procedure
505 ds.set_string(core::tags::accession_number, encoding::vr_type::SH, "WLACC001");
507
508 return ds;
509}
constexpr dicom_tag scheduled_procedure_step_description
Scheduled Procedure Step Description.
constexpr dicom_tag scheduled_procedure_step_start_date
Scheduled Procedure Step Start Date.
constexpr dicom_tag scheduled_station_ae_title
Scheduled Station AE Title.
constexpr dicom_tag requested_procedure_id
Requested Procedure ID.
constexpr dicom_tag scheduled_procedure_step_start_time
Scheduled Procedure Step Start Time.
@ AE
Application Entity (16 chars max)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xa()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::xa ( const std::string & study_uid = "")
staticnodiscard

Generate a single-frame XA Image dataset.

Parameters
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for XA Image Storage

Definition at line 267 of file test_data_generator.cpp.

267 {
268 core::dicom_dataset ds;
269
270 add_patient_module(ds, "TEST^XA^PATIENT", "TESTXA001", "19750610", "F");
271 add_study_module(ds, study_uid, "ACCXA001", "STUDYXA001", "XA Integration Test");
272 add_series_module(ds, "", "XA", "1", "Coronary Angio");
273
274 // SOP Common
278
279 // Image Pixel Module (512x512 for XA)
280 add_image_pixel_module(ds, 512, 512, 16, 12);
281
282 // XA-specific attributes
283 constexpr core::dicom_tag positioner_primary_angle{0x0018, 0x1510};
284 constexpr core::dicom_tag positioner_secondary_angle{0x0018, 0x1511};
285 constexpr core::dicom_tag kvp{0x0018, 0x0060};
286 constexpr core::dicom_tag xray_tube_current{0x0018, 0x1151};
287 constexpr core::dicom_tag exposure_time{0x0018, 0x1150};
288
289 ds.set_string(positioner_primary_angle, encoding::vr_type::DS, "0");
290 ds.set_string(positioner_secondary_angle, encoding::vr_type::DS, "0");
291 ds.set_string(kvp, encoding::vr_type::DS, "80");
292 ds.set_string(xray_tube_current, encoding::vr_type::IS, "500");
293 ds.set_string(exposure_time, encoding::vr_type::IS, "100");
294
295 add_pixel_data(ds, 512, 512, 16, 1, 128);
296
297 return ds;
298}
constexpr core::dicom_tag exposure_time
Exposure Time (0018,1150) - Duration of X-Ray exposure in ms.
constexpr core::dicom_tag xray_tube_current
X-Ray Tube Current (0018,1151) - in mA.
constexpr core::dicom_tag kvp
KVP (0018,0060) - Peak kilo voltage output of the X-Ray generator.
constexpr core::dicom_tag positioner_secondary_angle
Positioner Secondary Angle (0018,1511) - Cranial/Caudal.
constexpr core::dicom_tag positioner_primary_angle
Positioner Primary Angle (0018,1510) - LAO/RAO.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xa_cine()

core::dicom_dataset kcenon::pacs::integration_test::test_data_generator::xa_cine ( uint32_t frames = 30,
const std::string & study_uid = "" )
staticnodiscard

Generate a multi-frame XA cine dataset.

Parameters
framesNumber of frames (default: 30)
study_uidStudy Instance UID (auto-generated if empty)
Returns
DICOM dataset for multi-frame XA Image Storage

Definition at line 323 of file test_data_generator.cpp.

323 {
324 core::dicom_dataset ds;
325
326 add_patient_module(ds, "TEST^XACINE^PATIENT", "TESTXACINE001", "19700815", "M");
327 add_study_module(ds, study_uid, "ACCXACINE001", "STUDYXACINE001", "XA Cine Test");
328 add_series_module(ds, "", "XA", "1", "Coronary Cine Run");
329
330 // SOP Common - use standard XA (supports multiframe)
334
335 // Image Pixel Module (512x512 for XA)
336 add_image_pixel_module(ds, 512, 512, 16, 12);
337
338 // XA-specific attributes
339 constexpr core::dicom_tag positioner_primary_angle{0x0018, 0x1510};
340 constexpr core::dicom_tag positioner_secondary_angle{0x0018, 0x1511};
341 constexpr core::dicom_tag cine_rate{0x0018, 0x0040};
342 constexpr core::dicom_tag frame_time{0x0018, 0x1063};
343
344 ds.set_string(positioner_primary_angle, encoding::vr_type::DS, "30");
345 ds.set_string(positioner_secondary_angle, encoding::vr_type::DS, "-15");
346 ds.set_string(cine_rate, encoding::vr_type::IS, "15"); // 15 fps
347 ds.set_string(frame_time, encoding::vr_type::DS, "66.67"); // ~15 fps
348
349 add_multiframe_pixel_data(ds, 512, 512, 16, frames);
350
351 return ds;
352}
constexpr core::dicom_tag cine_rate
Cine Rate (0018,0040) - intended display rate.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: