Skip to main content

RDSR Navigator

Downloads Downloads

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, please keep this in mind.

The package is intended for RESEARCH USE ONLY, NOT FOR CLINICAL USE.

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.6 and uses pydicom. Therefore make sure you are running Python 3.6 or later 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(r'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'

Data can also be extracted by using the code value and coding scheme designator separated by a colon (":"). This is shown in the example below.

    >>> rdsr_obj['121058:DCM'].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'

Jupyter notebook integration

The RDSR navigator classes are integrated with jupyter notebooks.

  • Data is nicely displayed in tabular form.
  • Tab completion is available when accessing data using square brackets.

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
  • UID

License

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

Release files for rdsr-navigator 0.2.10

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

Source distribution (sdist)

Source distribution for rdsr-navigator 0.2.10
File Size Uploaded
rdsr_navigator-0.2.10.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rdsr-navigator 0.2.10
File Interpreter ABI Platform
rdsr_navigator-0.2.10-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / rdsr_navigator-0.2.10.tar.gz

Download URL rdsr_navigator-0.2.10.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fd8cfd6cdc7f4d49a1fea85fa479185884f294a8261ffede7a627551f2ddabf7
BLAKE2b-256 checksum
How to use checksums
c8ed2d2c43ab99fa527f82dd619bc49d5ede065b120a7d5c0e6bd9d2697d8046
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.23.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.7

Release files / rdsr_navigator-0.2.10-py3-none-any.whl

Download URL rdsr_navigator-0.2.10-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc39ddc5aa129ece0267cbc50a0b2598cae9cf8986b299d2bf967a2c4016b3b6
BLAKE2b-256 checksum
How to use checksums
6d9f37502f84b2acd44ab497b455cf265b833690e2d7448428c9949b042fe8d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.23.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.7

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

This release

0.2.10 This release

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.0

2 release files

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