MCPcopy Index your code
hub / github.com/Enet4/dicom-rs

github.com/Enet4/dicom-rs @v0.10.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.0 ↗ · + Follow
2,180 symbols 7,493 edges 141 files 734 documented · 34%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DICOM-rs

DICOM-rs on crates.io continuous integration Minimum Rust Version Stable dependency status DICOM-rs chat Documentation

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.

Components

Library

The following library packages are designed to be used in other Rust libraries and applications.

  • object provides a high-level abstraction of DICOM objects and functions for reading and writing DICOM files.
  • pixeldata enables the decoding and conversion of DICOM objects into usable imaging data structures, such as images and multidimensional arrays.
  • dump provides helpful routines for dumping the contents of DICOM objects.
  • json provides serialization and deserialization to DICOM JSON.
  • ul implements the DICOM upper layer protocol.
  • dictionary-std contains a Rust definition of the standard data dictionary.
  • transfer-syntax-registry contains a registry of transfer syntax specifications.
  • parser provides a middle-level abstraction for the parsing and printing of DICOM data sets.
  • encoding contains DICOM data encoding and decoding primitives.
  • core represents all of the base traits, data structures and functions related to DICOM content.

Using as a library

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()?;

Tools

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.
  • 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 file with one from an image file.
  • pixeldata also includes dicom-transcode, which lets you transcode DICOM files to other transfer syntaxes.

Development tools

  • dictionary-builder is an independent application that generates code and other data structures for a DICOM standard dictionary.

Building

You 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.

Minimum Supported Rust version

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.85.0.
  • For any other cases, namely building the tool/binary crates or including extra features, only the latest stable toolchain is guaranteed to build.

As of 2026-03-28, version 1.88.0 can build the full project, though this is not prescriptive and is subject to change over time. Prefer using the latest stable toolchain whenever possible.

Roadmap & Contributing

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.

License

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.

Extension points exported contracts — how you extend this code

PixelDataReader (Interface)
Trait object responsible for decoding pixel data based on the transfer syntax. A transfer syntax with support for decod [12 …
encoding/src/adapters.rs
IntoTokens (Interface)
A trait for converting structured DICOM data into a stream of data tokens. [10 implementers]
parser/src/dataset/mod.rs
HasLength (Interface)
Trait for any DICOM entity (element or item) which may have a length. [18 implementers]
core/src/header.rs
DicomObject (Interface)
Trait type for a generalized interpretation of a DICOM object. This is a high-level abstraction where an object is acce [5 …
object/src/lib.rs
Association (Interface)
Trait that represents common properties of an association [4 implementers]
ul/src/association/mod.rs
PixelDecoder (Interface)
Trait for objects which can be decoded into blobs of easily consumable pixel data. This is the main trait which extends [2 …
pixeldata/src/lib.rs
PixelDataWriter (Interface)
Trait object responsible for encoding pixel data based on a certain transfer syntax. A transfer syntax with support for [10 …
encoding/src/adapters.rs
StatefulDecode (Interface)
(no doc) [2 implementers]
parser/src/stateful/decode.rs

Core symbols most depended-on inside this repo

to_string
called by 280
core/src/header.rs
len
called by 213
core/src/value/fragments.rs
default
called by 194
transfer-syntax-registry/src/lib.rs
into_iter
called by 147
core/src/ops.rs
value_type
called by 139
core/src/value/primitive.rs
write_all
called by 125
object/src/lib.rs
iter
called by 123
core/src/ops.rs
as_ref
called by 107
pixeldata/src/attribute.rs

Shape

Method 1,152
Function 687
Class 180
Enum 122
Interface 39

Languages

Rust100%

Modules by API surface

object/src/mem.rs139 symbols
pixeldata/src/lib.rs89 symbols
core/src/value/primitive.rs80 symbols
core/src/header.rs80 symbols
object/src/lib.rs66 symbols
ul/src/association/server.rs63 symbols
ul/src/association/client.rs62 symbols
core/src/value/mod.rs60 symbols
object/src/meta.rs58 symbols
core/src/value/partial.rs58 symbols
parser/src/stateful/decode.rs53 symbols
object/src/collector.rs46 symbols

For agents

$ claude mcp add dicom-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page