NBIA Toolkit
A python package that provides programmatic access to query and download images from the National Biomedical Imaging Archive (NBIA) and The Cancer Imaging Archive (TCIA) databases.
Features
- Use NBIA Guest account to access public data OR authenticate using OAuth with user credentials for limited access data (requires approved data access).
- Query NBIA database for metadata on collections, patients, studies, series, and images
- Download images from NBIA
- Validate doownloads with MD5 checksums for downloaded images
- Auto-sort DICOM files using a user-defined pattern of DICOM tags with specialized DICOMSorter class
Installation
It is made available via PyPI and can be installed using pip:
pip install nbiatoolkit
CLI Usage
For quick access to the NBIA, the toolkit also provides a command line interface (CLI)
> NBIAToolkit --version
_ ______ _______ ______ ____ _ __
/ | / / __ )/ _/ |/_ __/___ ____ / / /__(_) /_
/ |/ / __ |/ // /| | / / / __ \/ __ \/ / //_/ / __/
/ /| / /_/ // // ___ |/ / / /_/ / /_/ / / ,< / / /_
/_/ |_/_____/___/_/ |_/_/ \____/\____/_/_/|_/_/\__/
Version: 0.25.3
Available CLI tools:
getCollections [-h] [-u USERNAME] [-pw PASSWORD] [-p PREFIX]
[-o OUTPUTFILE] [--version]
getBodyPartCounts [-h] [-u USERNAME] [-pw PASSWORD] [-c COLLECTION]
[-o OUTPUTFILE] [--version]
getPatients [-h] [-u USERNAME] [-pw PASSWORD] -c COLLECTION
[-o OUTPUTFILE] [--version]
getNewPatients [-h] [-u USERNAME] [-pw PASSWORD] -c COLLECTION -d DATE
[-o OUTPUTFILE] [--version]
getStudies [-h] [-u USERNAME] [-pw PASSWORD] -c COLLECTION
[-p PATIENTID] [-s STUDYINSTANCEUID] [-o OUTPUTFILE]
[--version]
getSeries [-h] [-u USERNAME] [-pw PASSWORD] [-c COLLECTION]
[-p PATIENTID] [-m MODALITY] [-study STUDYINSTANCEUID]
[--seriesInstanceUID SERIESINSTANCEUID]
[--bodyPartExamined BODYPARTEXAMINED]
[--manufacturerModelName MANUFACTURERMODELNAME]
[--manufacturer MANUFACTURER] [-o OUTPUTFILE] [--version]
getNewSeries [-h] [-u USERNAME] [-pw PASSWORD] -d DATE [-o OUTPUTFILE]
[--version]
downloadSingleSeries [-h] [-u USERNAME] [-pw PASSWORD] --seriesUID
SERIESUID --downloadDir DOWNLOADDIR
[--filePattern FILEPATTERN] [--overwrite]
dicomsort [-h] [-u USERNAME] [-pw PASSWORD]
[--targetPattern TARGETPATTERN] [--truncateUID]
[--sanitizeFilename] [--overwrite] [--nParallel NPARALLEL]
sourceDir destinationDir
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
nbiatoolkit was created by Jermiah Joseph. It is licensed under the terms of the MIT license.
User Agreements and Disclaimers
Release files for nbiatoolkit 0.25.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nbiatoolkit-0.25.4.tar.gz | 20.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nbiatoolkit-0.25.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.1 kB
Release files / nbiatoolkit-0.25.4.tar.gz
| Download URL | nbiatoolkit-0.25.4.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd60d09d560a6df938ab5fe5999e287df3a27660124c590084fb703ba4329e80
|
|
BLAKE2b-256 checksum How to use checksums |
1437446c8701b461a9a03164c2381831083e56bf28938b3c7518cc87b2bc1f04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / nbiatoolkit-0.25.4-py3-none-any.whl
| Download URL | nbiatoolkit-0.25.4-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cbaebbdb5a698884299d1dcb65543e1ffe59a9b253dff454b0c61534ab8ba41
|
|
BLAKE2b-256 checksum How to use checksums |
8bcec080ec822d240e3b0cb007f4b14989fa92b56ffb923ed0d9479def91a0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|