Skip to content

Logo Logo

BIDS Curation Tutorial Part 3: Running the BIDS Curation Gear

Instruction Steps

Now that we have prepared our data and converted the scans to NIfTI format, we can run the BIDS Curation gear. Flywheel currently supports BIDS version 1.8.0. However, templates can be extended to support later BIDS versions and BIDS Extension Proposals (BEPs).

Step 1: Run the BIDS Curation gear

The BIDS Curation gear, like all BIDS Application Gears, can be run at the session, subject, or project level of the Flywheel hierarchy. The key to running at one of these levels is to first navigate to the desired level and then find the right Run Gear or Run Analysis Gear button.

Users are encouraged to run the BIDS Curation Gear at the Project level, as the output summary csv files will contain all subjects and sessions. Running at either the session or subject level may mean having to parse the results of multiple output csv files to check for curation errors.

In the next few subsections, we will cover in detail how to run the BIDS Curation Gear at the project level from start to finish. We will then briefly describe how to run the gear at both the subject and session levels.

Curating a Project

Curating a Project
  1. To run the BIDS Curation gear on the entire project, select the Analyses tab at the top and click on the Run Analysis Gear button. 001a-BIDS-curate-project.png
  2. Then, search for BIDS Curation and select the desired version (usually latest). Since Flywheel has adopted the ReproIn naming convention as the new default, there is no need to select an input template file. 001b-BIDS-curate-project.png
  3. Click on the Configuration tab to make sure that the base_template is reproin. The save_sidecar_as_metadata option should currently default to auto. This option checks how BIDS JSON sidecar data is currently saved for the project and use that. For new projects, BIDS JSON sidecar data are now saved in JSON sidecar files. Older and/or on-going projects may have these data saved out in the Custom Information metadata fields. This config option also has the option to force how the BIDS JSON sidecar data are saved by selecting either yes or no. Once you are satisfied with the config options, click Run Gear. 001c-BIDS-curate-project.png
  4. Once the BIDS Curate Gear has finished running (you may need to refresh the page to check the status), click on the gear name in the list of analyses and click on the Gear Logs tab. 001d-BIDS-curate-project.png
  5. Scroll through the gear log to check for any error messages. You can also review how files were recognized (or not) and which rule was used to determine the BIDS information. The BIDS Curation Gear steps through the entire project hierarchy beginning at the project level. It first matches the project container using the " bids_project" rule and sets BIDS Custom Information on the project container. 001e-BIDS-curate-project.png

Curating a Session

Curating a Session
  1. Click on the Session tab at the top and then select a specific session. Then click the Run Gear button and select Analysis Gear. 001-BIDS-curate-session.png
  2. Follow the instructions above for "Curating a Project" for selecting the BIDS Curation Gear, running the gear with the default configurations, and checking the log file.

Curating a Subject

Curating a Subject
  1. Select the Subject view button 15dbc59f8f0a97.png and then select a specific subject. Then navigate to the Analyses tab. Finally, click on the Run Analyses Gear button. It is easy to forget to select a subject. If you do, you'll be running the gear on the currently selected session. 001-BIDS-curate-subject.png
  2. Follow the instructions above for "Curating a Project" for selecting the BIDS Curation Gear, running the gear with the default configurations, and checking the log file.

Step 2: Review BIDS Curation project custom information

Let's see how the BIDS information looks for the project. Refresh the page and click the Information tab at the top. You can see BIDS under Custom Information.

Since the latest version of the BIDS Curation Gear now saves out the BIDS JSON sidecar data in JSON sidecar files, there is minimal custom information saved as metadata.

In the below screengrab, we can see that the Project was curated using the bids_project rule and that the JSON sidecar file data are saved in JSON sidecar files.

002a-BIDS-curate-project-information.png

Scrolling down to Attachments, you will see the standard BIDS dataset_description.json and README.txt files.

002b-BIDS-curate-project-information.png

If you hover on the right-hand side of each file and click on the three dots, a pull-down menu will appear allowing you to open and edit either or both files within the Flywheel UI.

002c-BIDS-curate-project-information.png

