How to do condition mask in an event-related fMRI for MVPA analysis?

Hello,

My dataset comes from an experiment that’s kind of like a computer game. People complete tasks at self-pace and can end each trial as soon as the task is solved (there is an upper time limit), so the scan amount for each trial/block varies. This is a mixed design (event-related design within each block). There are 5 different types of events. My task now is to ignore 1 type of event and do an analysis to see if the brain can discriminate among the other 4 types of events. The TR is 0.72s and each trial lasts up to 45s with a varied number of events within each trial. Here are my questions:

  1. Can I conduct this mvpa analysis using the functional data I get from fmriprep as input or do I have to conduct a first-level analysis to get the beta series and use that for training?

  2. All tutorials I found online are using block design, so I have no idea how to temporally mask my nifti data by events. As I mentioned, all of those events order are not pre-designed as they are induced during people’s gameplay, so I calculated the onset and duration of each event based on my behavioral data. Could anyone point me in the right direction? Either show me how to do it or a link to the appropriate tutorial will be grateful.

  3. Shall I also do a condition mask to my confound data before it convolves with the temporal file? I haven’t seen such a step in tutorials so I’m wondering if people even do that, but if not, it also doesn’t make much sense to me to convolve a temporal file for selected events with confounds for all events.

Any suggestions or clues will be really appreciated.

Thanks in advance,
Lily

Hello,

1 You would better fit a trial-by-trial GLM and try to decode the zmaps it outputs for trial type of interest.

Here is an example on how to do that all with the soon to be released nilearn 0.7 To use the latest version of nilearn you have to install it from github (not pip)

2 What you did seems right. Here you may want to consider trials as blocks and make a design matrix with one column per trial. So feeding an event_file with onset and duration of the trial should work.

(this is a first approach however you might hit inconsistencies of signal in your zmaps since you don’t have balanced number of timeframes for each of them)

3 Confound and event files don’t need to have the same structure (at least for the function first_level_model.FirstLevelModel in nistats now nilearn.stats) You don’t need to have one row in your event file by TR, onset and duration for each block is enough, whereas confounds should have as many rows as TRs in the acquisition.

See this example

Hope this helps,
Thomas

Hi Thomas,

This is very helpful! Thank you so much!

Best,
Lily

Dear Thomas,

I have a follow-up question. How do I make the trial-by-trial design when the epi data is stored and read (as in the example) in blocks? Would you mind clarifying it a bit? I got chance level accuracy when I use blocks to make design matrices, so I’m wondering if do a trial by trial GLM will make a better model fit.

Thanks,
Lily

Can you share an example event file and how many similar sessions you get for each subject ? Do you plan to do intra or inter-subject MVPA ?

Thanks,

Hi Thomas,

I plan to do intra-subject MVPA.

Here is an example event file of one subject’s block:

Here is an example event file of the first trial of the subject’s above block:
first trial: https://drive.google.com/file/d/1MSIXTGXroa_xigq3Rg9zwhNwlN7EGxA8/view?usp=sharing

Here is an example event file of the second trial of the subject’s above block. I resettled the initial event time to 0 for each trial file, but not sure if I am supposed to do so:
second trial: https://drive.google.com/file/d/18PrTzsDYTDv9SbfxrrqyOFp6mJLv-SrR/view?usp=sharing

Please let me know if you need more information from me.

Best,
Lily