dicom index
Extracts DICOM information from files into a single sqlite file
Installation
pip install dicomindex
Usage
Index a DICOM in folder
To recursively read all DICOM files in /path/to/folder and add patient/study/series objects to index.
dicomindex index_full /tmp/myindex.sql /path/to/folder
Index faster
For big file collections over slow connections, indexing all files can easily take weeks. Annoying. You could use this to for a faster index:
dicomindex index_per_folder /tmp/myindex.sql /path/to/base_folder
This will find a single DICOM file to index in each folder recursively. This speeds up indexing significantly, but assumes
base_folder contains sub-folders that are structured in a patient/series/study way.
Explore
I've indexed this folder. Now what?
What's in my index file? (quick overview)
dicomindex stats /path/to/folder
Detailed exploration - Datasette
- Install datasette
- From commandline, run
datsette /tmp/myindex.sql
Detailed exploration - Python
Query the db file directly using dicomindex sqlalchemy ORM:
from dicomindex.orm import Study
from dicomindex.persistence import SQLiteSession
with SQLiteSession("/tmp/archive.sql") as session:
studies = session.query(Study).all()
print(f"found {len(studies)} studies")
Non-goals
dicomindex will not do the following:
- Comprehensive storage. Use a PACS like orthanc. If an
ImageCommentselement contains many pages of data, dicomindex will only save the first 1024 characters. It maps many different DICOM Value Representations to 'flat string'. It is meant for indexing, not faithful reproduction. - Exploration and browsing tools. Use datasette
Useful for
- DICOM data exploration and sanitizing legacy archives
- Messy, semi-structured data, 'archives' that are just collections of folders with DICOM files in them
Metadata
Release files for dicomindex 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dicomindex-0.3.1.tar.gz | 13.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dicomindex-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.8 kB
Release files / dicomindex-0.3.1.tar.gz
| Download URL | dicomindex-0.3.1.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9700b8147228b0770841b06c9ce02a844d7eea5e1d118a14cb9eab4211e7a372
|
|
BLAKE2b-256 checksum How to use checksums |
2d14c87199625ac5d7acf046f6f81d21d99392f2c5d419381f77d70af8827160
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dicomindex-0.3.1-py3-none-any.whl
| Download URL | dicomindex-0.3.1-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5592662789ee449ab437ee8f1d994f15c42a816affb59744eaab9e5b9e5b5cdb
|
|
BLAKE2b-256 checksum How to use checksums |
e043e3f4620f4d86fc8d97a279c4904ccb8285fa19060b476a9e05cc4fbd7622
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|