Flywheel Tutorial (MBME Scans)
Flywheel: https://cahbir-flywheel.rutgers.edu/#/projects
TABLE OF CONTENTS:
fmap.*run-01*.* .**bold.nii.gz
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_MMDDYYYY.json
- 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
}
},
Add Additional Documents
- ‘ad-hoc’ upload
- can add any type of file to a dataset
Flywheel Storage & Pipeline - only put active CAHBIR center data
- No restrictions for the amount of data
- but we’re charged for the data since it’s stored in google cloud
- but in general it won’t cause a problem
- Can keep all your data on flywheel
- More likely to stay stable than stuff you take off and put on amarel
- After every session of fMRI scanning at CAHBIR the scan tech is going to automatically send data from the scanner to flywheel
- multi-band multi-echo will go up but will go up a little later since Jeff has to do another step
- compress-sensing MP2Rage
- Double check that the information you want in flywheel is being transferred after the data is put into flywheel
- You should definitely do a test or two with your pipeline
Tutorial: Flywheel MRI to 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
- run gear
- analysis gear
- bids curation
- click on the project name
- ‘inputs’ tab:
- click on “template”
- click on ConteCenter or your project name
- 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
- ‘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
- To attach all fmap to their relevant BOLD images:
- reset: YES
- “Ignore Config File”
- ‘save sidecar as metadata’ select 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
Getting BIDS to work on Flywheel
Tutorial: Flywheel BIDS to fMRIPrep process
- ‘Run gear’
- ‘run analysis gear’
- NOT ‘fMRIPREP: A robust…”
- Select “BIDS Apps: BIDS fMRIPrep” to run
- Input
- Add in your FreeSurfer license file freesurfer_license_jun2024.txt
- way1: copy contents of text file > configuration > ‘gear FREESURFER LICENSE’
- way2: Information > Attachments > Attach freesurfer license .txt
- way3: Information > Custom Information > ‘+’ called FREESURFER_LICENSE > copy paste the .txt file into there
- Add in your FreeSurfer license file freesurfer_license_jun2024.txt
- Job Tags: ‘extra-large’
- Configuration -
- most recent is 1.5.1_24.0.0, but can choose your version
- bids_app_command for PCR:
bids_app_command for PCR:
fmriprep bids_dir output --no-submm-recon --bold2anat-dof 6 --output-spaces T1w fsnative fsaverage MNI152NLin2009cAsym:res-native MNI152NLin2009cAsym:res-2 --cifti-output 91k --write-graph
Finally, press ‘Run Gear’
Wait 12-24 hours
Getting fMRIPrep to work on Flywheel
If you need to check error log, you can download it here:
Misc
Data-Viewer
- little picture icon on the right of the dicom
- can also double check that your files are right
Gear Exchange
- flywheel.io/gear-exchange/
- if there’s any there you want and aren’t currently installed on our flywheel, let Wil / CAHBIR-support know, and they’ll ask flywheel to add it
- You can also make requests for flywheel to make a gear, though we don’t know how quickly that might happen
Other
- Wil custom python script
- will unzip and grab specific files and put them where you want them to be
Questions
- Flywheel has robust documentation
- or email flywheel directly with ‘give us feedback’ (opens up a ticket)