16#ifdef KCENON_USE_MODULES
24int main(
int argc,
char* argv[]) {
25 std::cout <<
"=== PACS System C++20 Module Example ===\n\n";
28 std::cout <<
"1. Core Module Demo\n";
29 std::cout <<
"-------------------\n";
36 std::cout <<
"Patient Name Tag: (" << std::hex
37 << patient_name_tag.group() <<
","
38 << patient_name_tag.element() <<
")\n";
42 std::cout <<
"Created empty dataset (size: " << std::dec
43 << dataset.
size() <<
" elements)\n\n";
46 std::cout <<
"2. Encoding Module Demo\n";
47 std::cout <<
"-----------------------\n";
52 std::cout <<
"Implicit VR LE - Little Endian: "
53 << (implicit_le.is_little_endian() ?
"Yes" :
"No") <<
"\n";
54 std::cout <<
"Explicit VR LE - Implicit VR: "
55 << (explicit_le.is_implicit_vr() ?
"Yes" :
"No") <<
"\n\n";
59 std::cout <<
"3. File Operations Demo\n";
60 std::cout <<
"-----------------------\n";
62 std::string filepath = argv[1];
63 std::cout <<
"Reading DICOM file: " << filepath <<
"\n";
66 auto result = file.read(filepath);
69 std::cout <<
"Successfully read DICOM file\n";
70 std::cout <<
"Dataset elements: " << file.
dataset().size() <<
"\n";
72 std::cout <<
"Failed to read DICOM file\n";
76 std::cout <<
"\n=== Module Example Complete ===\n";
85 std::cout <<
"C++20 modules are not enabled.\n";
86 std::cout <<
"Build with -DPACS_BUILD_MODULES=ON to use this example.\n";
87 std::cout <<
"\nExample:\n";
88 std::cout <<
" cmake -DPACS_BUILD_MODULES=ON -DPACS_BUILD_EXAMPLES=ON ..\n";
89 std::cout <<
" cmake --build .\n";
auto size() const noexcept -> size_t
Get the number of elements in the dataset.
auto dataset() const noexcept -> const dicom_dataset &
Get read-only access to the main dataset.
static const transfer_syntax explicit_vr_little_endian
Explicit VR Little Endian (1.2.840.10008.1.2.1)
static const transfer_syntax implicit_vr_little_endian
Implicit VR Little Endian (1.2.840.10008.1.2)