2nd level analysis in SPM12 or FSL

277 views
Skip to first unread message

Debora Toro

unread,
Jul 23, 2021, 4:34:08 AM7/23/21
to HCP-Users
Hi Everyone!
I've download tfMRI analysed data (social task) from 1200 release. My purpose with this data is to do some 2nd level analysis in SPM12 or FSL but neither support CIFTI files. How can I solve this problem? 
thank you 

Debora

Glasser, Matthew

unread,
Jul 23, 2021, 7:38:44 AM7/23/21
to hcp-...@humanconnectome.org

You can do it in FSL.  This script gives an example how:

 

https://github.com/Washington-University/HCPpipelines/blob/level3-task-fmri-analysis/TaskfMRIAnalysis/TaskfMRILevel3.sh

 

You may wish to use PALM for multiple comparison correction.

 

Matt.

--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/de4ad315-673d-48e2-96ef-109cc15136f9n%40humanconnectome.org.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Frederik Bergmann

unread,
Jul 11, 2024, 2:59:33 PM7/11/24
to HCP-Users, glas...@wustl.edu
Hi I know this is a very old post but because I am working on this right now myself I thought I write down my thoughts:

The taskbatch.sh scripts, relying on FSL, don't really work when you have empty EV files. Say if you have a memory experiment, and only some items were remembered from a certain condition and this varies across subjects you may end up getting an empty output file or an error message.
You can of course exclude runs or subjects where an EV file for a condition would be empty but that way you may end up losing a lot of data and sometimes that may not be a viable option.
That's why you may want to use some other software, for example SPM, which can handle missing onsets for a condition and which also comes with the advantage of a nice GUI and easy inspection of results, and perhaps even the utilities of other toolboxes (not sure).

When using SPM you have two options:
A) You will first need to carve the cifti file into surface and subcortex. I recommend joining left and right hemisphere into one large surface for more accurate family wise error correction. For surface first-level SPM will create .gii output files together corresponding .dat files. You can do first and second level stats as usual. Search for: unsure why SPM12 unable to load GIFTI files during 1st-level Analysis in https://www.jiscmail.ac.uk

B) You can also convert your ciftis into fake-nifti data (as was done here: https://doi.org/10.1002/hbm.25734 ), and submit those to SPM. Then convert the fakenifti con_maps of the first-level back to surface and volume files (LH, RH, subcortex) and then perform second level stats with PALM on them. It's a little awkward but it works. PALM takes ages to run though.

Regardless of whether you pick SPM or PALM, however, they both have a flaw in that correction for multiple testing becomes awkard as you need to separate your data into surface and volume and calculate stats independently for both.

Regarding SPM's FWE correction: random field theory would have to be applied separately to the cortical and subcortical maps, resulting in two separate corrections / outputs. If you later combine these data, the combined map wouldn't really have a unified, equivalent correction for multiple comparisons across surface and volume, which might lead to incorrect inferences. I am not sure, though, how to obtain FWE correction for a volume-surface merged version. Any ideas how to write a workaround in SPM? Isn't there a cifti toolbox for SPM now?

When using PALM and you combine, say LH.gii, RH.gii and subcortex.nii, you should correct the significance threshold: Either via Bonferroni, i.e., -log10(alpha/N) = -log10(0.05/3) = 1.7782, or with Šidák, i.e., -log10(1-(1-alpha)1/N) = -log10(1-(1-0.05)1/3) = 1.7708. You basically divide by three (N) because you have three separate tests of tests: LH, RH, and volume. But I am not sure whether this really accurately corrects the p-values, because the different brain parts have different numbers of vertices/voxels: there are different numbers of vertices in the hemispheres and there is a much smaller number of voxels in the volumetric part. And would you have to divide by two instead of three if you were to submit one giant CORTEX surface .gii plus subcortex .nii?

Frederik Bergmann

unread,
Jul 14, 2024, 4:57:46 PM7/14/24
to HCP-Users, Frederik Bergmann, glas...@wustl.edu
Well theoretically,

I just tried to run the SPM analysis and get all-zero output .gii files on the second level.
What is weird, is that the first level works fine and the output con .gii images look plausible and do not contain any NaN values, nor are there any empty or all-zero con images. I also don't get any error message.

Is there a way to check whether the first level con map .gii files are in the correct gifti format? And to automatically correct their format if necessary?

If anyone has an idea what might be wrong please respond to this!
Reply all
Reply to author
Forward
0 new messages