Skip to content

Logo Logo

CLI Reference Guide: Import Template

Introduction

If your directories are a mix of file formats and do not follow a standard structure, you can use the template import to set rules for how to import data. Learn more about how to use the template import.

Warning

Unsupported upload method for site, group, or project de-id profiles

Use one of these supported methods if you use site, group, or project de-id profiles.

Usage

fw import template [Optional arguments] [template] [folder]

Instruction Steps

Required Arguments

Required arguments Description
template The location of the YAML template or template string.
folder The path to the folder to import

Optional Arguments

Optional Arguments Description
-h Show this help message and exit
--config-file FILE LOCATION Specify configuration options via config file. Learn more about how to create and use the config file to set optional arguments.
--no-config Do NOT load the default configuration file
-y Assume the answer is yes to all prompts
--ca-certs CA_CERTS The file to use for SSL Certificate Validation
--debug Turns on debug logging level
--quiet Turns off logging to the console
--max-retries MAX_RETRIES Sets the maximum number of retry attempts, if assume yes. The default is 3 retry attempts.
--jobs JOBS Allocates resources for jobs. Jobs perform tasks on your data to process and prepare it for upload to Flywheel. For example, the compression-level is a job run before the data is uploaded to Flywheel.
--concurrent-uploads CONCURRENT_UPLOADS Allocates resources for uploading data to your Flywheel instance. The amount of concurrent uploads your computer can successfully upload depends on the amount of CPU available.
--compression-level The compression level to use for packfiles. -1 for default, 0 for store. A higher compression level number means more compression (and more processing time to compress the data)
--symlinks Follow symbolic links that resolve to directories
--include-dirs INCLUDE_DIRS Patterns of directories to include. You can use wildcard matches (?, *) to include directories and their subdirectories.
Flywheel CLI can only import directories that are under the initial indicated directory
--exclude-dirs EXCLUDE_DIRS Patterns of directories to exclude. You can use wildcard matches (?,*) to include directories. This does not include sub-directories.
--include FILTER Enter specific filenames or use wildcard matches (?,*) to include patterns of filenames. You can only include files that are within the path designated in the command. Learn more about file types in Flywheel.
--exclude EXCLUDE Enter specific filenames or use wildcard matches (?,*) to exclude patterns of filenames. Learn more about file types in Flywheel.
--output-folder OUTPUT_FOLDER Output to the given folder instead of uploading to Flywheel.
--no-uids Ignore UIDs when grouping sessions and acquisitions.
This is useful when you want to group sessions and acquisitions by labels instead of UID.
--unique-uids Warn before creating a Flywheel container (Group, Project, Subject, Session, or Acquisition) with duplicate UIDs
--max-tempfile MAX_TEMPFILE The max in-memory tempfile size, in MB, or 0 to always use disk.
--skip-existing Skip import of existing files.
--no-audit-log Don't generate an audit log.
--audit-log-path AUDIT_LOG_PATH Sets the location for where the audit log should be placed.
--private-dicom-tags PRIVATE_DICOM_TAGS Include the path to the file that defines your private DICOM tags (tags that are not standard for DICOMs and are unique to your institution).
You can then use the defined tags to de-identify the tags before uploading your data to Flywheel. Learn more about how to define and de-identify private DICOM tags.
--ignore-unknown-tags The Flywheel CLI gives an error if there is an unknown DICOM tag. Use this flag to suppress the error and ignore unknown DICOM tags.
--encodings ENCODINGS Set character encoding aliases. E.g. win_1251=cp1251
--related-acquisitions Store related DICOMs in the same acquisition.
--de-identify De-identify DICOM files, e-files and p-files prior to upload. If your DICOM files are compressed in to a zipped file, you should also use with --repack flag to de-identify the files.
This flag removes the DICOM tags PatientID, PatientName, and PatientBirthDate.
--profile PROFILE Use your custom de-id profile.
Learn more about how to create this profile.
--group \ Configure group id
--project \ Configure project label
--dicom name The name of dicom subfolders to be zipped prior to upload.
--pack-acquisitions type Acquisition folders only contain acquisitions of the designated type and are zipped prior to upload.
--repack Unzips archived DICOM files to validate and then repackages the DICOM files as zipped files to upload.
--no-subjects Import data without subjects
--no-sessions import data without sessions
--set-var key=value -s key=value Manually set the variable.
For example, to set the acquisition label:
--set-var acquisition.label=Scan

Template String

Simple properties can be extracted using replacement syntax. For example:

ses-{session}-{subject}:{acquisition}

extracts the session label "01", subject code "ex2002" and acquisition label of "Diffusion" from the folder names:

ses-01-ex2002/Diffusion

Subfolders are separated by ':'.