Introduction to TCIApathfinder

Pamela Russell

2019-09-21

Installation

From within R:

install.packages("TCIApathfinder")

From GitHub:

# install.packages("devtools")
devtools::install_github("pamelarussell/TCIApathfinder")

Authentication

An API key is required to access data from TCIA. To obtain and correctly store your API key:

  1. Request a key from TCIA by following the instructions here.

  2. Create a text file in your home directory (~/) called .Renviron.

  3. Create the contents of the .Renviron file like this, making sure the last line in the file is empty. Otherwise, R will silently fail to load the file.

    TCIA_API_KEY=xxx-xxx-xxx-xxx
    
  4. Restart R. .Renviron is only processed at the beginning of an R session.

Usage

Load the package:

Get the names of all TCIA collections:

Get the names of all imaging modalities

Note: a collection or body part can be specified to narrow down results.

Get the names of all body parts studied:

Note: a collection or modality can be specified to narrow down results.

Get information for all patients in a collection

Note: if no collection is passed, patients for all collections are returned.

Get all image series based on criteria

Note: other ways to narrow down results include

Get detailed information on all imaging studies for a patient

The variables in studies$patient_studies correspond to the fields of a PatientStudy object as described in the API documentation.

Note: other ways to narrow down results include a collection or a study instance UID.

Get all imaging studies for a collection

Note: a patient ID can be provided to further narrow down results.

Get individual DICOM image IDs for an image series

Download a single DICOM image

Note: a file name can be provided to override the original file name.

Download an image series and extract it

Download, save and extract an image series, optionally to a temporary location

Additional functions

See package documentation for further details: