Skip to main content

dicomselect

Create a new database

from pathlib import Path
from dicomselect.database import Database

db_path = Path('dicomselect_archive.db')
db_path.parent.mkdir(parents=True, exist_ok=True)
db = Database(db_path)
db.create('/path/to/archive', max_workers=4)

Select scans

  1. Simple matching of values
from dicomselect.database import Database

mapping = {
    "t2w": {
        "SeriesDescription": [
            "t2_tse_tra_snel_bij bewogen t2 tra",
            "t2_tse_tra",        
            "t2_tse_tra_prostate",
            "t2_tse_tra_snel",
            "t2_tse_tra_Grappa3"
        ]
    },
}

db = Database('/path/to/dicomselect_archive.db').open()
query = db.where("series_description", 'in', mapping["t2w"]["SeriesDescription"])
  1. Pattern matching and combining queries
from dicomselect.database import Database

mapping = {
    "hbv": {
        "SeriesDescription": [
            "ep2d_diff_tra%CALC_BVAL",
            "diffusie-3Scan-4bval_fsCALC_BVAL"
        ],
        "ImageType": [
            r"DERIVED\PRIMARY\DIFFUSION\CALC_BVALUE\TRACEW\DIS2D\DFC",
            r"DERIVED\PRIMARY\DIFFUSION\CALC_BVALUE\TRACEW\DIS2D",
            r"DERIVED\PRIMARY\DIFFUSION\CALC_BVALUE\TRACEW\ND\DFC",
            r"DERIVED\PRIMARY\DIFFUSION\CALC_BVALUE\TRACEW\NORM\DIS2D",
        ]
    }
}

db = Database('/path/to/dicomselect_archive.db').open()
query1 = db.where("series_description", "LIKE", mapping["hbv"]["SeriesDescription"])
query2 = db.where("image_type", "LIKE", mapping["hbv"]["ImageType"])
query = query1.union(query2)
db.close()

Show info

query.info().filter("series_description").print()

Convert

from dicomselect.database import Database
db = Database('/path/to/dicomselect_archive.db')
plan = db.plan('{patient_id}/{series_description}_{patient_age}', query)
plan.target_dir = '/path/to/target_dir'
plan.suffix = '.mha'
plan.print()
plan.execute(max_workers=4)

Release files for dicomselect 0.3.0

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

Source distribution (sdist)

Source distribution for dicomselect 0.3.0
File Size Uploaded
dicomselect-0.3.0.tar.gz 57.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dicomselect 0.3.0
File Interpreter ABI Platform
dicomselect-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 115.2 kB

Release files / dicomselect-0.3.0.tar.gz

Download URL dicomselect-0.3.0.tar.gz
Size 57.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9d23e5cea49ac3962d955f1abd75ab9494ae3d679b134a2d47d9d76917cb5d18
BLAKE2b-256 checksum
How to use checksums
f682c89e6995c0c1184bbaeb3c049277de68914fe2070c68f331acbc78c7c610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / dicomselect-0.3.0-py3-none-any.whl

Download URL dicomselect-0.3.0-py3-none-any.whl
Size 57.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cae8d3650dc6cb7ece15df0e9ece22586a2e5a50ac6a4101aae7daa6ef7387f
BLAKE2b-256 checksum
How to use checksums
fa4574dcbf0fda6b7dd7dceebb87500a5c676196bb0b9ed7475b27ae2b05d486
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

1.0.1

2 release files

1.0.0

2 release files

0.11.1

2 release files

0.10.8

2 release files

0.10.7

2 release files

0.10.6

2 release files

0.10.5

2 release files

0.10.4

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.10

2 release files

0.8.9

2 release files

0.8.8

2 release files

0.8.7

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.1.0

2 release files

0.0.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