<jupyter_start><jupyter_text>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.<jupyter_code>from tciaclient.core import TCIAClient<jupyter_output><empty_output><jupyter_text>Step 2: Create an instance of the `TCIAClient`.<jupyter_code>tc = TCIAClient()<jupyter_output><empty_output><jupyter_text>Step 3: Specify the collection you want to download (find the name on https://wiki.cancerimagingarchive.net/display/Public/Collections).<jupyter_code>collection_name = "NSCLC-Radiomics"<jupyter_output><empty_output><jupyter_text>Step 4: Get the series information of the chosen collection. In this example, we specify that we only want series that are CT scans.<jupyter_code>series = tc.get_series(collection=collection_name, modality="CT")<jupyter_output><empty_output><jupyter_text>Step 5: Download the dataset to the specified path.<jupyter_code>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")<jupyter_output><empty_output><jupyter_text>TCIA Data Usage Policies and Restrictions Information regarding data usage policies and restrictions can be found on https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions<jupyter_code>#hide
from nbdev.export import notebook2script; notebook2script()<jupyter_output>Converted 00_core.ipynb.
Converted index.ipynb.
{'fraction_non_alphanumeric': 0.09333333333333334, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 6.995901639344262, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '41995', 'license': 'Apache-2.0', 'n_tokens_mistral': 636, 'n_tokens_neox': 607, 'n_words': 161, 'path': 'index.ipynb', 'repo_name': 'moritzschwyzer/tciaclient', 'size': '1950'}