Title: | Client for the Cancer Imaging Archive REST API |
---|---|
Description: | A wrapper for The Cancer Imaging Archive's REST API. The Cancer Imaging Archive (TCIA) hosts de-identified medical images of cancer available for public download, as well as rich metadata for each image series. TCIA provides a REST API for programmatic access to the data. This package provides simple functions to access each API endpoint. For more information, see <https://github.com/pamelarussell/TCIApathfinder> and TCIA's website. |
Authors: | Pamela Russell [aut, cre] |
Maintainer: | Pamela Russell <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.7 |
Built: | 2025-03-11 03:45:24 UTC |
Source: | https://github.com/pamelarussell/tciapathfinder |
Get body part names
get_body_part_names(collection = NULL, modality = NULL)
get_body_part_names(collection = NULL, modality = NULL)
collection |
TCIA collection name. If |
modality |
Modality name. If |
List containing elements:
body_parts
: character vector of body part names
content
: parsed API response content
response
: API response
get_collection_names
,
get_modality_names
,
DICOM Modality Abbreviations,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_body_part_names() get_body_part_names(collection = "TCGA-BRCA") get_body_part_names(modality = "MR") get_body_part_names(collection = "TCGA-BRCA", modality = "MR") ## End(Not run)
## Not run: get_body_part_names() get_body_part_names(collection = "TCGA-BRCA") get_body_part_names(modality = "MR") get_body_part_names(collection = "TCGA-BRCA", modality = "MR") ## End(Not run)
Get the names of all TCIA collections
get_collection_names()
get_collection_names()
List containing elements:
collection_names
: character vector of TCIA collection names
content
: parsed API response content
response
: API response
TCIA REST API Usage Guide, TCIA API object definitions
## Not run: get_collection_names() ## End(Not run)
## Not run: get_collection_names() ## End(Not run)
Get manufacturer names
get_manufacturer_names(collection = NULL, modality = NULL, body_part = NULL)
get_manufacturer_names(collection = NULL, modality = NULL, body_part = NULL)
collection |
TCIA collection name. If |
modality |
Modality name. If |
body_part |
Body part name. If |
List containing elements:
manufacturer_names
: character vector of manufacturer names
content
: parsed API response content
response
: API response
get_collection_names
,
get_modality_names
,
get_body_part_names
,
DICOM Modality Abbreviations,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_manufacturer_names() get_manufacturer_names(collection = "TCGA-BRCA") get_manufacturer_names(collection = "TCGA-BRCA", modality = "MR", body_part = "BREAST") ## End(Not run)
## Not run: get_manufacturer_names() get_manufacturer_names(collection = "TCGA-BRCA") get_manufacturer_names(collection = "TCGA-BRCA", modality = "MR", body_part = "BREAST") ## End(Not run)
Get modality names
get_modality_names(collection = NULL, body_part = NULL)
get_modality_names(collection = NULL, body_part = NULL)
collection |
TCIA collection name. If |
body_part |
Body part name. If |
List containing elements:
modalities
: character vector of modality names
content
: parsed API response content
response
: API response
get_collection_names
,
get_body_part_names
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_modality_names() get_modality_names(collection = "TCGA-BRCA") get_modality_names(body_part = "BREAST") get_modality_names(collection = "TCGA-BRCA", body_part = "BREAST") ## End(Not run)
## Not run: get_modality_names() get_modality_names(collection = "TCGA-BRCA") get_modality_names(body_part = "BREAST") get_modality_names(collection = "TCGA-BRCA", body_part = "BREAST") ## End(Not run)
Get IDs of patients that have been added to a collection since a specified date
get_new_patients_in_collection(collection, date)
get_new_patients_in_collection(collection, date)
collection |
TCIA collection name. To get a list of available collection
names, call |
date |
Date in format "YYYY-MM-DD" |
List containing elements:
patient_ids
: Patient IDs
content
: parsed API response content
response
: API response
get_collection_names
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_new_patients_in_collection("TCGA-BRCA", "2014-01-01") ## End(Not run)
## Not run: get_new_patients_in_collection("TCGA-BRCA", "2014-01-01") ## End(Not run)
Get studies that have been added to a collection and optionally to a patient since a specified date
get_new_studies_in_collection(collection, date, patient_id = NULL)
get_new_studies_in_collection(collection, date, patient_id = NULL)
collection |
TCIA collection name. To get a list of available collection
names, call |
date |
Date in format "YYYY-MM-DD" |
patient_id |
Patient ID. To get a list of available patient IDs, call |
List containing elements:
studies
: Data frame of collection, patient ID, and study instance UID
content
: parsed API response content
response
: API response
get_collection_names
,
get_patient_info
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_new_studies_in_collection("TCGA-BRCA", "2014-01-01") get_new_studies_in_collection("TCGA-BRCA", "2014-01-01", "TCGA-OL-A66O") ## End(Not run)
## Not run: get_new_studies_in_collection("TCGA-BRCA", "2014-01-01") get_new_studies_in_collection("TCGA-BRCA", "2014-01-01", "TCGA-OL-A66O") ## End(Not run)
Get patient information
get_patient_info(collection = NULL)
get_patient_info(collection = NULL)
collection |
TCIA collection name. If |
List containing elements:
patients
: Data frame of patient ID, name, sex, ethnic group, and collection name
content
: parsed API response content
response
: API response
get_collection_names
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_patient_info() get_patient_info("TCGA-BRCA") ## End(Not run)
## Not run: get_patient_info() get_patient_info("TCGA-BRCA") ## End(Not run)
Get patient study information
get_patient_studies( collection = NULL, patient_id = NULL, study_instance_uid = NULL )
get_patient_studies( collection = NULL, patient_id = NULL, study_instance_uid = NULL )
collection |
TCIA collection name. To get a list of available collection
names, call |
patient_id |
Patient ID. To get a list of available patient IDs, call |
study_instance_uid |
Study instance UID. If |
List containing elements:
patient_studies
: Data frame with columns representing the contents of a PatientStudy object
as described in TCIA API Return Values
content
: parsed API response content
response
: API response
get_collection_names
,
get_patient_info
,
get_studies_in_collection
,
get_patient_studies
,
get_new_studies_in_collection
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_patient_studies() get_patient_studies(collection = "TCGA-BRCA") get_patient_studies(patient_id = "TCGA-OL-A6VO") get_patient_studies(patient_id = "TCGA-OL-A5DA", study_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.104582989590517557856962159716") ## End(Not run)
## Not run: get_patient_studies() get_patient_studies(collection = "TCGA-BRCA") get_patient_studies(patient_id = "TCGA-OL-A6VO") get_patient_studies(patient_id = "TCGA-OL-A5DA", study_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.104582989590517557856962159716") ## End(Not run)
Get patient IDs given a collection name and modality
get_patients_by_modality(collection, modality)
get_patients_by_modality(collection, modality)
collection |
TCIA collection name. To get a list of available collection
names, call |
modality |
Modality name. To get a list of available modality names, call
|
List containing elements:
patient_ids
: Patient IDs
content
: parsed API response content
response
: API response
get_collection_names
,
get_modality_names
,
DICOM Modality Abbreviations,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_patients_by_modality("TCGA-BRCA", "MR") ## End(Not run)
## Not run: get_patients_by_modality("TCGA-BRCA", "MR") ## End(Not run)
Get image series information
get_series_info( collection = NULL, patient_id = NULL, study_instance_uid = NULL, series_instance_uid = NULL, modality = NULL, body_part_examined = NULL, manufacturer_model_name = NULL, manufacturer = NULL )
get_series_info( collection = NULL, patient_id = NULL, study_instance_uid = NULL, series_instance_uid = NULL, modality = NULL, body_part_examined = NULL, manufacturer_model_name = NULL, manufacturer = NULL )
collection |
TCIA collection name. To get a list of available collection
names, call |
patient_id |
Patient ID. To get a list of available patient IDs, call |
study_instance_uid |
Study instance UID. If |
series_instance_uid |
Series instance UID. To get a list of available series instance UIDs, call
this function leaving out parameter |
modality |
Modality name. To get a list of available modality names, call |
body_part_examined |
Body part name. To get a list of available body part names, call
|
manufacturer_model_name |
Manufacturer model name. To get a list of available model names, call
this function leaving out parameter |
manufacturer |
Manufacturer name. To get a list of available manufacturer names, call
|
List containing elements:
series
: Data frame with columns representing the contents of a Series object
as described in TCIA API Return Values
content
: parsed API response content
response
: API response
get_collection_names
,
get_patient_info
,
get_studies_in_collection
,
get_patient_studies
,
get_new_studies_in_collection
,
get_modality_names
,
get_body_part_names
,
get_manufacturer_names
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_series_info() get_series_info(collection = "TCGA-BRCA") get_series_info(patient_id = "TCGA-OL-A6VO") get_series_info(modality = "MR", manufacturer = "GE MEDICAL SYSTEMS") ## End(Not run)
## Not run: get_series_info() get_series_info(collection = "TCGA-BRCA") get_series_info(patient_id = "TCGA-OL-A6VO") get_series_info(modality = "MR", manufacturer = "GE MEDICAL SYSTEMS") ## End(Not run)
Get size of image series
get_series_size(series_instance_uid)
get_series_size(series_instance_uid)
series_instance_uid |
Series instance UID. To get a list of available series instance UIDs, call |
List containing elements:
size_bytes
: Total size of image series in bytes
object_count
: Number of objects in image series
content
: parsed API response content
response
: API response
get_series_info
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_series_size("1.3.6.1.4.1.14519.5.2.1.5382.4002.272234209223992578700978260744") ## End(Not run)
## Not run: get_series_size("1.3.6.1.4.1.14519.5.2.1.5382.4002.272234209223992578700978260744") ## End(Not run)
Get SOP instance UIDs (individual DICOM image IDs) for an image series
get_sop_instance_uids(series_instance_uid)
get_sop_instance_uids(series_instance_uid)
series_instance_uid |
Series instance UID. To get a list of available series instance UIDs, call |
List containing elements:
sop_instance_uids
: character vector of SOP instance UIDs (individual DICOM image IDs)
content
: parsed API response content
response
: API response
get_series_info
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_sop_instance_uids("1.3.6.1.4.1.14519.5.2.1.5382.4002.272234209223992578700978260744") ## End(Not run)
## Not run: get_sop_instance_uids("1.3.6.1.4.1.14519.5.2.1.5382.4002.272234209223992578700978260744") ## End(Not run)
Get studies in a collection and optionally for a specific patient
get_studies_in_collection(collection, patient_id = NULL)
get_studies_in_collection(collection, patient_id = NULL)
collection |
TCIA collection name. To get a list of available collection
names, call |
patient_id |
Patient ID. To get a list of available patient IDs, call |
List containing elements:
studies
: Data frame of collection, patient ID, and study instance UID
content
: parsed API response content
response
: API response
get_collection_names
,
get_patient_info
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: get_studies_in_collection("TCGA-BRCA") get_studies_in_collection("TCGA-BRCA", "TCGA-OL-A66O") ## End(Not run)
## Not run: get_studies_in_collection("TCGA-BRCA") get_studies_in_collection("TCGA-BRCA", "TCGA-OL-A66O") ## End(Not run)
Read TCIA file
read_tcia(file)
read_tcia(file)
file |
path to file from TCIA, usually with extension |
A list of values
file = system.file("doiJNLP-T5OW0OWM.tcia", package = "TCIApathfinder") res = read_tcia(file) testthat::expect_equal(res$noOfrRetry, "4") testthat::expect_equal(length(res$ListOfSeriesToDownload), 82L)
file = system.file("doiJNLP-T5OW0OWM.tcia", package = "TCIApathfinder") res = read_tcia(file) testthat::expect_equal(res$noOfrRetry, "4") testthat::expect_equal(length(res$ListOfSeriesToDownload), 82L)
Save a series of DICOM image files to a directory
save_extracted_image_series( series_instance_uid, out_dir = NULL, verbose = TRUE ) extract_image_series(zip_file, out_dir = NULL)
save_extracted_image_series( series_instance_uid, out_dir = NULL, verbose = TRUE ) extract_image_series(zip_file, out_dir = NULL)
series_instance_uid |
Series instance UID. To get a list of available series instance UIDs, call |
out_dir |
Directory to write zip file to |
verbose |
print diagnostic messages |
zip_file |
downloaded zip file, usually output of
|
List containing elements:
files
: The output zip file that was written
dirs
: Directories of the files
out_file
: The output zip file that was written
response
: API response
## Not run: save_extracted_image_series( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867") ## End(Not run)
## Not run: save_extracted_image_series( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867") ## End(Not run)
Save a series of DICOM image files as a zip file
save_image_series(series_instance_uid, out_dir = NULL, out_file_name = NULL)
save_image_series(series_instance_uid, out_dir = NULL, out_file_name = NULL)
series_instance_uid |
Series instance UID. To get a list of available series instance UIDs, call |
out_dir |
Directory to write zip file to |
out_file_name |
Name of zip file to write. If |
List containing elements:
out_file
: The output zip file that was written
response
: API response
get_series_info
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: save_image_series( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", out_dir = "~/Desktop") save_image_series( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", out_dir = "~/Desktop", out_file_name = "file.zip") ## End(Not run)
## Not run: save_image_series( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", out_dir = "~/Desktop") save_image_series( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", out_dir = "~/Desktop", out_file_name = "file.zip") ## End(Not run)
Save a single DICOM image file
save_single_image( series_instance_uid, sop_instance_uid, out_dir = NULL, out_file_name = NULL )
save_single_image( series_instance_uid, sop_instance_uid, out_dir = NULL, out_file_name = NULL )
series_instance_uid |
Series instance UID. To get a list of available series instance UIDs, call |
sop_instance_uid |
SOP instance UID. To get a list of SOP instance UIDs for an image series, call |
out_dir |
Directory to write DICOM file to |
out_file_name |
Name of DICOM file to write, with .dcm extension. If |
List containing elements:
out_file
: The output file that was written
response
: API response
get_series_info
,
get_sop_instance_uids
,
TCIA REST API Usage Guide,
TCIA API object definitions
## Not run: save_single_image( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", sop_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.257663256941568276393774062283") save_single_image( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", sop_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.257663256941568276393774062283", out_file_name = "file.dcm") ## End(Not run)
## Not run: save_single_image( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", sop_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.257663256941568276393774062283") save_single_image( series_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.806935685832642465081499816867", sop_instance_uid = "1.3.6.1.4.1.14519.5.2.1.5382.4002.257663256941568276393774062283", out_file_name = "file.dcm") ## End(Not run)