Command Line Interface tools¶
idc-index provides a command line interface (CLI) tool to simplify access to the functionality implemented via the Python API. The CLI tool is a wrapper around the Python API and provides a simple way to interact with the package.
Once idc-index is installed, the CLI tool can be accessed by running the following command in the terminal.
idc¶
idc is a command line interface to the API functionality available in idc-index.
Usage
idc [OPTIONS] COMMAND [ARGS]...
download¶
Download content given the input parameter.
Determine whether the input parameter corresponds to a file manifest or a list of collection_id, PatientID, StudyInstanceUID, or SeriesInstanceUID values, and download the corresponding files into the current directory. Default parameters will be used for organizing the downloaded files into folder hierarchy. Use download_from_selection() and download_from_manifest() functions if granular control over the download process is needed.
Usage
idc download [OPTIONS] GENERIC_ARGUMENT
Options
- --download-dir <download_dir>¶
Path to the directory to download the files to.
- --dir-template <dir_template>¶
Download directory hierarchy template. This variable defines the folder hierarchy for the organizing the downloaded files in downloadDirectory. Defaults to index.DOWNLOAD_HIERARCHY_DEFAULT set to %collection_id/%PatientID/%StudyInstanceUID/%Modality_%SeriesInstanceUID. The template string can be built using a combination of selected metadata attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) that must be prefixed by ‘%’. The following special characters can be used as separators: ‘-’ (hyphen), ‘/’ (slash for subdirectories), ‘_’ (underscore). When set to empty string (“”) all files will be downloaded to the download directory with no subdirectories.
- --log-level <log_level>¶
Set the logging level for the CLI module.
- Options:
debug | info | warning | error | critical
Arguments
- GENERIC_ARGUMENT¶
Required argument
download-from-manifest¶
Download the manifest file.
In a series of steps, the manifest file is first validated to ensure every line contains a valid URL. It then gets the total size to be downloaded and runs the download process on one process and download progress on another process.
Usage
idc download-from-manifest [OPTIONS]
Options
- --manifest-file <manifest_file>¶
Required The path to the manifest file.
- --download-dir <download_dir>¶
Required Path to the directory to download the files to.
- --quiet <quiet>¶
If set, suppresses the output of the subprocess.
- --validate-manifest <validate_manifest>¶
If True, validates the manifest for any errors. Defaults to True.
- --show-progress-bar <show_progress_bar>¶
If set, tracks the progress of download.
- --use-s5cmd-sync <use_s5cmd_sync>¶
If set, will use s5cmd sync operation instead of cp when downloadDirectory is not empty; this can significantly improve the download speed if the content is partially downloaded.
- --log-level <log_level>¶
Set the logging level for the CLI module.
- Options:
debug | info | warning | error | critical
- --dir-template <dir_template>¶
Download directory hierarchy template. This variable defines the folder hierarchy for the organizing the downloaded files in downloadDirectory. Defaults to index.DOWNLOAD_HIERARCHY_DEFAULT set to %collection_id/%PatientID/%StudyInstanceUID/%Modality_%SeriesInstanceUID. The template string can be built using a combination of selected metadata attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) that must be prefixed by ‘%’. The following special characters can be used as separators: ‘-’ (hyphen), ‘/’ (slash for subdirectories), ‘_’ (underscore). When set to empty string (“”) all files will be downloaded to the download directory with no subdirectories.
download-from-selection¶
Download from a selection of collection(s), patient(s), study(studies) and series.
The filtering will be applied in sequence by first selecting the collection(s), followed by patient(s), study(studies) and series. If no filtering is applied, all the files will be downloaded.
Usage
idc download-from-selection [OPTIONS]
Options
- --download-dir <download_dir>¶
Required Path to the directory to download the files to.
- --dry-run <dry_run>¶
If set, calculates the size of the cohort but download does not start.
- --collection-id <collection_id>¶
Collection ID(s) to filter by.
- --patient-id <patient_id>¶
Patient ID(s) to filter by.
- --study-instance-uid <study_instance_uid>¶
DICOM StudyInstanceUID(s) to filter by.
- --series-instance-uid <series_instance_uid>¶
DICOM SeriesInstanceUID(s) to filter by.
- --crdc-series-uuid <crdc_series_uuid>¶
crdc_series_uuid(s) to filter by.
- --quiet <quiet>¶
If set, suppresses the output of the subprocess.
- --show-progress-bar <show_progress_bar>¶
If set, tracks the progress of download.
- --use-s5cmd-sync <use_s5cmd_sync>¶
If set, will use s5cmd sync operation instead of cp when downloadDirectory is not empty; this can significantly improve the download speed if the content is partially downloaded.
- --log-level <log_level>¶
Set the logging level for the CLI module.
- Options:
debug | info | warning | error | critical
- --dir-template <dir_template>¶
Download directory hierarchy template. This variable defines the folder hierarchy for the organizing the downloaded files in downloadDirectory. Defaults to index.DOWNLOAD_HIERARCHY_DEFAULT set to %collection_id/%PatientID/%StudyInstanceUID/%Modality_%SeriesInstanceUID. The template string can be built using a combination of selected metadata attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) that must be prefixed by ‘%’. The following special characters can be used as separators: ‘-’ (hyphen), ‘/’ (slash for subdirectories), ‘_’ (underscore). When set to empty string (“”) all files will be downloaded to the download directory with no subdirectories.