dicom_transfer_syntax_registry/
entries.rs1use crate::{adapters::uncompressed::UncompressedAdapter, create_ts_stub};
25use byteordered::Endianness;
26use dicom_encoding::transfer_syntax::{AdapterFreeTransferSyntax as Ts, Codec};
27
28use dicom_encoding::transfer_syntax::{NeverAdapter, TransferSyntax};
29
30#[cfg(any(feature = "rle", feature = "openjp2", feature = "openjpeg-sys"))]
31use dicom_encoding::NeverPixelAdapter;
32
33#[cfg(feature = "jpeg")]
34use crate::adapters::jpeg::JpegAdapter;
35#[cfg(any(feature = "openjp2", feature = "openjpeg-sys"))]
36use crate::adapters::jpeg2k::Jpeg2000Adapter;
37#[cfg(feature = "rle")]
38use crate::adapters::rle_lossless::RleLosslessAdapter;
39
40pub const IMPLICIT_VR_LITTLE_ENDIAN: Ts = Ts::new(
44 "1.2.840.10008.1.2",
45 "Implicit VR Little Endian",
46 Endianness::Little,
47 false,
48 Codec::None,
49);
50
51pub const EXPLICIT_VR_LITTLE_ENDIAN: Ts = Ts::new_ele(
53 "1.2.840.10008.1.2.1",
54 "Explicit VR Little Endian",
55 Codec::None,
56);
57
58pub const EXPLICIT_VR_BIG_ENDIAN: Ts = Ts::new(
60 "1.2.840.10008.1.2.2",
61 "Explicit VR Big Endian",
62 Endianness::Big,
63 true,
64 Codec::None,
65);
66
67pub const ENCAPSULATED_UNCOMPRESSED_EXPLICIT_VR_LITTLE_ENDIAN: TransferSyntax<
69 NeverAdapter,
70 UncompressedAdapter,
71 UncompressedAdapter,
72> = TransferSyntax::new_ele(
73 "1.2.840.10008.1.2.1.98",
74 "Encapsulated Uncompressed Explicit VR Little Endian",
75 Codec::EncapsulatedPixelData(Some(UncompressedAdapter), Some(UncompressedAdapter)),
76);
77
78#[cfg(feature = "rle")]
82pub const RLE_LOSSLESS: TransferSyntax<NeverAdapter, RleLosslessAdapter, NeverPixelAdapter> =
83 TransferSyntax::new_ele(
84 "1.2.840.10008.1.2.5",
85 "RLE Lossless",
86 Codec::EncapsulatedPixelData(Some(RleLosslessAdapter), None),
87 );
88#[cfg(not(feature = "rle"))]
93pub const RLE_LOSSLESS: Ts = create_ts_stub("1.2.840.10008.1.2.5", "RLE Lossless");
94
95#[cfg(feature = "jpeg")]
101type JpegTs<R = JpegAdapter, W = JpegAdapter> = TransferSyntax<NeverAdapter, R, W>;
102
103#[cfg(feature = "jpeg")]
105const fn create_ts_jpeg(uid: &'static str, name: &'static str, encoder: bool) -> JpegTs {
106 TransferSyntax::new_ele(
107 uid,
108 name,
109 Codec::EncapsulatedPixelData(
110 Some(JpegAdapter),
111 if encoder { Some(JpegAdapter) } else { None },
112 ),
113 )
114}
115
116#[cfg(feature = "jpeg")]
118pub const JPEG_BASELINE: JpegTs =
119 create_ts_jpeg("1.2.840.10008.1.2.4.50", "JPEG Baseline (Process 1)", true);
120#[cfg(not(feature = "jpeg"))]
125pub const JPEG_BASELINE: Ts = create_ts_stub("1.2.840.10008.1.2.4.50", "JPEG Baseline (Process 1)");
126
127#[cfg(feature = "jpeg")]
129pub const JPEG_EXTENDED: JpegTs = create_ts_jpeg(
130 "1.2.840.10008.1.2.4.51",
131 "JPEG Extended (Process 2 & 4)",
132 false,
133);
134#[cfg(not(feature = "jpeg"))]
139pub const JPEG_EXTENDED: Ts =
140 create_ts_stub("1.2.840.10008.1.2.4.51", "JPEG Extended (Process 2 & 4)");
141
142#[cfg(feature = "jpeg")]
144pub const JPEG_LOSSLESS_NON_HIERARCHICAL: JpegTs = create_ts_jpeg(
145 "1.2.840.10008.1.2.4.57",
146 "JPEG Lossless, Non-Hierarchical (Process 14)",
147 false,
148);
149#[cfg(not(feature = "jpeg"))]
154pub const JPEG_LOSSLESS_NON_HIERARCHICAL: Ts = create_ts_stub(
155 "1.2.840.10008.1.2.4.57",
156 "JPEG Lossless, Non-Hierarchical (Process 14)",
157);
158
159#[cfg(feature = "jpeg")]
163pub const JPEG_LOSSLESS_NON_HIERARCHICAL_FIRST_ORDER_PREDICTION: JpegTs = create_ts_jpeg(
164 "1.2.840.10008.1.2.4.70",
165 "JPEG Lossless, Non-Hierarchical, First-Order Prediction",
166 false,
167);
168#[cfg(not(feature = "jpeg"))]
175pub const JPEG_LOSSLESS_NON_HIERARCHICAL_FIRST_ORDER_PREDICTION: Ts = create_ts_stub(
176 "1.2.840.10008.1.2.4.70",
177 "JPEG Lossless, Non-Hierarchical, First-Order Prediction",
178);
179
180pub const DEFLATED_EXPLICIT_VR_LITTLE_ENDIAN: Ts = Ts::new_ele(
184 "1.2.840.10008.1.2.1.99",
185 "Deflated Explicit VR Little Endian",
186 Codec::Dataset(None),
187);
188
189pub const JPIP_REFERENCED_DEFLATE: Ts = Ts::new_ele(
191 "1.2.840.10008.1.2.4.95",
192 "JPIP Referenced Deflate",
193 Codec::Dataset(None),
194);
195
196#[cfg(any(feature = "openjp2", feature = "openjpeg-sys"))]
202type Jpeg2000Ts<R = Jpeg2000Adapter, W = NeverPixelAdapter> = TransferSyntax<NeverAdapter, R, W>;
203
204#[cfg(any(feature = "openjp2", feature = "openjpeg-sys"))]
206const fn create_ts_jpeg2k(uid: &'static str, name: &'static str) -> Jpeg2000Ts {
207 TransferSyntax::new_ele(
208 uid,
209 name,
210 Codec::EncapsulatedPixelData(Some(Jpeg2000Adapter), None),
211 )
212}
213
214#[cfg(any(feature = "openjp2", feature = "openjpeg-sys"))]
216pub const JPEG_2000_IMAGE_COMPRESSION_LOSSLESS_ONLY: Jpeg2000Ts = create_ts_jpeg2k(
217 "1.2.840.10008.1.2.4.90",
218 "JPEG 2000 Image Compression (Lossless Only)",
219);
220#[cfg(not(any(feature = "openjp2", feature = "openjpeg-sys")))]
222pub const JPEG_2000_IMAGE_COMPRESSION_LOSSLESS_ONLY: Ts = create_ts_stub(
223 "1.2.840.10008.1.2.4.90",
224 "JPEG 2000 Image Compression (Lossless Only)",
225);
226
227#[cfg(any(feature = "openjp2", feature = "openjpeg-sys"))]
229pub const JPEG_2000_IMAGE_COMPRESSION: Jpeg2000Ts =
230 create_ts_jpeg2k("1.2.840.10008.1.2.4.91", "JPEG 2000 Image Compression");
231#[cfg(not(any(feature = "openjp2", feature = "openjpeg-sys")))]
233pub const JPEG_2000_IMAGE_COMPRESSION: Ts =
234 create_ts_stub("1.2.840.10008.1.2.4.91", "JPEG 2000 Image Compression");
235
236#[cfg(any(feature = "openjp2", feature = "openjpeg-sys"))]
238pub const JPEG_2000_PART2_MULTI_COMPONENT_IMAGE_COMPRESSION_LOSSLESS_ONLY: Jpeg2000Ts =
239 create_ts_jpeg2k(
240 "1.2.840.10008.1.2.4.92",
241 "JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)",
242 );
243#[cfg(not(any(feature = "openjp2", feature = "openjpeg-sys")))]
245pub const JPEG_2000_PART2_MULTI_COMPONENT_IMAGE_COMPRESSION_LOSSLESS_ONLY: Ts = create_ts_stub(
246 "1.2.840.10008.1.2.4.92",
247 "JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)",
248);
249
250#[cfg(any(feature = "openjp2", feature = "openjpeg-sys"))]
252pub const JPEG_2000_PART2_MULTI_COMPONENT_IMAGE_COMPRESSION: Jpeg2000Ts = create_ts_jpeg2k(
253 "1.2.840.10008.1.2.4.93",
254 "JPEG 2000 Part 2 Multi-component Image Compression",
255);
256#[cfg(not(any(feature = "openjp2", feature = "openjpeg-sys")))]
258pub const JPEG_2000_PART2_MULTI_COMPONENT_IMAGE_COMPRESSION: Ts = create_ts_stub(
259 "1.2.840.10008.1.2.4.93",
260 "JPEG 2000 Part 2 Multi-component Image Compression",
261);
262
263pub const JPEG_LS_LOSSLESS_IMAGE_COMPRESSION: Ts = create_ts_stub(
267 "1.2.840.10008.1.2.4.80",
268 "JPEG-LS Lossless Image Compression",
269);
270pub const JPEG_LS_LOSSY_IMAGE_COMPRESSION: Ts = create_ts_stub(
272 "1.2.840.10008.1.2.4.81",
273 "JPEG-LS Lossy (Near-Lossless) Image Compression",
274);
275
276pub const JPIP_REFERENCED: Ts = create_ts_stub("1.2.840.10008.1.2.4.94", "JPIP Referenced");
278
279pub const MPEG2_MAIN_PROFILE_MAIN_LEVEL: Ts =
281 create_ts_stub("1.2.840.10008.1.2.4.100", "MPEG2 Main Profile / Main Level");
282pub const FRAGMENTABLE_MPEG2_MAIN_PROFILE_MAIN_LEVEL: Ts = create_ts_stub(
284 "1.2.840.10008.1.2.4.100.1",
285 "Fragmentable MPEG2 Main Profile / Main Level",
286);
287pub const MPEG2_MAIN_PROFILE_HIGH_LEVEL: Ts =
289 create_ts_stub("1.2.840.10008.1.2.4.101", "MPEG2 Main Profile / High Level");
290pub const FRAGMENTABLE_MPEG2_MAIN_PROFILE_HIGH_LEVEL: Ts = create_ts_stub(
292 "1.2.840.10008.1.2.4.101.1",
293 "Fragmentable MPEG2 Main Profile / High Level",
294);
295pub const MPEG4_AVC_H264_HIGH_PROFILE: Ts = create_ts_stub(
297 "1.2.840.10008.1.2.4.102",
298 "MPEG-4 AVC/H.264 High Profile / Level 4.1",
299);
300pub const FRAGMENTABLE_MPEG4_AVC_H264_HIGH_PROFILE: Ts = create_ts_stub(
302 "1.2.840.10008.1.2.4.102.1",
303 "Fragmentable MPEG-4 AVC/H.264 High Profile / Level 4.1",
304);
305pub const MPEG4_AVC_H264_BD_COMPATIBLE_HIGH_PROFILE: Ts = create_ts_stub(
307 "1.2.840.10008.1.2.4.103",
308 "MPEG-4 AVC/H.264 BD-Compatible High Profile / Level 4.1",
309);
310pub const FRAGMENTABLE_MPEG4_AVC_H264_BD_COMPATIBLE_HIGH_PROFILE: Ts = create_ts_stub(
312 "1.2.840.10008.1.2.4.103.1",
313 "Fragmentable MPEG-4 AVC/H.264 BD-Compatible High Profile / Level 4.1",
314);
315pub const MPEG4_AVC_H264_HIGH_PROFILE_FOR_2D_VIDEO: Ts = create_ts_stub(
317 "1.2.840.10008.1.2.4.104",
318 "MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video",
319);
320pub const FRAGMENTABLE_MPEG4_AVC_H264_HIGH_PROFILE_FOR_2D_VIDEO: Ts = create_ts_stub(
322 "1.2.840.10008.1.2.4.104.1",
323 "Fragmentable MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video",
324);
325pub const MPEG4_AVC_H264_HIGH_PROFILE_FOR_3D_VIDEO: Ts = create_ts_stub(
327 "1.2.840.10008.1.2.4.105",
328 "MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video",
329);
330pub const FRAGMENTABLE_MPEG4_AVC_H264_HIGH_PROFILE_FOR_3D_VIDEO: Ts = create_ts_stub(
332 "1.2.840.10008.1.2.4.105.1",
333 "Fragmentable MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video",
334);
335pub const MPEG4_AVC_H264_STEREO_HIGH_PROFILE: Ts = create_ts_stub(
337 "1.2.840.10008.1.2.4.106",
338 "MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2",
339);
340pub const FRAGMENTABLE_MPEG4_AVC_H264_STEREO_HIGH_PROFILE: Ts = create_ts_stub(
342 "1.2.840.10008.1.2.4.106.1",
343 "Fragmentable MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2",
344);
345pub const HEVC_H265_MAIN_PROFILE: Ts = create_ts_stub(
347 "1.2.840.10008.1.2.4.107",
348 "HEVC/H.265 Main Profile / Level 5.1",
349);
350pub const HEVC_H265_MAIN_10_PROFILE: Ts = create_ts_stub(
352 "1.2.840.10008.1.2.4.108",
353 "HEVC/H.265 Main 10 Profile / Level 5.1",
354);
355pub const SMPTE_ST_2110_20_UNCOMPRESSED_PROGRESSIVE: Ts = create_ts_stub(
357 "1.2.840.10008.1.2.7.1",
358 "SMPTE ST 2110-20 Uncompressed Progressive Active Video",
359);
360pub const SMPTE_ST_2110_20_UNCOMPRESSED_INTERLACED: Ts = create_ts_stub(
362 "1.2.840.10008.1.2.7.2",
363 "SMPTE ST 2110-20 Uncompressed Interlaced Active Video",
364);
365pub const SMPTE_ST_2110_30_PCM: Ts = create_ts_stub(
367 "1.2.840.10008.1.2.7.3",
368 "SMPTE ST 2110-30 PCM Digital Audio",
369);