Skip to content

Logo Logo

Use Gear Rules to Automate Data Preprocessing

Introduction

Not only do Gears reduce data management time by performing routine tasks, but you can also configure them to run automatically, so you do not have to think about it. For example, say you want all DICOM data converted to NIfTI format in a project. You can create a Gear rule to convert all DICOM data into a NIfTI file using the dcm2niix: DICOM to NIfTI conversion Gear each time a DICOM file is added to a project.

Learn more about how to create a Gear rule as well as how to standardize rules across your site using a Gear Rule Template.

Instruction Steps

Create a Gear Rule

Create a simple project gear rule to automatically convert DICOM to NIfTI files:

  1. Click Projects in the left navigation menu.
  2. Select the options menu and choose Gear Rules.

gear_rules_selection.png

  1. Click Add New Rule.
  2. Enter a name for the rule
  3. Under If the data matches ALL of the following criteria, Select file type from the list.
  4. Enter dicom for the file type.
  5. Click Select Gear.
  6. Choose dcm2niix: DICOM to NIfTI conversion.
  7. Select a version of the Gear to run. In most cases you should use the latest version.
  8. Disable Always use the latest gear version.

When this is enabled, Flywheel automatically updates the gear when a newer version is published. However, updating the gear version may have unintended consequences for provenance and may change how the gear works.

  1. Modify the Gear configuration if necessary.
  2. Click Save Changes.

dcm2niix_gear_rule.png

  1. Click Save on the Gear rule.

Now each time a DICOM is uploaded to the project, the Gear will automatically run and convert it to NIfTI.

Gear Rule Templates

Site admins can use Gear Rule Templates to define the default set of Gear rules for new projects. Project administrators can override or modify these default Gear rules within the project's management page.

admin_gear_rule_template.png

  1. Select Gear Rule Template from the left navigation menu.
  2. Click Add New Rule.
  3. Create a Gear Rule using the same method described above in Using Gears.

Now, any new projects created will include the Gear Rule. Changes to the Gear Rule Templates do not affect existing projects, only projects created after a change is made. Project administrators can override or modify these default Gear rules within the project's management page. Multiple Gear Rules can be defined on a project and will apply only to data within that project.

Gear Version Note

One setting you and project admins should be aware of is the Gear version. By default Gear templates use the latest version of the the gear. However, you may want to standardize on a gear version. If this is the case, make sure to choose a specific gear version to run in the gear template.

Learn more about defining gear rule logic.

Next Steps

Learn how to create a Gear Rule Template or move on to de-identifying data Flywheel.