PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
main.cpp File Reference

DICOM to JSON Converter - DICOM PS3.18 JSON Representation. More...

#include "kcenon/pacs/core/dicom_dictionary.h"
#include "kcenon/pacs/core/dicom_file.h"
#include "kcenon/pacs/core/dicom_tag_constants.h"
#include "kcenon/pacs/encoding/transfer_syntax.h"
#include "kcenon/pacs/encoding/vr_type.h"
#include <algorithm>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

DICOM to JSON Converter - DICOM PS3.18 JSON Representation.

Definition in file main.cpp.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 788 of file main.cpp.

788 {
789 options opts;
790
791 if (!parse_arguments(argc, argv, opts)) {
792 std::cout << R"(
793 ____ ____ __ __ _____ ___ _ ____ ___ _ _
794 | _ \ / ___| \/ | |_ _|/ _ \ | / ___| / _ \| \ | |
795 | | | | | | |\/| | | | | | | | _ | \___ \| | | | \| |
796 | |_| | |___| | | | | | | |_| | | |_| |___) | |_| | |\ |
797 |____/ \____|_| |_| |_| \___/ \___/|____/ \___/|_| \_|
798
799 DICOM to JSON Converter (PS3.18)
800)" << "\n";
801 print_usage(argv[0]);
802 return 1;
803 }
804
805 // Check if input path exists
806 if (!std::filesystem::exists(opts.input_path)) {
807 std::cerr << "Error: Path does not exist: " << opts.input_path.string() << "\n";
808 return 2;
809 }
810
811 // Create bulk data directory if needed
812 if (opts.bulk_mode == bulk_data_mode::uri && !opts.bulk_data_dir.empty()) {
813 std::filesystem::create_directories(opts.bulk_data_dir);
814 }
815
816 // Show banner in non-quiet mode
817 if (!opts.quiet) {
818 std::cout << R"(
819 ____ ____ __ __ _____ ___ _ ____ ___ _ _
820 | _ \ / ___| \/ | |_ _|/ _ \ | / ___| / _ \| \ | |
821 | | | | | | |\/| | | | | | | | _ | \___ \| | | | \| |
822 | |_| | |___| | | | | | | |_| | | |_| |___) | |_| | |\ |
823 |____/ \____|_| |_| |_| \___/ \___/|____/ \___/|_| \_|
824
825 DICOM to JSON Converter (PS3.18)
826)" << "\n";
827 }
828
829 // Handle directory vs file
830 if (std::filesystem::is_directory(opts.input_path)) {
831 return process_directory(opts.input_path, opts);
832 } else {