I've been struggling to interface fmriprep outputs to the fsfast first level analysis pipeline and was wondering if this problem had been solved by the community?
I've got a start for the surface spaces attached here:
fsfast_surface_example.txt
It runs, but there are still certain aspects (brainmask inclusion, intensity normalization, etc.) that I need to clarify (detailed more in the attached file).
The subcortical volume space is trickier since fsfast requires re-registration to the T1 even though the output of fsfast is already in T1 space and I'm not sure how to circumvent this re-registration yet.
I realize that these issues probably rely on seeking help from the fsfast team, but I wanted to post here as well because this may be a specific case of a broader documentation issue (also in case someone had solved this already). I am a big fan of the fmriprep tool, but I have found it difficult to find documentation on how to use the outputs for downstream analyses. Different neuroimaging tools each have their own formats and structures. I also haven't seen a python implementation for first levels yet which would be ideal and haven't felt confident enough to extract myself due to uncertainty about the auto-correlation correction approaches.
It could be worth augmenting the documentation with details on how to interface with different analysis pipelines?
I'll answer to your questions in reversed way:
It could be worth augmenting the documentation with details on how to interface with different analysis pipelines?
Totally. We are making steps towards that direction, but all the work is still very premature. All contributions to documentation on this line will be more than welcome.
I realize that these issues probably rely on seeking help from the fsfast team, but I wanted to post here as well because this may be a specific case of a broader documentation issue (also in case someone had solved this already). I am a big fan of the fmriprep tool, but I have found it difficult to find documentation on how to use the outputs for downstream analyses. Different neuroimaging tools each have their own formats and structures. I also haven't seen a python implementation for first levels yet which would be ideal and haven't felt confident enough to extract myself due to uncertainty about the auto-correlation correction approaches.
Totally agreed. Thanks for your support.
Subcortical surfaces (#335) is an overdue feature request. Any effort to implement it will be very welcome. This code shows how to extract surfaces, as specified in a model of labels from the Aseg atlas. Eventually, I'll migrate that code, but for now it could serve as inspiration to create the subcortical surfaces.
Other than that, your script seems reasonable to me. As you mention, I guess that FSFAST authors are probably best to answer your questions.
If you finally manage to deal with these problems, we will be more than happy to add your scripts as examples to the documentation. Please send them in a PR!
@oesteban Just to quickly note that subcortical analysis in FSFAST isn't the same as subcortical meshes. They just remove the cortex and run volumetric analysis (in MNI305 space) in FSFAST.
Thanks for your answer! Glad to see I'm on the same page. I'll continue to work on this interface and will be sure to share when it's worked out.
Hi @mattboggess, any bottlenecks we could help with? We are right now reconsidering priorities, please let us know if you are still interested in this.
Just to link in a couple FreeSurfer mailing list threads for reference:
Hey sorry I've been so slow on this. I'm currently waiting on an answer on the freesurfer mailing list to see if there is an easier way to transform the output to fsfast's MNI305 volume space. Doug first suggested just to re-register everything, but I'm hoping there is a simpler approach since the fmriprep output is already in T1 space. I'll follow up on the email since it's been a while.
Ok so here is a script that will take fmriprep outputs for a single subject and task into the fsfast common spaces (fsaverage surface and mni305 subcortical) and directory structure.
fmriprep_to_fsfast.txt
Unfortunately there didn't seem to be a better solution for the mni305 spatial normalization so this script just reruns all the fsfast preprocessing steps necessary to move the volume data to mni305 space.
One should be able to then proceed with first levels starting with mkanalysis-sess as normal except that the -no-mask flag needs to be added for the cortical data. I don't believe the mask does anything for the cortical data, but the first levels script still looks for it as it is normally generated by preproc-sess command.
Cool, thanks. I'm a little confused about the MNI305 bit, just because we have the transforms from T1w space to FreeSurfer-aligned; or do they calculate a per-run transform from BOLD to MNI305?
They do a per-run transform from BOLD to MNI305, using bbregister to first register the BOLD template to T1 and then mri_vol2vol to convert to mni305 using this registration.
Okay, so it is a BOLD-T1-template mapping. That's consistent with how we do it. So it should just be a matter of applying the affine transform from T1w to T1.mgz, and then their MNI305 registration.
Most helpful comment
@oesteban Just to quickly note that subcortical analysis in FSFAST isn't the same as subcortical meshes. They just remove the cortex and run volumetric analysis (in MNI305 space) in FSFAST.