35static constexpr std::array<ts_entry, 18> TS_REGISTRY = {{
38 "Implicit VR Little Endian",
43 {
"1.2.840.10008.1.2.1",
44 "Explicit VR Little Endian",
49 {
"1.2.840.10008.1.2.2",
50 "Explicit VR Big Endian",
56 {
"1.2.840.10008.1.2.1.99",
57 "Deflated Explicit VR Little Endian",
63 {
"1.2.840.10008.1.2.4.50",
64 "JPEG Baseline (Process 1)",
69 {
"1.2.840.10008.1.2.4.70",
70 "JPEG Lossless, Non-Hierarchical, First-Order Prediction",
76 {
"1.2.840.10008.1.2.4.90",
77 "JPEG 2000 Image Compression (Lossless Only)",
82 {
"1.2.840.10008.1.2.4.91",
83 "JPEG 2000 Image Compression",
89 {
"1.2.840.10008.1.2.5",
96 {
"1.2.840.10008.1.2.4.201",
97 "High-Throughput JPEG 2000 Image Compression (Lossless Only)",
102 {
"1.2.840.10008.1.2.4.202",
103 "High-Throughput JPEG 2000 with RPCL Options Image Compression (Lossless Only)",
108 {
"1.2.840.10008.1.2.4.203",
109 "High-Throughput JPEG 2000 Image Compression",
115 {
"1.2.840.10008.1.2.4.107",
116 "HEVC/H.265 Main Profile / Level 5.1",
121 {
"1.2.840.10008.1.2.4.108",
122 "HEVC/H.265 Main 10 Profile / Level 5.1",
128 {
"1.2.840.10008.1.2.4.110",
134 {
"1.2.840.10008.1.2.4.111",
135 "JPEG XL JPEG Recompression",
140 {
"1.2.840.10008.1.2.4.112",
147 {
"1.2.840.10008.1.2.11",
159const ts_entry* find_entry(std::string_view
uid) {
160 auto it = std::find_if(TS_REGISTRY.begin(), TS_REGISTRY.end(),
161 [&
uid](
const ts_entry& entry) {
162 return entry.uid == uid;
164 return (it != TS_REGISTRY.end()) ? &(*it) :
nullptr;
172 "Implicit VR Little Endian",
178 "1.2.840.10008.1.2.1",
179 "Explicit VR Little Endian",
185 "1.2.840.10008.1.2.2",
186 "Explicit VR Big Endian",
192 "1.2.840.10008.1.2.1.99",
193 "Deflated Explicit VR Little Endian",
199 "1.2.840.10008.1.2.4.50",
200 "JPEG Baseline (Process 1)",
206 "1.2.840.10008.1.2.4.70",
207 "JPEG Lossless, Non-Hierarchical, First-Order Prediction",
213 "1.2.840.10008.1.2.4.90",
214 "JPEG 2000 Image Compression (Lossless Only)",
220 "1.2.840.10008.1.2.4.91",
221 "JPEG 2000 Image Compression",
227 "1.2.840.10008.1.2.5",
234 "1.2.840.10008.1.2.4.201",
235 "High-Throughput JPEG 2000 Image Compression (Lossless Only)",
241 "1.2.840.10008.1.2.4.202",
242 "High-Throughput JPEG 2000 with RPCL Options Image Compression (Lossless Only)",
248 "1.2.840.10008.1.2.4.203",
249 "High-Throughput JPEG 2000 Image Compression",
255 "1.2.840.10008.1.2.4.107",
256 "HEVC/H.265 Main Profile / Level 5.1",
262 "1.2.840.10008.1.2.4.108",
263 "HEVC/H.265 Main 10 Profile / Level 5.1",
269 "1.2.840.10008.1.2.4.110",
276 "1.2.840.10008.1.2.4.111",
277 "JPEG XL JPEG Recompression",
283 "1.2.840.10008.1.2.4.112",
290 "1.2.840.10008.1.2.11",
302 encapsulated_(false),
306 if (
const auto* entry = find_entry(
uid)) {
364 return uid_ == other.uid_;
368 return !(*
this == other);
372 if (
const auto* entry = find_entry(
uid)) {
374 entry->vr, entry->encapsulated, entry->deflated,
381 std::vector<transfer_syntax> result;
382 result.reserve(TS_REGISTRY.size());
384 for (
const auto& entry : TS_REGISTRY) {
385 if (entry.supported) {
387 entry.vr, entry.encapsulated,
388 entry.deflated, entry.supported});
395 std::vector<transfer_syntax> result;
396 result.reserve(TS_REGISTRY.size());
398 for (
const auto& entry : TS_REGISTRY) {
400 entry.vr, entry.encapsulated,
401 entry.deflated, entry.supported});
Represents a DICOM Transfer Syntax.
vr_encoding vr_type() const noexcept
Returns the VR encoding mode for this Transfer Syntax.
static const transfer_syntax explicit_vr_big_endian
Explicit VR Big Endian (1.2.840.10008.1.2.2) - Retired.
static const transfer_syntax jpeg2000_lossy
JPEG 2000 Image Compression (1.2.840.10008.1.2.4.91)
transfer_syntax(std::string_view uid)
Constructs a transfer_syntax from a UID string.
static const transfer_syntax jpegxl_jpeg_recompression
JPEG XL JPEG Recompression (1.2.840.10008.1.2.4.111) - Supplement 232.
std::string_view uid() const noexcept
Returns the Transfer Syntax UID.
static const transfer_syntax htj2k_lossy
HTJ2K (1.2.840.10008.1.2.4.203) - Lossless or Lossy.
byte_order endianness() const noexcept
Returns the byte ordering for this Transfer Syntax.
static const transfer_syntax hevc_main
HEVC/H.265 Main Profile / Level 5.1 (1.2.840.10008.1.2.4.107)
static const transfer_syntax hevc_main10
HEVC/H.265 Main 10 Profile / Level 5.1 (1.2.840.10008.1.2.4.108)
static const transfer_syntax jpegxl_lossless
JPEG XL Lossless (1.2.840.10008.1.2.4.110) - Supplement 232.
static const transfer_syntax frame_deflate
Frame Deflate (1.2.840.10008.1.2.11) - Supplement 244.
bool operator!=(const transfer_syntax &other) const noexcept
Compares two Transfer Syntaxes by UID.
static const transfer_syntax jpeg_baseline
JPEG Baseline (Process 1) (1.2.840.10008.1.2.4.50)
std::string_view name() const noexcept
Returns the human-readable name of the Transfer Syntax.
bool operator==(const transfer_syntax &other) const noexcept
Compares two Transfer Syntaxes by UID.
static const transfer_syntax htj2k_lossless
HTJ2K Lossless Only (1.2.840.10008.1.2.4.201)
static const transfer_syntax rle_lossless
RLE Lossless (1.2.840.10008.1.2.5)
bool is_supported() const noexcept
Checks if this Transfer Syntax is currently supported.
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)
static const transfer_syntax jpeg_lossless
JPEG Lossless, Non-Hierarchical (1.2.840.10008.1.2.4.70)
bool is_deflated() const noexcept
Checks if this Transfer Syntax uses deflate compression.
static const transfer_syntax jpegxl_lossy
JPEG XL (1.2.840.10008.1.2.4.112) - Supplement 232.
static const transfer_syntax deflated_explicit_vr_le
Deflated Explicit VR Little Endian (1.2.840.10008.1.2.1.99)
static const transfer_syntax htj2k_rpcl
HTJ2K RPCL (1.2.840.10008.1.2.4.202) - Lossless Only.
bool is_valid() const noexcept
Checks if this is a recognized DICOM Transfer Syntax.
static const transfer_syntax jpeg2000_lossless
JPEG 2000 Image Compression (Lossless Only) (1.2.840.10008.1.2.4.90)
bool is_encapsulated() const noexcept
Checks if this Transfer Syntax uses encapsulated (compressed) format.
std::optional< transfer_syntax > find_transfer_syntax(std::string_view uid)
Looks up a Transfer Syntax by its UID.
std::vector< transfer_syntax > all_transfer_syntaxes()
Returns a list of all known Transfer Syntaxes.
std::vector< transfer_syntax > supported_transfer_syntaxes()
Returns a list of all supported Transfer Syntaxes.
byte_order
Byte ordering for DICOM data encoding.
@ little_endian
Least significant byte first (most common)
@ big_endian
Most significant byte first (legacy, rarely used)
vr_encoding
Value Representation encoding mode.
@ explicit_vr
VR explicitly encoded in the data stream.
@ implicit
VR determined from data dictionary lookup.