Rust implementation of the DICOM standard
APACHE-2.0 License
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.
object
provides a high-level abstraction of DICOM objectspixeldata
enables the decoding and conversion of DICOM objectsdump
provides helpful routines forjson
provides serialization and deserialization to DICOM JSON.ul
implements the DICOM upper layer protocol.dictionary-std
contains a Rust definition oftransfer-syntax-registry
contains a registry ofparser
provides a middle-level abstractionencoding
contains DICOM data encoding and decoding primitives.core
represents all of the base traits,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,scpproxy
implements a Proxy service class provider.echoscu
implements a Verification service class user.findscu
implements a Find service class user.storescu
implements a Storage service class user.storescp
implements a Storage service class provider.toimage
lets you convert a DICOM file into an image file.fromimage
lets you replace the imaging data of a DICOM filepixeldata
also includes dicom-transcode
,dictionary-builder
is an independent application thatYou can use Cargo to build all crates in the repository.
cargo build
Other 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.
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
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.