No project description provided
Project description
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
- 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"])
- 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)
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
dicomselect-0.3.0.tar.gz
(57.3 kB
view hashes)
Built Distribution
Close
Hashes for dicomselect-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cae8d3650dc6cb7ece15df0e9ece22586a2e5a50ac6a4101aae7daa6ef7387f |
|
MD5 | 44db9151f73744042aec720e5275ebd0 |
|
BLAKE2b-256 | fa4574dcbf0fda6b7dd7dceebb87500a5c676196bb0b9ed7475b27ae2b05d486 |