Skip to main content

Introduction

In this work, we developed a robust, easily extensible classification framework that extracts key features from well-characterized DICOM header fields for identifying image modality and acquisition plane. Our tool is crucial for eliminating error-prone human interaction and allowing automatization, increasing imaging applications' reliability and efficiency. We used Random Forrest and Decision Tree algorithms to determine the image modality and orientation. We trained on header meta-data of over 49000 scan volumes from multiple studies and achieved over 99% prediction accuracy on image modality and acquisition plane classification.

This project was supported by several funding sources including:

  • UCSF SCOUTS RO1
  • NIH-NINDS R01NS114405 and NINDS R01 NS119896
  • Botimageai.

Paper

Click here to view the published paper.

Citing

Please reference the manuscript:

Michal Brzus, Cavan J. Riley, Joel Bruss, Aaron Boes, Randall Jones, Hans J. Johnson, "DICOM sequence selection for medical imaging applications," Proc. SPIE 12931, Medical Imaging 2024: Imaging Informatics for Healthcare, Research, and Applications, 1293108 (2 April 2024); https://doi.org/10.1117/12.3006568

Additionally, please reference the citations located in the citations directory

Instructions

Below are instructions for installing and using the package as a user and developer.

Documentation

The documentation for the package can be found here

Tutorials

Tutorial notebooks are provided in the scripts directory for training and using the classifier along with all the necessary scripts for training a custom model.

User Instructions

Pip install

Users have the ability to simply pip install the package which will install the classifier and all necessary dependencies to run the classifier for ease of use. This will also provide the user with the pretrained model for classification.

$ pip install dcm-classifier

Clone the repository

If you prefer to clone the git repository:

$ git clone https://github.com/BRAINSia/dcm-classifier.git

Navigate to the cloned repo

$ cd <repo path>

Setup virtual environment

$ python3 -m venv <venv_path> && source <venv_path>/bin/activate

Install required packages

$ pip install -r requirements.txt

Developer Instructions

For development, clone the repository and install the developer requirements in a virtual environment. Development allows for training of new models using the scripts directory.

$ pip install -r requirements_dev.txt

Install pre-commit hooks

$ pre-commit install

Run pre-commit hooks to ensure code quality

$ pre-commit run -a

Run the classify study script, the path to a model can be omitted and the default model provided in the package will be used.

$ python3 <path_to_scripts_directory>/classify_study.py -d <path_to_dicom_session>

or pass the path to a separate model

$ python3 <path_to_scripts_directory>/classify_study.py -m models/ova_rf_classifier.onnx -d <path_to_dicom_session>

Testing

Testing in the dcm-classifier package is done using pytest. To run the tests, navigate to the root directory of the package

The testing data is stored in Git LFS so the following commands will be needed before running pytest

  git lfs fetch
  git lfs checkout

and now

  pytest
  # or to fail on warnings
  python3 -Werror::FutureWarning -m pytest

Coverage Analysis

To run coverage analysis, navigate to the root directory of the package and run the following commands:

 coverage run --concurrency=multiprocessing --parallel-mode -m pytest tests --junitxml=tests/pytest.xml
 coverage combine
 coverage report --format=text -m |tee tests/pytest-coverage.txt
 coverage xml -o tests/coverage.xml
 coverage xml -o tests/coverage.xml

Contributing

We welcome contributions from the community! Before getting started, please take a moment to review our Contribution Guidelines for instructions on how to contribute to this project. Whether you're fixing a bug, implementing a new feature, or improving documentation, your contributions are greatly appreciated!

FAQs

  1. What is the purpose of this package?

    The purpose of this package is to provide a tool for classifying DICOM images based on their header information. This tool can be used to automate the classification process and eliminate human error.

  2. What are the key features of this package?

    The key features of this package include:

    • Classification of DICOM images based on header information
    • Automated classification process
    • Elimination of human error
  3. What are the future plans for this package and how can I contribute?

    The future plans for this package include:

    • Adding support for more image modalities
    • Improving the classification accuracy
    • Adding support for more DICOM header fields

Authors

  1. Michal Brzus

    github: mbrzus, email: michal-brzus@uiowa.edu

  2. Hans J. Johnson

    github: BRAINSia, email: hans-johnson@uiowa.edu

  3. Cavan Riley

    github: CavRiley, email: cavan-riley@uiowa.edu

Metadata

Release files for dcm-classifier 0.9.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dcm-classifier 0.9.9
File Size Uploaded Provenance Actions
dcm_classifier-0.9.9.tar.gz 2.4 MB Without provenance Details for dcm_classifier-0.9.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dcm-classifier 0.9.9
File Interpreter ABI Platform Actions
dcm_classifier-0.9.9-py3-none-any.whl Python 3 none any Details for dcm_classifier-0.9.9-py3-none-any.whl

Total release size: 2.5 MB

Release files / dcm_classifier-0.9.9.tar.gz

Download URL dcm_classifier-0.9.9.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
7a18e352e48562996dd540bc8bc8cd07a7a878e64100a81b5b4b96d6e31668f3
BLAKE2b-256 checksum
How to use checksums
fd0d9435ad0cf15ca50deee062e2c0c3126effe04e50160535201e57aac51b6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / dcm_classifier-0.9.9-py3-none-any.whl

Download URL dcm_classifier-0.9.9-py3-none-any.whl
Size 78.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b35b72366f3ba7e56e1de6bfbb48e358235a9b71689d4074c430ffb3e89ea74
BLAKE2b-256 checksum
How to use checksums
5397a41671859d3fc75538a9c4c77ada611dbd22906f8b9ac982bc7637bb8520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Security for dcm-classifier 0.9.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.9 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page