Skip to main content

A python package to query the National Biomedical Imaging Archive (NBIA) database.

Project description

NBIA Toolkit

PyTests Documentation Status codecov Python version

PyPI version Downloads PyPI - Downloads GitHub repo size Docker Pulls

GitHub milestone detailsGitHub milestone details

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

[!TIP] For a thorough description of the package and its available features, please refer to the Documentation at NBIA-Toolkit Read The Docs

  • 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

[!WARNING] nbiatoolkit is currently under development and is not guaranteed to be stable.

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

Available CLI tools: 

getPatients [-h] [-u USERNAME] [-p PASSWORD] -c COLLECTION
            [-o OUTPUTFILE] [--version]

getNewPatients [-h] [-u USERNAME] [-p PASSWORD] -c COLLECTION -d DATE
               [-o OUTPUTFILE] [--version]

getBodyPartCounts [-h] [-u USERNAME] [-p PASSWORD] [-c COLLECTION]
                  [-o OUTPUTFILE] [--version]

downloadSingleSeries [-h] [-u USERNAME] [-p PASSWORD] --seriesUID
                     SERIESUID --downloadDir DOWNLOADDIR
                     [--filePattern FILEPATTERN] [--overwrite]

dicomsort [-h] [-u USERNAME] [-p 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

[!IMPORTANT] The NBIA-toolkit is NOT a product of the National Cancer Institute (NCI) and is not endorsed by the NCI. Users of the NBIA-toolkit are required to abide by the NBIA REST API Terms of Service and the NBIA Data Usage Policies and Restrictions The NBIA-toolkit is provided as an open-source tool based on the NBIA REST API and is provided "AS IS" without warranty of any kind. In no event shall the authors or contributors be liable for any claim, damages or other liability, arising from, out of or in connection with the NBIA-toolkit or the use or other dealings in the NBIA-toolkit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbiatoolkit-0.23.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

nbiatoolkit-0.23.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file nbiatoolkit-0.23.0.tar.gz.

File metadata

  • Download URL: nbiatoolkit-0.23.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for nbiatoolkit-0.23.0.tar.gz
Algorithm Hash digest
SHA256 2aef7649761035038f97fc855e3c6c7b0a996058c14141d106e3d42d6caeb7c0
MD5 045c3364e6b54362014d4b7296848316
BLAKE2b-256 1f6ff07506550a7fd8a175ae4f04d7ef1bfcf6cd0096663643be28401772349e

See more details on using hashes here.

File details

Details for the file nbiatoolkit-0.23.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nbiatoolkit-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a36ba089aa7b5c2163d2f138db12bb1095b33b8ee4a9cdcbda0a5c1f522bc7cb
MD5 aaa193161593bb695642f60a0e8f9937
BLAKE2b-256 bd4938ef52335f3960b62370578c74d3d62859473000a7d7ac6ce26252009e68

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page