Crate dicom_transfer_syntax_registry

source ·
Expand description

This crate contains the DICOM transfer syntax registry.

The transfer syntax registry maps a DICOM UID of a transfer syntax (TS) into the respective transfer syntax specifier. This specifier defines:

  1. how to read and write DICOM data sets;
  2. how to decode and encode pixel data.

Support may be partial, in which case the data set can be retrieved but the pixel data may not be decoded through the DICOM-rs ecosystem. By default, adapters for encapsulated pixel data need to be explicitly added by dependent projects, such as dicom-pixeldata. When adding dicom-transfer-syntax-registry yourself, to include support for some transfer syntaxes with encapsulated pixel data, add the native Cargo feature or one of the other image encoding features available.

By default, a fixed known set of transfer syntaxes are provided as built in. Moreover, support for more TSes can be extended by other crates through the inventory pattern, in which the registry is automatically populated before main. This is done by enabling the Cargo feature inventory-registry. The feature can be left disabled for environments which do not support inventory, with the downside of only providing the built-in transfer syntaxes.

All registered TSes will be readily available through the TransferSyntaxRegistry type.

This registry is intended to be used in the development of higher level APIs, which should learn to negotiate and resolve the expected transfer syntax automatically.

§Transfer Syntaxes

This crate encompasses basic DICOM level of conformance, plus support for some transfer syntaxes with compressed pixel data. Implicit VR Little Endian, Explicit VR Little Endian, and Explicit VR Big Endian are fully supported. Support may vary for transfer syntaxes which rely on encapsulated pixel data.

transfer syntaxdecoding supportencoding support
JPEG Baseline (Process 1)Cargo feature jpeg
JPEG Extended (Process 2 & 4)Cargo feature jpegx
JPEG Lossless, Non-Hierarchical (Process 14)Cargo feature jpegx
JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])Cargo feature jpegx
JPEG 2000 (Lossless Only)Cargo feature openjp2 or openjpeg-sysx
JPEG 2000Cargo feature openjp2 or openjpeg-sysx
JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)Cargo feature openjp2 or openjpeg-sysx
JPEG 2000 Part 2 Multi-component Image CompressionCargo feature openjp2 or openjpeg-sysx
RLE LosslessCargo feature rlex

Cargo features behind native (jpeg, rle) provide implementations that are written in pure Rust and are likely available in all supported platforms. However, a native implementation might not always be available, or alternative implementations may be preferred:

  • openjpeg-sys provides a binding to the OpenJPEG reference implementation, which is written in C and is statically linked. It may offer better performance than the pure Rust implementation, but cannot be used in WebAssembly. Include openjpeg-sys-threads to build OpenJPEG with multithreading.
  • openjp2 provides a binding to a computer-translated Rust port of OpenJPEG. Due to the nature of this crate, it does not work on all supported platforms.

Transfer syntaxes which are not supported, either due to being unable to read the data set or decode encapsulated pixel data, are listed as stubs for partial support. The full list is available in the entries module. These stubs may also be replaced by separate libraries if using the inventory-based registry.

Modules§

  • A list of compiled transfer syntax specifiers.

Structs§

Functions§

  • Retrieve the default transfer syntax.