PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
seg_storage.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2021-2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
19#ifndef PACS_SERVICES_SOP_CLASSES_SEG_STORAGE_HPP
20#define PACS_SERVICES_SOP_CLASSES_SEG_STORAGE_HPP
21
22#include <array>
23#include <cstdint>
24#include <string>
25#include <string_view>
26#include <vector>
27
29
30// =============================================================================
31// Segmentation Storage SOP Class UIDs
32// =============================================================================
33
36
38inline constexpr std::string_view segmentation_storage_uid =
39 "1.2.840.10008.5.1.4.1.1.66.4";
40
42inline constexpr std::string_view surface_segmentation_storage_uid =
43 "1.2.840.10008.5.1.4.1.1.66.5";
44
46inline constexpr std::string_view heightmap_segmentation_storage_uid =
47 "1.2.840.10008.5.1.4.1.1.66.7";
48
50inline constexpr std::string_view label_map_segmentation_storage_uid =
51 "1.2.840.10008.5.1.4.1.1.66.8";
52
54
55// =============================================================================
56// SEG-Specific Transfer Syntaxes
57// =============================================================================
58
68[[nodiscard]] std::vector<std::string> get_seg_transfer_syntaxes();
69
70// =============================================================================
71// Segmentation Type
72// =============================================================================
73
80 binary,
82};
83
89[[nodiscard]] std::string_view to_string(segmentation_type type) noexcept;
90
96[[nodiscard]] segmentation_type parse_segmentation_type(std::string_view value) noexcept;
97
103[[nodiscard]] bool is_valid_segmentation_type(std::string_view value) noexcept;
104
105// =============================================================================
106// Segmentation Fractional Type
107// =============================================================================
108
118
124[[nodiscard]] std::string_view to_string(segmentation_fractional_type type) noexcept;
125
132parse_segmentation_fractional_type(std::string_view value) noexcept;
133
134// =============================================================================
135// Segment Algorithm Type
136// =============================================================================
137
144 automatic,
146 manual
147};
148
154[[nodiscard]] std::string_view to_string(segment_algorithm_type type) noexcept;
155
161[[nodiscard]] segment_algorithm_type
162parse_segment_algorithm_type(std::string_view value) noexcept;
163
169[[nodiscard]] bool is_valid_segment_algorithm_type(std::string_view value) noexcept;
170
171// =============================================================================
172// Recommended Display CIELab Value
173// =============================================================================
174
181 uint16_t l;
182 uint16_t a;
183 uint16_t b;
184};
185
191[[nodiscard]] segment_color get_recommended_segment_color(std::string_view segment_label) noexcept;
192
193// =============================================================================
194// SEG SOP Class Information
195// =============================================================================
196
201 std::string_view uid;
202 std::string_view name;
203 std::string_view description;
206};
207
214[[nodiscard]] std::vector<std::string>
215get_seg_storage_sop_classes(bool include_surface = true);
216
223[[nodiscard]] const seg_sop_class_info*
224get_seg_sop_class_info(std::string_view uid) noexcept;
225
232[[nodiscard]] bool is_seg_storage_sop_class(std::string_view uid) noexcept;
233
240[[nodiscard]] bool is_surface_segmentation_sop_class(std::string_view uid) noexcept;
241
242// =============================================================================
243// Segment Category and Type Codes
244// =============================================================================
245
260
266[[nodiscard]] std::string_view get_segment_category_code(segment_category category) noexcept;
267
273[[nodiscard]] std::string_view get_segment_category_meaning(segment_category category) noexcept;
274
275} // namespace kcenon::pacs::services::sop_classes
276
277#endif // PACS_SERVICES_SOP_CLASSES_SEG_STORAGE_HPP
std::string_view get_segment_category_code(segment_category category) noexcept
Get SNOMED CT code for segment category.
const seg_sop_class_info * get_seg_sop_class_info(std::string_view uid) noexcept
Get information about a specific SEG SOP Class.
@ semiautomatic
SEMIAUTOMATIC - Semi-automated with user input.
constexpr std::string_view label_map_segmentation_storage_uid
Label Map Segmentation Storage SOP Class UID (Supplement 243)
Definition seg_storage.h:50
segment_algorithm_type parse_segment_algorithm_type(std::string_view value) noexcept
Parse segment algorithm type from DICOM string.
segment_algorithm_type
Segment algorithm type (0062,0008)
segmentation_fractional_type parse_segmentation_fractional_type(std::string_view value) noexcept
Parse segmentation fractional type from DICOM string.
bool is_valid_segmentation_type(std::string_view value) noexcept
Check if segmentation type string is valid.
constexpr std::string_view heightmap_segmentation_storage_uid
Heightmap Segmentation Storage SOP Class UID (Supplement 240)
Definition seg_storage.h:46
bool is_surface_segmentation_sop_class(std::string_view uid) noexcept
Check if a SOP Class UID is Surface Segmentation.
segmentation_type parse_segmentation_type(std::string_view value) noexcept
Parse segmentation type from DICOM string.
std::vector< std::string > get_seg_storage_sop_classes(bool include_surface=true)
Get all SEG Storage SOP Class UIDs.
constexpr std::string_view surface_segmentation_storage_uid
Surface Segmentation Storage SOP Class UID.
Definition seg_storage.h:42
std::vector< std::string > get_seg_transfer_syntaxes()
Get recommended transfer syntaxes for SEG objects.
bool is_valid_segment_algorithm_type(std::string_view value) noexcept
Check if segment algorithm type string is valid.
segmentation_type
Segmentation type (0062,0001)
Definition seg_storage.h:79
@ binary
BINARY - Binary segmentation (0 or 1)
@ fractional
FRACTIONAL - Fractional/probabilistic segmentation.
constexpr std::string_view segmentation_storage_uid
Segmentation Storage SOP Class UID.
Definition seg_storage.h:38
bool is_seg_storage_sop_class(std::string_view uid) noexcept
Check if a SOP Class UID is a SEG Storage SOP Class.
segmentation_fractional_type
Segmentation fractional type (0062,0010)
@ probability
PROBABILITY - Values represent probability (0.0-1.0)
@ occupancy
OCCUPANCY - Values represent fractional occupancy.
segment_color get_recommended_segment_color(std::string_view segment_label) noexcept
Get recommended color for common segment types.
std::string_view get_segment_category_meaning(segment_category category) noexcept
Get code meaning for segment category.
segment_category
Common anatomical property categories (CID 7150)
@ physical_object
Physical object (implant, etc.)
@ tissue
Tissue type (organ, muscle, etc.)
std::string_view to_string(dx_photometric_interpretation interp) noexcept
Convert photometric interpretation enum to DICOM string.
Information about a SEG Storage SOP Class.
bool is_surface
Whether this is surface segmentation.
std::string_view description
Brief description.
std::string_view name
Human-readable name.
bool is_retired
Whether this SOP class is retired.
Standard segment colors for common anatomical structures.
uint16_t b
b* component (0-65535, maps to -128 to 127)
uint16_t a
a* component (0-65535, maps to -128 to 127)
uint16_t l
L* component (0-65535, maps to 0-100)
std::string_view uid