Skip to main content

Simple python dicom toolkit.

Project description

spydcmtk

Simple PYthon DiCoM Tool Kit

Dicom organisational, querying and conversion toolkit

spydcmtk is a pure Python package built on top of pydicom.

This package extends pydicom with a class structure based upon the Patient-Study-Series-Image hierarchy. In addition, it provides a number of built in routines for common actions when working with dicom files, such as human readable renaming, anonymisation, searching and summarising.

Version

Current is VERSION 1.1.5 Release.

1.1.5: Add option to retrieve tag value from commandline. Small bug fix on safe naming. 1.1.4: Additional configuration moved to config file. DCM2VTI active. 1.1.1: Add option to keep private tags when running anonymisation. Dcm2nii path configurable from config file. 1.1.0: Some bug fixes and restrict the use of dicom to vti (WIP) 1.0.0: Initial Release

Installation

Using pip:

pip install spydcmtk

Quick start

If you installed via pip then spydcmtk console script will be exposed in your python environment.

Access via:

spydcmtk -h

to see the commandline useage available to you.

If you would like to incorporate spydcmtk into your python project, then import as:

import spydcmtk

listOfStudies = spydcmtk.dcmTK.ListOfDicomStudies.setFromDirectory(MY_DICOM_DIRECTORY)
# Example filtering
dcmStudy = listOfStudies.getStudyByDate('20230429') # Dates in dicom standard string format: YYYYMMDD
dcmSeries = dcmStudy.getSeriesBySeriesNumber(1)
# Example writing new dicom files with anonymisation
dcmStudy.writeToOrganisedFileStructure(tmpDir, anonName='Not A Name')

Configuration

spydcmtk uses a spydcmtk.conf file for configuration.

By default spydcmtk.conf files are search for in the following locations:

  1. source_code_directory/spydcmtk.conf (file with default settings)
  2. $HOME/spydcmtk.conf
  3. $HOME/.spydcmtk.conf
  4. $HOME/.config/spydcmtk.conf
  5. Full file path defined at environment variable: "SPYDCMTK_CONF"
  6. Full path passed as commandline argument to spydcmtk

Files are read in the above order with each subsequent variable present overwritting any previously defined. For information on files found and variables used run:

spydcmtk -INFO

Documentation

Clear documentation of basic features can be seen by running the "spycmtk -h" command as referenced above. For detailed documentation please see spydcmtk-documnetation

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

spydcmtk-1.1.6.tar.gz (1.5 MB view hashes)

Uploaded Source

Built Distribution

spydcmtk-1.1.6-py3-none-any.whl (1.5 MB view hashes)

Uploaded Python 3

Supported by

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