I have a BIDS-compliant events.tsv file that includes onset and duration columns, as well as many columns specifying aspects of the presented stimuli, as well as the subjects’ responses (e.g., cue, fix, feedback, gain, loss, but NOT trial_type). I am trying to use nilearn.glm.first_level.FirstLevelModel to ultimately obtain the residuals from a GLM using all of the columns from my events.tsv file, considering my main goal is to use the residuals from the task fMRI data as pseudo resting state data.
I get the following warning for each of the columns other than onset and duration:
/Users/flutist4129/Library/Python/3.8/lib/python/site-packages/nilearn/glm/first_level/experimental_paradigm.py:89: UserWarning: Unexpected column `fix2` in events data will be ignored.
warnings.warn(("Unexpected column `{}` in events "
and the following warning (I think nilearn requires a trial_type column, even though BIDS does not):
/Users/flutist4129/Library/Python/3.8/lib/python/site-packages/nilearn/glm/first_level/experimental_paradigm.py:74: UserWarning: 'trial_type' column not found in the given events data.
warnings.warn("'trial_type' column not found "
Is there a way to get nilearn.glm.first_level.FirstLevelModel to recognize that I can have columns other than trial_type that define the task? And that I do not need a trial_type column?
Okay. Good to know. Would it be possible to configure nilearn.glm.first_level.FirstLevelModel to work with any valid BIDS events.tsv file? Right now, nilearn requires there to only be onset, duration, and trial_type, but the BIDS specification only requires onset and duration, and allows for an arbitrarily large number of indicator columns specifying the task.
Just a note, I confirmed that my data is BIDS-valid by running the BIDS-validator.
thx for bringing this up. Just wanted to make sure I understand this correctly: the idea would be to support a structure within which events.tsv has at least three columns including onset, duration, trial_type but could also have an arbitrary number of columns where the first two are onset & duration and whatever columns follow entail further task specifications, e.g. trial_type, reaction_time, intensity, etc.? Also looping in @tsalo as could also go into the direction of BIDS stats models, eh?
Yes, but also column names that aren’t explicitly stated in the manual. I am having trouble finding this in the online rendering, but when you download the pdf of BIDS v1.7 you can see on page 34 an example of a task-specific column in the events.tsv file called stim_presentation_side, and on page 170 the specification states the following: “An arbitrary number of additional columns can be added. Those allow describing other properties of events that could be later referred in modelling and hypothesis extensions of BIDS. Note that the trial_type and any additional columns in a TSV file SHOULD be documented in an accompanying JSON sidecar file”. Here’s a screenshot of one of my files as an example (*.tsv files apparently can’t be attached):