Code Monkey home page Code Monkey logo

tciaclient's Introduction

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

Information regarding data usage policies and restrictions can be found on https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions

tciaclient's People

Contributors

moritzschwyzer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.