PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
transfer_syntax.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
11#ifndef PACS_ENCODING_TRANSFER_SYNTAX_HPP
12#define PACS_ENCODING_TRANSFER_SYNTAX_HPP
13
15
16#include <optional>
17#include <string>
18#include <string_view>
19#include <vector>
20
21namespace kcenon::pacs::encoding {
22
36public:
44 explicit transfer_syntax(std::string_view uid);
45
48
53 [[nodiscard]] std::string_view uid() const noexcept;
54
59 [[nodiscard]] std::string_view name() const noexcept;
60
65 [[nodiscard]] byte_order endianness() const noexcept;
66
71 [[nodiscard]] vr_encoding vr_type() const noexcept;
72
77 [[nodiscard]] bool is_encapsulated() const noexcept;
78
83 [[nodiscard]] bool is_deflated() const noexcept;
84
86
89
94 [[nodiscard]] bool is_valid() const noexcept;
95
102 [[nodiscard]] bool is_supported() const noexcept;
103
105
108
111
114
117
120
123
126
129
132
135
138
141
144
147
150
153
156
159
162
164
167
173 bool operator==(const transfer_syntax& other) const noexcept;
174
180 bool operator!=(const transfer_syntax& other) const noexcept;
181
183
184private:
186 friend std::optional<transfer_syntax> find_transfer_syntax(std::string_view);
187 friend std::vector<transfer_syntax> supported_transfer_syntaxes();
188 friend std::vector<transfer_syntax> all_transfer_syntaxes();
189
191 transfer_syntax(std::string_view uid, std::string_view name,
193 bool encapsulated, bool deflated, bool supported);
194
195 std::string uid_;
196 std::string name_;
201 bool valid_;
203};
204
207
213[[nodiscard]] std::optional<transfer_syntax> find_transfer_syntax(
214 std::string_view uid);
215
220[[nodiscard]] std::vector<transfer_syntax> supported_transfer_syntaxes();
221
226[[nodiscard]] std::vector<transfer_syntax> all_transfer_syntaxes();
227
229
230} // namespace kcenon::pacs::encoding
231
232#endif // PACS_ENCODING_TRANSFER_SYNTAX_HPP
Represents a DICOM Transfer Syntax.
vr_encoding vr_type() const noexcept
Returns the VR encoding mode for this Transfer Syntax.
friend std::optional< transfer_syntax > find_transfer_syntax(std::string_view)
Allow registry functions to use private constructor.
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.
friend std::vector< transfer_syntax > supported_transfer_syntaxes()
Returns a list of all supported Transfer Syntaxes.
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.
friend std::vector< transfer_syntax > all_transfer_syntaxes()
Returns a list of all known Transfer Syntaxes.
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.
Definition byte_order.h:22
vr_encoding
Value Representation encoding mode.
Definition byte_order.h:33
vr_encoding vr
std::string_view uid
byte_order endian
bool deflated
bool supported
bool encapsulated