Skip to main content

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

dicom4ortho 0.5.3

A Python library to create fully defined orthodontic photographs in DICOM.
Explore the docs »

View Demo · Report Bug · Request Feature

Introduction

The orthodontic provider takes different types of photographs of patients, each of which needs to be properly described and distinguished using proper DICOM attributes. The dental community publised standarad ADA-1114 which defines the requirements for dental images to be in DICOM, which refers to ADA-1100 for orthodntic images: it defines 73 different possible types of photographs most commonly used, each of which with a linedrawing as example. DICOM CP 1570 was published to add the necessary codes and attributes in order to fulfill the requirements defined in ADA-1100. The views specified in ADA-1100 have been published as their own codes set in https://terminology.open-ortho.org/; these have been used to add equivalent codes to SNOMED; https://terminology.open-ortho.org/ also contains a mapping between the ADA-1100 codes and the official SNOMED-CT codes.

dicom4ortho is a library to automatically generate DICOM IODs that fulfill the requirements of ADA1100, using the additions of CP1570 where necessary. with all anatomic and clinical attributes pre-populated, based on the image type. It is intended to be used by software developers which need to generate valid DICOM IODs, without having to go through the DICOM standard to figure out how to do it. It is a library to:

  • return a full valid DICOM IOD taking an image, patient demographics and an image type as input;
  • return a DICOM IOD stub taking an image type as input;
  • return an image type taking a DICOM IOD as input;

About The Project

The DICOM standard is ready for any developer in the orthodontic community to implement. However, it can be complicated and implementation can be time consuming. We want to create a proof of concept to demonstrate how to properly store orthodontic visible light images (aka photographs) using DICOM, while ensuring all codes (necessary to uniquely identify each image type) are in the proper place.

Here's why:

  • Your time should be focused on creating something amazing.
  • Being able to import and export DICOM images to and from your orthodontic software will open doors to you and the orthodontic provider.
  • No one software will serve all orthodontic providers completely. Adding interoperability will allow your product to integrate with others, giving additional value to your solution.

You may suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have have contributed to this project!

A list of commonly used resources that we find helpful are listed in the acknowledgements.

Built With

Getting Started

Like any other Python module, install the module and use it. There is a CLI interface as well.

Prerequisites

  • An installation of Python 3.10+.
  • optional: dicom3tools

Installation

Install using pip by running:

$ pip install dicom4ortho

If you're a developer working on the project, you can install with dev dependencies:

$ pip install dicom4ortho[dev]

The project uses pyproject.toml for package configuration and build settings.

Creating a Virtual Environment

It's recommended to use a virtual environment for development:

$ python -m venv venv
$ source venv/bin/activate  # On Windows use: venv\Scripts\activate

# Install the package in development mode
$ pip install -e .

# To install with development dependencies
$ pip install -e ".[dev]"

Building from source

To build the package from source:

$ python -m build

This will create distribution packages in the dist/ directory.

Running Tests

To run all tests in the project:

$ pytest

To run tests with coverage report:

$ pytest --cov=dicom4ortho tests/

To run a specific test file:

$ pytest test/test_cli.py

All tests are located in the test/ directory and can be executed after installing the development dependencies.

Docker for Integration Tests

Some tests require Docker to run integration tests with an Orthanc DICOM server. A docker-compose file is provided in the test/ directory.

If you're not using the Makefile, you can manually manage the Docker containers:

$ docker compose -f ./test/docker-compose.yml up -d
$ # Run your tests...
$ docker compose -f ./test/docker-compose.yml down

Make sure Docker is installed and running before executing integration tests.

Using the Makefile

The project includes a Makefile that simplifies common development tasks:

$ make test              # Run all tests (automatically handles Docker)
$ make clean             # Clean build artifacts
$ make build             # Build the package (includes linting and testing)
$ make lint              # Run linter on the code
$ make all               # Clean and build
$ make install-dev       # Install development tools including dicom3tools
$ make update_resources  # Update resource files from source
$ make deploy            # Deploy to PyPI

The Makefile handles Docker for you when running tests. It starts the required Docker containers before running tests and shuts them down afterward.

Validation with dicom3tools

The dicom3tools are used to validate and is only used when the --validate option is used. This is just a conveninece wrapper for debugging, and it's installation is not necessary for normal operation.

The dicom3tools can be installed from compiled binaries, which are available for macOS and Windows.

Once installed, point DICOM3TOOLS_PATH in config.py to the installation of the dicom3tools.

Usage

The official documentation of this project is available on line here. Source code for the documentation is in this repository under the gh-pages branch.

The DICOM images require a lot of information which is not contained in a flat PNG or JPEG image. This information would, in a production environment, usually come from the practice management software, or photo management software.

The easiest way to feed this information to dicom4ortho's CLI is using a CSV file. You can find an executable example CSV file here.

Once installed, if necessary, start the virtual environment:

pipenv shell

then use dicom4ortho like this:

$ dicom4ortho <filename>

Where filename should be a .csv file. Passing a single image file with metadata through arguments is planned for future implementations.

Practice personnel

Use dental_provider_firstname and dental_provider_lastname for the orthodontist or dentist responsible for treatment. They are encoded as DICOM PhysiciansOfRecord. Use operator_firstname and operator_lastname for the clinical staff member who acquired the photographs; they are encoded as DICOM OperatorsName.

An actual referring physician is copied from ReferringPhysicianName in a Modality Worklist. The requesting physician remains part of the worklist order and is linked through the request identifiers rather than copied into the baseline VL Photographic Image IOD.

generate a new UID for DICOM usage with this root:

$ d4o_generate

Known Issues

Please check the Implementation Status document.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Toni Magni- @zgypa - open-ortho@afm.co

Project Link: https://github.com/open-ortho/dicom4ortho

Acknowledgements

Release files for dicom4ortho 0.5.3

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

Source distribution (sdist)

Source distribution for dicom4ortho 0.5.3
File Size Uploaded
dicom4ortho-0.5.3.tar.gz 72.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dicom4ortho 0.5.3
File Interpreter ABI Platform
dicom4ortho-0.5.3-py3-none-any.whl Python 3 none any Details

Total release size: 128.1 kB

Release files / dicom4ortho-0.5.3.tar.gz

Download URL dicom4ortho-0.5.3.tar.gz
Size 72.4 kB
Tags Source
SHA-256 checksum
How to use checksums
71a1191f557ad252cbd915be55eeebef68fb0e5c19db61ea2a0761e7a8cd8c20
BLAKE2b-256 checksum
How to use checksums
7f2f9e91231b99cc0c56e1a7613947ffd61b3c7de2ea980405586ee70c643581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / dicom4ortho-0.5.3-py3-none-any.whl

Download URL dicom4ortho-0.5.3-py3-none-any.whl
Size 55.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
417862156cae88c6a60c1612269efc1900c9763e433062f74afe72a16e017070
BLAKE2b-256 checksum
How to use checksums
8c1f2963577108caa2bb39dc08cc2d6b923b01545fc4d1541e66c4aaa96c6663
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

This release

0.5.3 This release

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

1 release file

0.2.1

1 release file

0.1.1

1 release file

0.0.1

1 release file

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