bbfrederick / rapidtide

rapidtide - a suite of programs for doing time lag correlation analysis on fMRI data
Apache License 2.0
75 stars 14 forks source link

Clarification about using freesurfer-produced segmentations in denoising #147

Closed themeo closed 5 months ago

themeo commented 5 months ago

This is not a bug, but rather a request for clarification in the documentation. In the new version of rapidtide, there is a section about using fmriprep:

In addition, if you do the analysis in standard space, it makes it easier to use freesurfer parcellations and gray/white/csf segmentations that fmriprep provides for further tuning the rapidtide analysis.

I was curious about how freesurfer could be used to further finetune rapidtide and why it would only make sense in the standard space (and not anatomical space)? It would be great if the documentation provided some more hints about this!

bbfrederick commented 5 months ago

First of all, I can't tell you how gratifying it is that somebody is reading the documentation. I just did a major revamp - the section you are referring to is new as of 3 days ago!

The section you quote is a placeholder for a more detailed section I plan to write on analysis tuning. Basically, you can stabililze and improve rapidtide's delay estimation quite a bit by making sure you have a good starting regressor, and do refinement in "good" brain regions that don't have wacky delay structures (I go into this a bit here: https://rapidtide.readthedocs.io/en/latest/theoryofoperation.html#initial-moving-signal-estimation). While just about anything works well in young, healthy subjects (like the HCP-YA dataset), as people get older, their delays become weird - my working theory is that over time various routine vascular insults and unhealthy habits accumulate, leading to increasing heterogeneity between vascular territories (which I like to call "vascular personality"). So the global mean may be made up of several pools of blood, delayed by up to several seconds from each other, leading to weird autocorrelation that can confuse my delay finding algorithm, because it invalidates my assumption that the global mean is a good initial estimate of the "true" moving regressor. One way to combat this is to limit the brain region that you get your initial regressor from. For an Alzheimer's study that I am currently working on, we ended up starting only from blood in right and left cerebellar gray matter (aparc+aseg regions 8 and 47) on the theory that if circulation in your cerebellum is too messed up, you're dead, so would not be in the dataset. That made our delay estimates work a lot better. So we used the freesurfer parcellations from fmriprep, transformed to standard space, to do that preselection, using the option --globalmeaninclude standardspaceaparc+asegfilename.nii.gz:8,47.

As to anatomic versus standard space - it's not that it doesn't make sense to process things in anatomic space, it's just that to my way of thinking, if you're going to bother transforming the functional data to some space, you might as well go all the way to a standard space like MNI152NLin6Asym, because then you can combine your data from different subjects with no further work. If you were doing something clinical though, you'd probably want to stay in anatomic space.

themeo commented 5 months ago

I keep tabs on rapidtide's development because it has delivered the most significant improvement to my data quality, and I'm occasionally on the lookout for further enhancements.

Thanks for the detailed response (and promptly updating the documentation!) It all makes perfect sense.

My use case is within-subject encoding/decoding, so I prefer using a space that undergoes minimal transformations, such as affine. I have already experimented with the cerebellar mask from freesurfer. In my case, it didn't result in a substantial increase in ceiling encoding scores, which is likely due to the youth of my participants. Nonetheless, it sounds like a good default practice.

Thanks for all your work on this project!