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.9 Release.
- 1.1.9: Permit user naming of series directory when writing at series level. Assistance for modifying tag values.
- 1.1.8: Added improved functionality for dicom to: VTK image data; and VTK structured grid data conversion
- 1.1.7: Add basic DCM-SEG read/write/conversion functionality. Rewrote dcm2vtk routines for improved consistency in some edge cases.
- 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 usage 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:
- source_code_directory/spydcmtk.conf (file with default settings)
- $HOME/spydcmtk.conf
- $HOME/.spydcmtk.conf
- $HOME/.config/spydcmtk.conf
- Full file path defined at environment variable: "SPYDCMTK_CONF"
- Full path passed as commandline argument to
spydcmtk
Files are read in the above order with each subsequent variable present over writing 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
Works in progress
Basic handling of DicomSegmentation images is added :
- writing a label map to dicom segmentation
- basic reading a dicom segmentation and writing to vti/vts
- handling multi label dicom segmentations
- improved, explicit handling of data orientation for
- multi-volume dicom images
- multi-label dicom seg images
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spydcmtk-1.1.9.tar.gz
.
File metadata
- Download URL: spydcmtk-1.1.9.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74ce128d41a4d446cbf298998bb015c1481b1c6fba4c4457d84260211f8fa0f1 |
|
MD5 | 57c2e8bb64265fdcf17a6ebc0763ad7f |
|
BLAKE2b-256 | cf9062851a269724557884d2682b749932aa6072eb66c0c8223239c1ce594428 |
File details
Details for the file spydcmtk-1.1.9-py3-none-any.whl
.
File metadata
- Download URL: spydcmtk-1.1.9-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf3d59801c9b56c5dc1f4a10309ba8f22e52a6d380c965ad2970e4b88342b44e |
|
MD5 | c61306dab5734ff258747606faa5c0e6 |
|
BLAKE2b-256 | eee7d885c4605d919f4a4d2515052fea499f19661f4aa79701d824f597d5cdc4 |