Skip to main content

Package for extracting data from DICOM RDSR files

Project description

RDSR Navigator

A package for extracting data from DICOM RDSR files. The focus of this project is to extract data. It is not possible to modify files. The project is currently in early development and things might not work exactly how you expect. The public api is not yet stable, so please do not use this for any critical projects.

Getting started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

RDSR Navigator is written in Python 3 and uses pydicom. Therefore make sure you are running Python 3 and make sure pydicom is installed. If pydicom is not installed, use the command below to install pydicom.

$ pip install pydicom

Installation

RDSR Navigator is available on pypi and can be installed using the following command.

$ pip install rdsr_navigator

Now, you are ready to start using RDSR navigator.

Usage

Read file

To open an RDSR file, type the following.

    >>> import rdsr_navigator as nav
    >>> rdsr_obj = nav.read_file('C:\rdsr_file.dcm')

The input argument to read_file is a str containing the path to an RDSR file. Other supported data types are pathlib and pydicom objects.

Extract data

Data is extracted by first navigating through the RDSR hierarchy using the concept names. All concept names are given in lower case, separated by underscores ("_"). In the example below we are extracting the value from "Procedure Reported".

    >>> rdsr_obj['procedure_reported'].value

    'Projection X-Ray'

When the square brackets are used, the first matched concept name is returned. This is inappropriate if several entries with the same concept name exist on the same level. To iterate entries with the same concept name, use the get_all method.

    >>> for irr_event in sr_obj.get_all('irradiation_event_x-ray_data')):
            print(irr_event['dose_area_product'].value)

    (1.9632189e-7, 'Gy.m2')
    (1.1173212e-5, 'Gy.m2')
    (8.566802e-7, 'Gy.m2')

Drill deeper into the hierarchy by adding more concept names in the square brackets.

    >>> rdsr_obj['procedure_reported', 'has_intent'].value

    'Combined Diagnostic and Therapeutic Procedure'

Supported value types

Currently, only a few value types are supported. The supported value types are listed below.

  • Code Meaning
  • Date Time
  • Measured Values
  • Text Value

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rdsr_navigator-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

rdsr_navigator-0.1.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file rdsr_navigator-0.1.2.tar.gz.

File metadata

  • Download URL: rdsr_navigator-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for rdsr_navigator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1a7af2ad85517ac1c26784239fd6d465d5074dfd51ad61c4511dfde05b917cd7
MD5 6f8a787dfd4127c298a55051bf51daba
BLAKE2b-256 b5d4745e6d381cb348b5894285055eae60e42c4715ce6bb73f06ac7431a726e1

See more details on using hashes here.

File details

Details for the file rdsr_navigator-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rdsr_navigator-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for rdsr_navigator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76250a821ec9b089c2c84af40149ec354bf5af284afb767ce29ccfde9faa5d74
MD5 7c596bee48bd2e57fc4abfdecf824554
BLAKE2b-256 f88b65410ae3e16eaba88ff22100309940b191b4cf6b0d72fe16190b154a49d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page