Crate dicom_test_files

source ·
Expand description

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

Enums§

  • Error type for test_dicom_files

Functions§

  • allDeprecated
    Return a vector of local paths to all DICOM test files available.
  • Fetch a DICOM file by its relative path (name) if it has not been downloaded yet, and return its path in the local file system.