An ecosystem of library and tools for DICOM compliant systems.
This collection provides a pure Rust implementation of the DICOM standard, allowing users to work with DICOM objects and interact with DICOM applications, while aiming to be fast, safe, and intuitive to use.
The following library packages are designed to be used in other Rust libraries and applications.
objectprovides a high-level abstraction of DICOM objects and functions for reading and writing DICOM files.pixeldataenables the decoding and conversion of DICOM objects into usable imaging data structures, such as images and multidimensional arrays.dumpprovides helpful routines for dumping the contents of DICOM objects.jsonprovides serialization and deserialization to DICOM JSON.ulimplements the DICOM upper layer protocol.dictionary-stdcontains a Rust definition of the standard data dictionary.transfer-syntax-registrycontains a registry of transfer syntax specifications.parserprovides a middle-level abstraction for the parsing and printing of DICOM data sets.encodingcontains DICOM data encoding and decoding primitives.corerepresents all of the base traits, data structures and functions related to DICOM content.
The parent crate dicom aggregates the key components of the full library,
so it can be added to a project as an alternative to
selectively grabbing the components that you need.
Generally, most projects would add dicom_object,
which is the most usable crate for reading DICOM objects from a file or a similar source.
This crate is available in dicom::object.
For working with the imaging data of a DICOM object,
add pixeldata.
Network capabilities may be constructed on top of ul.
A simple example of use follows.
For more details,
please visit the dicom documentation.
use dicom::object::open_file;
use dicom::dictionary_std::tags;
let obj = open_file("0001.dcm")?;
let patient_name = obj.element(tags::PATIENT_NAME)?.to_str()?;
let modality = obj.element(tags::MODALITY)?.to_str()?;The project also comprises an assortment of command line tools.
dump, aside from being a library, is also a command-line application for inspecting DICOM files.scpproxyimplements a Proxy service class provider.echoscuimplements a Verification service class user.findscuimplements a Find service class user.storescuimplements a Storage service class user.storescpimplements a Storage service class provider.toimagelets you convert a DICOM file into an image file.fromimagelets you replace the imaging data of a DICOM file with one from an image file.pixeldataalso includesdicom-transcode, which lets you transcode DICOM files to other transfer syntaxes.
dictionary-builderis an independent application that generates code and other data structures for a DICOM standard dictionary.
You can use Cargo to build all crates in the repository.
cargo buildOther than the parts needed to build a pure Rust project, no other development dependencies are necessary unless certain extensions are included via Cargo features. Consult each crate for guidelines on selecting features to suit your needs.
DICOM-rs currently provides partial MSRV guarantees, defined by the following rules:
- The minimum supported Rust version required to build library crates with default features is 1.72.0.
- For any other cases, namely building the tool/binary crates or including extra features, only the latest stable toolchain is guaranteed to build.
At of 2025-10-04, version 1.80.0 can build the full project, though this is not prescriptive and is subject to change over time.
This project is under active development.
Your feedback during the development of these solutions is welcome. Please see the wiki for additional guidelines related to the project's roadmap. See also the contributor guidelines and the project's Code of Conduct.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.