|new 0.6.2||Nov 21, 2023|
|0.6.0||Jul 23, 2023|
|0.5.1||Oct 23, 2022|
|0.5.0||Apr 28, 2022|
|0.1.0||Aug 31, 2019|
#48 in Video
3,992 downloads per month
Used in 21 crates (9 directly)
This sub-project implements a registry of DICOM transfer syntaxes, which can be optionally extended.
An implementation based on
inventory can be used through the Cargo feature
inventory allows for users to register new transfer
syntax implementations in a compile time plugin-like fashion,
but not all environments support it (such as WebAssembly).
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:
- how to read and write DICOM data sets;
- 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,
to include support for some transfer syntaxes with encapsulated pixel data,
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
The feature can be left disabled
for environments which do not support
with the downside of only providing the built-in transfer syntaxes.
All registered TSes will be readily available
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.
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 syntax||decoding support||encoding support|
|JPEG Baseline (Process 1)||Cargo feature
|JPEG Extended (Process 2 & 4)||Cargo feature
|JPEG Lossless, Non-Hierarchical (Process 14)||Cargo feature
|JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])||Cargo feature
|JPEG 2000 (Lossless Only)||Cargo feature
|JPEG 2000||Cargo feature
|JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)||Cargo feature
|JPEG 2000 Part 2 Multi-component Image Compression||Cargo feature
|RLE Lossless||Cargo feature
Cargo features behind
provide implementations that are written in pure Rust,
and so they are easier to build and may be available in all platforms supported by Rust.
However, a native implementation might not always be available,
or alternative implementations may be preferred:
openjpeg-sysprovides 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-threadsto build OpenJPEG with multithreading.
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
These stubs may also be replaced by separate libraries
if using the inventory-based registry.