16 unstable releases (6 breaking)

new 0.7.0 Apr 25, 2024
0.6.3 Nov 21, 2023
0.6.2 Oct 31, 2023
0.6.0 Jul 23, 2023
0.1.0 Aug 31, 2019

#82 in Images

Download history 283/week @ 2024-01-02 565/week @ 2024-01-09 360/week @ 2024-01-16 698/week @ 2024-01-23 512/week @ 2024-01-30 486/week @ 2024-02-06 512/week @ 2024-02-13 694/week @ 2024-02-20 511/week @ 2024-02-27 818/week @ 2024-03-05 796/week @ 2024-03-12 532/week @ 2024-03-19 257/week @ 2024-03-26 359/week @ 2024-04-02 288/week @ 2024-04-09 655/week @ 2024-04-16

1,601 downloads per month
Used in 7 crates (6 directly)

MIT/Apache

2.5MB
44K SLoC

DICOM-rs

CratesIO Documentation

dicom is a library for the DICOM standard. It is part of the DICOM-rs project, an ecosystem of modules and tools for DICOM compliant systems.

This collection provides a pure Rust implementation of the DICOM standard, allowing users to read and write DICOM data over files and other sources, while remaining intrinsically efficient, fast, intuitive, and safe to use.

Using as a library

This crate exposes the dicom-object crate directly via the object module, which has a high-level API for reading, writing, and manipulating DICOM objects. Other key components of the full library are available in this one as well, albeit representing different levels of abstraction.

An example of use follows. For more details, please visit the dicom-object documentation or the full library documentation.

use dicom::core::Tag;
use dicom::object::{open_file, Result};

let obj = open_file("0001.dcm")?;
let patient_name = obj.element_by_name("PatientName")?.to_str()?;
let modality = obj.element_by_name("Modality")?.to_str()?;
let pixel_data_bytes = obj.element(Tag(0x7FE0, 0x0010))?.to_bytes()?;

Cargo features

This crate enables the inventory-based transfer syntax registry by default, which allows for a seamless integration of additional transfer syntaxes without changing the application. In environments which do not support this, the feature can be disabled. Please see the documentation of dicom-transfer-syntax-registry for more information.

The following root modules are behind Cargo features enabled by default:

  • ul: the DICOM upper layer protocol library
  • pixeldata: the pixel data abstraction library. The Cargo features image, ndarray are re-exported from dicom-pixeldata and may be enabled at will through the parent crate.

If you do not intend to use these modules, you can disable these features accordingly.

Dependencies

~6–20MB
~228K SLoC