Below we have opened the dataset_description.json file for editing:

002d-BIDS-curate-project-information.png

Step 3: Review BIDS curated acquisitions

Review BIDS curation results for Dataset 1
  1. From Sessions/Acquisitions tab, check out Info for nifti file(s): 003a-Dataset1-BIDS-curation-review.png
  2. Note that under BIDS in Custom Information only BIDS filename information is saved out as metadata. 003b-Dataset1-BIDS-curation-review.png Scrollling down through the BIDS information, you will see a checkbox labeled valid. If this is checked, then the filename and organization should be considered valid by the BIDS validator. However, this valid does not reflect having run the BIDS validator on the project. 003c-Dataset1-BIDS-curation-review.png
  3. If we check one of the scout acquisition(s), we will see that there is no BIDS information. This means that these acquisitions were correctly ignored by BIDS Curate gear, because we updated the File Classifier results so that only Intent was Localizer. 003d-Dataset1-BIDS-curation-review.png
  4. We can also preview the overall organization of the BIDS directory from the Flywheel UI. From the three dot pull-down menu to the right of Run Gear button, you can toggle on/off a BIDS view to preview the BIDS directory structure and filenames. 003e-Dataset1-BIDS-curation-review.png
  5. From this view, we can quickly see that the one T1w acquisition was correctly named and added to the anat folder. Also, that all of the functional runs were correctly named and added to the func folder. Scrolling down to sourcedata would show that all of the dicom.zip files were added there. 003f-Dataset1-BIDS-curation-review.png Scrolling down towards the bottom shows that all of the scout acquisitions were correctly categorized as non-BIDS. 003g-Dataset1-BIDS-curation-review.png
Review BIDS curation results for Dataset 2
  1. From Sessions/Acquisitions tab, check out Info for nifti file(s): 003a-Dataset2-BIDS-curation-review.png
  2. Note that under BIDS in Custom Information only BIDS filename information is saved out as metadata. For the first session, we can see that the optional BIDS filename parameter of Dir was set correctly. 003b-Dataset2-BIDS-curation-review.png Similarly for the second session, we see that both Acq and Dir were both set correctly. 003c-Dataset2-BIDS-curation-review.png Scrollling down through the BIDS information, you will see a checkbox labeled valid. If this is checked, then the filename and organization should be considered valid by the BIDS validator. However, this valid does not reflect having run the BIDS validator on the project. 003d-Dataset2-BIDS-curation-review.png
  3. We can also preview the overall organization of the BIDS directory from the Flywheel UI. From the three dot pull-down menu to the right of Run Gear button, you can toggle on/off a BIDS view to preview the BIDS directory structure and filenames. 003e-Dataset2-BIDS-curation-review.png
  4. From this view, we can quickly see that all of the functional runs were correctly named and added to the func folder. Scrolling down to sourcedata shows that all of the dicom.zip files were added there. 003f-Dataset2-BIDS-curation-review.png 003g-Dataset2-BIDS-curation-review.png

Step 4: Review the BIDS Curation Gear output csv files

If you ran the BIDS Curation Gear at the Project level, then there will be five output csv files created as Results.

Navigating to the Project-level Analyses tab, click on the curate-bids gear run to show the list of Results. You should see the below list of csv files:

004-BIDS-curate-project-csv-files.png

The details of what information is contained in these csv files is covered in BIDS Curation Tutorial Part 5 Interpreting the Curation Report.

Finishing up with BIDS Curation

BIDS validation

Please note that due to how data are stored in Flywheel instances, it is not possible to directly run the BIDS Validator on a project. It is recommended that users either run the latest version of the BIDS Validator outside of Flywheel, or be prepared to correct validation errors that may be caught when running BIDS-apps gears, such as fMRIPrep.

Although, we did not encounter any errors during the BIDS Curation of the two example datasets, the next section covers how to find and fix common errors during BIDS Curation using the output curation reports. With the new adoption of the ReproIn naming scheme, most errors can be avoided by careful file classification and acquisition label renaming. Continue to BIDS curation tutorial part 4: curation reports to learn about the information contained in these reports and how to fix common errors.