Hello,
First, apologies if my question is laughingly stupid, I’m a beginner very confused about the output of the ‘compute_contrast()’ function.
I’m using nilearn for an exploratory first level analysis of fMRI data. We have an experiment with 10 conditions, say “cond1” to “cond10”, on a lot of subjects and sessions, and we want to compute some contrasts.
However, as we don’t know yet which contrasts we’re interested in, we don’t want to list all possible combinations of conditions; instead, we want to save the activation map for all conditions and later decide on our contrasts.
My idea was to save the raw activation map of each of the ten conditions, plus the conditions variance map, to have the flexibility of computing any contrast that we want, later. The basic idea of the code is to iterate over each subject and session, fit the GLM and save the following maps:
raw_map_1 = glm.compute_contrast(contrast_def="cond1", stat_type="t", output_type="effect_size")
residual_map_1 = glm.compute_contrast(contrast_def="cond1", stat_type="t", output_type="effect_variance")
# ...
raw_map_10 = glm.compute_contrast(contrast_def="cond10", stat_type="t", output_type="effect_size")
residual_map_10 = glm.compute_contrast(contrast_def="cond10", stat_type="t", output_type="effect_variance")
Now say that I want to compute a t-map for contrast “cond1 - cond5”, how should I proceed? Is it simply a matter of computing (raw_map_1 + raw_map_5) / sqrt(residual_map_1 + residual_map_5)
?
Does this approach even make sense?
Thank you so much for your help, and sorry again for the dumb question.