#dicom #medical #dataset #file-path #image

dev dicom-test-files

A collection of DICOM files for testing DICOM parsers

6 releases

0.3.0 Mar 1, 2024
0.2.1 Jul 13, 2022
0.2.0 May 31, 2020
0.1.2 May 30, 2020

#720 in Parser implementations

Download history 31/week @ 2024-03-11 26/week @ 2024-03-18 21/week @ 2024-03-25 76/week @ 2024-04-01 29/week @ 2024-04-08 13/week @ 2024-04-15 21/week @ 2024-04-22 4/week @ 2024-04-29 7/week @ 2024-05-06 10/week @ 2024-05-13 23/week @ 2024-05-20 35/week @ 2024-05-27 22/week @ 2024-06-03 8/week @ 2024-06-10 10/week @ 2024-06-17 26/week @ 2024-06-24

75 downloads per month
Used in 4 crates

Custom license

486 lines

DICOM Test Files

dicom-test-files on crates.io

This repository collects together example DICOM files from various sources. The intention is that they can be used for testing across many different libraries.

See the documentation for instructions of use.

Known limitations

The Rust functions cannot be used from doc-tests as they are not executed from within the target directory.


A collection of DICOM files for testing DICOM parsers.

To avoid users having to download all the files they are downloaded as they are needed and cached in the /target directory.

The path function will automatically download the requested file and return a file path.

use dicom_test_files::path;

let liver = path("pydicom/liver.dcm")?;
// then open the file as you will (e.g. using DICOM-rs)
let dicom_data = dicom::object::open(liver);

Source of data

By default, all data sets are hosted in the dicom-test-files project's main repository, in the data folder. Inspect this folder to know what DICOM test files are available.

To override this source, you can set the environment variable DICOM_TEST_FILES_URL to the base path of the data set's raw contents (usually ending with data or data/).

set DICOM_TEST_FILES_URL=https://raw.githubusercontent.com/Me/dicom-test-files/new/more-dicom/data
cargo test


~231K SLoC