The aim of this session is to analyze the data we acquired with 3T functional MRI in our simple cognitive neuroscience experiment.
In outline, the first steps will be very similar to what you may remember from another course (PSGY4020, Methods), where we had talked through the pre-processing and analysis of a simple data set with FSL.
What is it? the Faces versus objects scan? or the Fingertapping. What do you think?
The plan for here is:
Feat_gui &
Go!
and watch for progress in web browserDo this “by hand” - using mouse clicks in the macOS operative system for now. We’ll see how to use command line calls in the Terminal soon. Think about which files are:
Take 2 minutes with your neighbours to discuss the following
fsl
has command line toolsThe OneDrive location of the zip-file (2023/24)
– this will only work for people who have a University of Nottingham User ID. If you haven’t already downloaded these data, do so now and keep track of where the data get stored (~/Downloads
?)
# first an "umbrella" folder, then one for subject 2
mkdir ~/data/
mkdir ~/data/sub-03/
# navigate into data directory
cd ~/data/sub-03/
# COPY the files from
# ~/Downloads/msc-scan/sub-03
# TO here (.)
#
# HOW?
Orient the MPRAGE image into the “standard” orientation that most tools will expect. This is not always necessary, but if there are issues with “alignment” in your fMRI analysis, this step can sometimes help:
# navigate into data directory
cd ~/data/sub-03/
# identify the MPRAGE image. Use Readme.md or info in json files?
# could use unix `grep` ! [slightly advanced...]
# mine is: ` ??? `
fslreorient2std NAME_OF_MPRAGE_FILE.nii mprage
# if you want to skipt this step, you could also just cp / rename
imcp NAME_OF_MPRAGE_FILE mprage
# what's the benefit of doing this renaming step / can you see issues?
For our 2022/23 data… the reconstructed files are already in standard space, so the fslreorient2std
call will do nothing, really.
grep
grep
utility has several flags that can be useful... use man grep
or a judicious google search to help find out how.
grep
grep MPRAGE *.json
grep -i mpRaGe *.json
grep -i -l mpRaGe *.json
# inspect, if ok, then skull strip and also make a mask (-m)
# for the 2023/24 data, we should also use the -B option (!)
bet mprage mprage_brain -m -B
look at the images using fsleyes
What do you think the following call does. Think about it first, then run it.:
fsleyes mprage mprage_brain -cm red-yellow &
Any comments about what you see for this particular step?
Start up feat
either via the fsl
menu or directly.
# navigate into data directory
cd ~/data/sub-03/
# then pick FEAT FMRI analysis
fsl &
# - OR -
Feat_gui &
BBR
method you need to use the _brain.nii
image we made in a previous step. This method is pretty cool, but if not given the right files it tends to run for a long time [viz infinite].For FSL design matrix rules, this means for two EVs and “square wave” settings, you can use the following. I called the two EVs “faces” and “objects”. You can use F and O instead – the calculations will be the same, just the naming in figures, data will obviously be different.
setting | Faces | Objects |
---|---|---|
Skip | 36 | 36 |
Off | 36 | 36 |
On | 12 | 12 |
Phase | 36 | 12 |
Stop After | -1 | -1 |
Convolution | Gamma | Gamma |
Remember that we were planning to look for regions in the brains of our participants
The contrasts in the following achieve this. Go back to recordings for some more details
You can also have a quick look at a short demo / tutorial video I made for this first: youtube link
Register onto a nicer image:
# the renderhighres tool!
# get minimal help:
renderhighres
# actually run it:
renderhighres *.feat highres highres 1
You can then look inside the hr
directory and look at the files called rendered_thresh_zstat
.
It’s worth taking a step back and thinking about how running through the analysis with the same data set today went & felt like:
spm
?unix
environment? Downsides?For details on all the files that get created during running of feat
you can also look at this detailed description online.
ls
imcp sub-03_20230207104025_401.nii mprage
ls
imcp sub-03_20230207104025_301.nii fmri
ls
bet mprage mprage_brain -m
ls
fsl &
more Readme.md
ls
cd fmri.feat
ls
open .
fsleyes &
fsleyes thresh_zstat3 &
ls