Skip to main content

TCIA (The Cancer Imaging Archive) Download Client for Python

Project description

TCIA (The Cancer Imaging Archive) Download Client for Python

This Python package uses the official TCIA REST API to enable downloads from www.cancerimagingarchive.net from within Python scripts and Jupyter Notebooks.

The documentation can be found at https://moritzschwyzer.github.io/tciaclient/. This PyPI/Conda package is based on source code of the TCIA-API-SDK https://github.com/TCIA-Community/TCIA-API-SDK.

Install

pip install tciaclient

How to use

Step 1: Import the TCIAClient from the tciaclient.core package.

from tciaclient.core import TCIAClient

Step 2: Create an instance of the TCIAClient.

tc = TCIAClient()

Step 3: Specify the collection you want to download (find the name on https://wiki.cancerimagingarchive.net/display/Public/Collections).

collection_name = "NSCLC-Radiomics"

Step 4: Get the series information of the chosen collection. In this example, we specify that we only want series that are CT scans.

series = tc.get_series(collection=collection_name, modality="CT")

Step 5: Download the dataset to the specified path.

download_path = "./tcia-downloads"
for i, s in enumerate(series):
    print(i)
    tc.get_image(seriesInstanceUid = s["SeriesInstanceUID"],
        downloadPath = download_path, zipFileName = str(i).zfill(3)+"-"+collection_name+".zip")

TCIA Data Usage Policies and Restrictions

Please https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions

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

tciaclient-0.0.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

tciaclient-0.0.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file tciaclient-0.0.2.tar.gz.

File metadata

  • Download URL: tciaclient-0.0.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for tciaclient-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5b4b2bbf77091b77edbda4cb92ca92d4965dd8ee0a680ec2c51cfbec68aa4b2e
MD5 c4f495ad91e052b3f98dcf29582734d8
BLAKE2b-256 be6802631c7dc87623c4b0bb3ff064791008f3cfa2ca272854d2511a6b39d985

See more details on using hashes here.

File details

Details for the file tciaclient-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: tciaclient-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for tciaclient-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de24ff557722c2bf74d748107370d076587d1aec275c55230582d2e78150d6bc
MD5 ae24dd298eb6328e4b8c49fc47fe8314
BLAKE2b-256 5eecbd9ffc366f37dd49642d527956c99d2324971b551c505dbb57c7c249e128

See more details on using hashes here.

Supported by

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