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")
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
Built Distribution
Hashes for tciaclient-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ebd1687253325fab9187a7628e4458c1a2809a6549bd549fd24dbfc8ee349e |
|
MD5 | f35ef3361205b012fb8e14463fb04e41 |
|
BLAKE2b-256 | da7f2d142c42dc7bbcc5dd8234143142eee01083c22cc54eb55db5af662defc2 |