Skip to content

Config File for the Ingest Template CLI Command

Introduction

The config file is used with the ingest template command to upload data. This upload method allows you to leverage the existing folder structure in your local server to map your dataset to a Flywheel project.

The alternative is to use an upload method that organizes files based on the file's metadata (such as with the ingest dicom command.)

This guide explains how to create a config file to use with the ingest template command so you can:

  • Organize and label your folders and files to map to a Flywheel project
  • Include/exclude files and folders for upload
  • If necessary, de-identify your data using a de-id profile

Instruction Steps

Below is an example of the ingest template command and a config file. See the links in the Resources section to learn about of the ingest config file in more detail.

fw ingest template -C MyConfig.yaml /path/to/data 
--group [group.id] --project [project label]
#####
# Template and Group/Project Settings
#####

template:
  - pattern: "{project}"
  - pattern: "{subject}"
  - pattern: "{session}"
  - pattern: "{acquisition}"
      scan: dicom

#####
# Includes/excludes directories or file types
#####

# Patterns of directories to include
include-dirs:  
  - "*-DCM"

# Patterns of filenames to exclude
exclude:  
  - "*.txt"
  - "*.xml"

#####
# De-identification Settings
#####

deid-profile: custom

deid-profiles:
- name: custom

  dicom:

    # What date offset to use, in number of days
    date-increment: -17

    # Remove all private tags
    remove-private-tags: true

    # Set patient age from date of birth
    patient-age-from-birthdate: true

    # Set patient age units as Years
    patient-age-units: Y

    fields:
      # Remove a dicom field (e.g.remove PatientID)
      - name: PatientID
        remove: true
      # Increment a date field by -17 days
      - name: StudyDate
        increment-date: true
      # One-Way hash a dicom field to a unique string
      - name: AccessionNumber
        hash: true

Resources