Flywheel: Data to BIDS
FLYWHEEL LINK: https://cahbir-flywheel.rutgers.edu/#/projects
Table of Contents
How to change file names (if necessary):
Tutorial by flywheel devs: https://docs.flywheel.io/Developer_Guides/dev_bids_curation_2_precuration/
- Go to your Project tab
- click on Subjects tab and select the subject you’d like to run
- Go to Analysis tab
- Click Run analysis gear
- Click “Bids Pre-Curation” or “relabel container” (they’re equivalent)
- put in no inputs, leave everything blank
- run gear
- Go to subjects tab
- to go “provenance” tab in subject to see the job running
- refresh for new update— not live view
- if fails, click on the “View Log” button
- read the error log to figure out
- ask Wil if need be
- When finished, go to “analysis” tab at the TOP (not within “Subject”)
- click on the job Bids pre-curate
For the files, if you need to make edits, press on the 3 dots and then press “Download”
acquisitions.csv
sessions.csv
subjects.csv
- make the edits in excel
- in flywheel, in the project tab, press “information” tab
- press ‘upload’
- upload the .csv that you made edits to
- This keeps the version history of all the prior csv versions— so if you upload a document that is wrong, you can just restore an old version
Ignoring Files
If you need to ignore 1-3 images into .bidsignore…
Flywheel Tutorial: Ignoring Certain Images in Bids
- Go to your Project tab
- click on Subjects tab and select the subject you’d like to run
- go to Sessions tab
- make sure you’re on “Acquisitions” tab
- optional: Turn on “BIDS View”
- click on the 3 dots to the right of the “Run Gear’ button
- click on the on-switch for “BIDS View”
- click on the file you want to ignore
- in the popup, go to “Information” tab
- scroll down to the small section which says “BIDS” and has a carrot “^”
- Press on the carrot to expant the BIDS information
- Scroll down to the line “ignore []” and check the box
- Press “save” on the popup
- Repeat steps 6-11 for any files you want to ignore
If you need to ignore many images based on rules…
- click on your project tab
- Go to “Information”
- In files find template nordic_extension_template.json If it’s not already uploaded, upload into the project files nordic_extension_template.json, by clicking on: - Project Name (in side navigation bar) - Information tab - Attachments box - ‘Upload’ button
- Click on the 3 dots in the template row and click “Download”
- Open file in an editor
- in the “initializers:” section, paste in your code
for example, this skips any files which start with “fmap_” or “fmap-” and end with “SBRef” or “Pha”, and skips any files which end with “_e2” or “_e3”
{
"rule": "reproin_fieldmap_file",
"where": {
"acquisition.label": {
"$regex": "fmap(-|_).*(SBRef|Pha)+$"
}
},
"initialize": {
"ignore": true
}
},
{
"rule": "reproin_fieldmap_file",
"where": {
"file.name": {
"$regex": "_e(2|3)\\.(nii(\\.gz|)|json)$"
},
"acquisition.label": {
"$regex": "fmap(-|_)"
}
},
"initialize": {
"Suffix": "echo",
"ignore": true
}
},
BIDS process
- click on the project you want to look at (ie ConteCenter, PCX)
- click on ”Sessions” tab
- Make sure you’re on “Acquisitions” tab
- Click ‘Run Gear’
- Select ‘Analysis Gear’
- Select ‘BIDS Curation’
- Click on the project name
- ‘Inputs’ tab:
- click on “template”
- click on ConteCenter or your project name (in the folder path)
- select the nordic_extension_template.json
- locates and assigns the echoes their proper echo name
- ignores single band reference images and phase images for fieldmaps
- If it’s not already there, upload it to the project files by clicking on:
- Project Name (in side navigation bar)
- Information tab
- Attachments box
- ‘Upload’ button
- ‘Configuration’ tab:
- First: you need to specify the regexes in pairs, each element separated by a space.
- To attach all fmap to their relevant BOLD images:
fmap-.* .*bold.nii.gz
You have to match the fmap container to the functional images containers. Our containers for Conte/PCX are (both AP and PA):fmap-epi_dir-AP_BOLD_NORDIC_run-01
fmap-fieldmap_acq-B0
fmap-phasediff_dir-AP
Our functional images are
- func-epi_task-
_BOLD_NORDIC_run-01
So to map (fill intendedFor field) every fmap to the functional images, use
fmap-.* .*bold.nii.gz
EX: To just map epi fmaps to the functional images, usefmap-epi_.* .*bold.nii.gz
- To attach all fmap to their relevant BOLD images:
- Reset: YES
- Ignore Config File: YES
- Save idecar as Metadata: NO
- the JSON sidecars of the data to fill in the configuration, but you can add additional stuff in the tab that isn’t in the sidecars
- First: you need to specify the regexes in pairs, each element separated by a space.
- Go to jobs log tab to track usage or errors
- Select subject/job
- Select ‘log’ tab
- Refresh to see current— not in real time