#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

#1590 in Parser implementations

Download history 17/week @ 2024-07-19 26/week @ 2024-07-26 21/week @ 2024-08-02 15/week @ 2024-08-09 6/week @ 2024-08-16 17/week @ 2024-08-23 21/week @ 2024-08-30 11/week @ 2024-09-06 7/week @ 2024-09-13 14/week @ 2024-09-20 18/week @ 2024-09-27 7/week @ 2024-10-04 13/week @ 2024-10-11 26/week @ 2024-10-18 7/week @ 2024-10-25 24/week @ 2024-11-01

70 downloads per month
Used in 4 crates

Custom license

44KB
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.


lib.rs:

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

Dependencies

~7–17MB
~245K SLoC