27#include <unordered_map>
28#include <unordered_set>
58 std::string_view str);
65 std::vector<std::string>
tags;
68 std::optional<metadata_preset>
preset;
99 std::unordered_map<std::string, std::string>
tags;
103 std::unordered_map<std::string, std::string> tag_map) {
106 r.
tags = std::move(tag_map);
157 std::string_view str);
351 std::shared_ptr<storage::index_database> database);
373 std::string_view sop_instance_uid,
396 std::string_view series_uid,
398 bool ascending =
true);
406 std::string_view sop_instance_uid);
417 [[nodiscard]]
static std::vector<window_level_preset>
447 [[nodiscard]] std::unordered_map<std::string, std::string>
read_dicom_tags(
448 std::string_view file_path,
449 const std::unordered_set<std::string>& requested_tags,
450 bool include_private);
458 std::string_view sop_instance_uid);
sort_order
Sort order for series instances.
@ instance_number
Sort by InstanceNumber.
@ position
Sort by ImagePositionPatient/SliceLocation.
@ acquisition_time
Sort by AcquisitionTime.
std::string_view preset_to_string(metadata_preset preset)
Convert preset enum to string.
std::optional< sort_order > sort_order_from_string(std::string_view str)
Parse sort order from string.
std::optional< metadata_preset > preset_from_string(std::string_view str)
Parse preset from string.
metadata_preset
Metadata preset types for common use cases.
@ image_display
Rows, Columns, Bits, PhotometricInterpretation.
@ patient_info
Patient demographics.
@ acquisition
KVP, ExposureTime, SliceThickness.
@ positioning
ImagePosition, ImageOrientation, PixelSpacing.
@ multiframe
NumberOfFrames, FrameTime.
@ window_level
WindowCenter, WindowWidth, Rescale values.
std::string_view sort_order_to_string(sort_order order)
Convert sort order enum to string.
std::optional< double > frame_time
Frame time in milliseconds (for cine)
uint16_t columns
Image columns.
static frame_info ok()
Create a success result.
std::optional< double > frame_rate
Frame rate (frames per second)
std::string error_message
Error message if failed.
bool success
Whether the operation succeeded.
static frame_info error(std::string message)
Create an error result.
uint32_t total_frames
Total number of frames.
Navigation info for an instance.
std::string first
First instance UID.
static navigation_info error(std::string message)
Create an error result.
std::string error_message
Error message if failed.
bool success
Whether the operation succeeded.
std::string next
Next instance UID (empty if last)
std::string last
Last instance UID.
size_t total
Total instances in series.
size_t index
Current index (0-based)
std::string previous
Previous instance UID (empty if first)
static navigation_info ok()
Create a success result.
Instance info for series navigation.
std::optional< std::vector< double > > image_position_patient
Image Position Patient (if available)
std::optional< double > slice_location
Slice location (if available)
std::string sop_instance_uid
SOP Instance UID.
std::optional< std::string > acquisition_time
Acquisition time (if available)
std::optional< int > instance_number
Instance number (if available)
Response for sorted instances query.
std::vector< sorted_instance > instances
Sorted instances.
static sorted_instances_response ok(std::vector< sorted_instance > inst, size_t count)
Create a success result.
std::string error_message
Error message if failed.
static sorted_instances_response error(std::string message)
Create an error result.
bool success
Whether the operation succeeded.
size_t total
Total number of instances.
DICOM tag value in metadata response.
std::string tag
Tag in hex format (e.g., "00280010")
std::string value
Value as string (numeric values converted to string)
bool is_array
Whether this is an array/sequence (for multi-valued elements)
VOI LUT information from DICOM.
bool success
Whether the operation succeeded.
std::string error_message
Error message if failed.
std::vector< double > window_width
Window width values.
static voi_lut_info error(std::string message)
Create an error result.
double rescale_intercept
Rescale intercept.
static voi_lut_info ok()
Create a success result.
std::vector< std::string > window_explanations
Window explanations (optional descriptions)
double rescale_slope
Rescale slope.
std::vector< double > window_center
Window center values.
double center
Window center value.
double width
Window width value.
std::string name
Preset name (e.g., "Lung", "Bone")