Skip to main content

Crate dcmnorm_transcode

Crate dcmnorm_transcode 

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 this crate. 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.

All registered TSes are 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
Deflated Explicit VR Little EndianCargo feature deflate✓
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-LS Losslessnot supported here; see src/dicom_io/jpeg_ls.rs-
JPEG-LS Lossy (Near-Lossless)not supported here; see src/dicom_io/jpeg_ls.rs-
JPEG 2000 (Lossless Only)Cargo feature jpeg2000 (OpenJPEG)x
JPEG 2000Cargo feature jpeg2000 (OpenJPEG)x
JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)Cargo feature jpeg2000 (OpenJPEG)x
JPEG 2000 Part 2 Multi-component Image CompressionCargo feature jpeg2000 (OpenJPEG)x
JPIP Referenced DeflateCargo feature deflate✓
High-Throughput JPEG 2000 (Lossless Only)Cargo feature jpeg2000 (OpenHTJ2K)x (dcmnorm encodes it directly)
High-Throughput JPEG 2000 with RPCL Options (Lossless Only)Cargo feature jpeg2000 (OpenHTJ2K)x
High-Throughput JPEG 2000Cargo feature jpeg2000 (OpenHTJ2K)x (dcmnorm encodes it directly)
JPIP HTJ2K Referenced DeflateCargo feature deflate✓
JPEG XL (Lossless/Recompression/general)Cargo feature jpeg-xl-codec on the top-level dcmnorm crate; see src/dicom_io/jpeg_xl.rsx
RLE LosslessCargo feature rlex
Deflated Image FrameCargo feature deflate✓

Cargo features behind native (jpeg, rle, deflate) provide implementations that are written in pure Rust (JPEG decoding via the in-house dcmnorm-jpeg, encoding via jpeg-encoder) and are likely available on all supported platforms without issues. Additional codecs are opt-in by enabling Cargo features, for scenarios where a native implementation is not available, or alternative implementations are available.

  • jpeg2000 provides JPEG 2000 decoding through the dcmnorm-jpeg2000 crate: OpenJPEG (C, statically linked) for classic JPEG 2000 and the vendored OpenHTJ2K (C++) for High-Throughput JPEG 2000. Neither can be used in WebAssembly.

JPEG-LS and JPEG XL are not supported via this registry - see entries.rs for the reasoning. 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.

Modules§

entries
A list of compiled transfer syntax specifiers.

Structs§

TransferSyntax
A DICOM transfer syntax specifier.
TransferSyntaxRegistry
Zero-sized representative of the main transfer syntax registry.
TransferSyntaxRegistryImpl
Main implementation of a registry of DICOM transfer syntaxes.

Traits§

TransferSyntaxIndex
Trait for a container/repository of transfer syntax specifiers.

Functions§

default
Retrieve the default transfer syntax.