-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split regressor estimation and denoising steps #17
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17 +/- ##
==========================================
+ Coverage 29.03% 30.13% +1.10%
==========================================
Files 25 25
Lines 2328 2432 +104
Branches 349 276 -73
==========================================
+ Hits 676 733 +57
- Misses 1642 1679 +37
- Partials 10 20 +10 ☔ View full report in Codecov by Sentry. |
I'm ok with making this change, but why is this needed? If you run rapidtide, even at EDIT: Ah, I see - you're warping files AFTER running rapidtide and before running retroglm. Still, as long as you follow the naming convention, you can still give a |
That's a good point. I can reconstruct a rapidtide-esque directory to feed into RetroGLM. In that case I think I just need the ability to generate the voxel-wise LFO regressor file in each target space. Can you remind me how to do that without doing any denoising? |
I've added a new script - You give it an fmrifile (for dimensions), the corrmask, processed mask, lag map, and lagtcgenerator, and it will generate voxel specific shifted LFO regressor file (and derivative files, if requested). It currently just reads in the fmrifile, but I just realized I can get all the necessary information just from the header, so I'll do that when I have a moment. fmrifile, cormask, processed mask, and lag map have to have matching spatial dimensions. The lagtcgenerator can be used unchanged from the initial rapidtide run. |
Thanks! Just curious, why does it need both the corrmask and the processed mask? Wouldn't just the processed mask be enough? |
To be honest, I just copied that out of retroglm. It probably just needs corrmask (which you could give it twice, I guess). Processed mask is all the voxels you can attempt to fit ("valid voxels"), corrmask is all the places the fit succeeded. In practice they are usually almost identical. I guess the question is, in a nominally valid voxel, where for whatever reason rapidtide could not decide on a delay, is it better to do nothing, or regress out the LFO at zero time delay (because if there is a delay value for that voxel, it's unreliable)? 🤷🏻♂️ - I don't feel strongly one way or the other. EDIT: I suppose I could just pass one mask, and you can decide if you want that to be the corrmask or the processed mask. |
Now it's one mask in 2.9.8.1. I also only read the header of the fmrifile, so it should be lighter on RAM. |
...and now it's 2.9.8.2, because I made a stupid mistake and you can't redeploy to pypi with the same release tag... |
Thanks so much! So my plan is basically going to be:
|
That all looks good, although one thing I don't really know is how much variation in delay maps between runs within a subject is 1) rapidtide fit instability (not real) 2) the effects of other noise processes confounding the fit (not real) and 3) actual physiological variation between runs due to changing circulatory patterns (real). I think number 3 is pretty small - the fact that delay generally seems pretty stable over 5-15 minutes would argue that the delay pattern is pretty fixed, at least during resting state, but I know that Kevin Whittingstall showed that functional activation could cause acute arterial dilation upstream of a strongly activated region, which I think would probably shift the timing between arterial territories. So yes, make averaging between runs an option, but maybe not the default behavior. |
Oh that's really good to know. I'll make sure it's not the default then. Now I want to dig into that, maybe with HCP-YA. |
We have a paper currently under review looking at repeatability in the HCP-YA data. I can send you a copy if you'd like. |
That would be great, thanks! Please send to salot at pennmedicine dot upenn dot edu. |
Are you waiting for me to do something on this pull request? |
No, I just haven't had time to work on fMRIPost-rapidtide for the past couple of weeks. Hopefully I'll be able to carve out some time for it in the next few. |
Ok, no problem. I just didn't want to be holding things up without knowing it. |
Closes #10.
Changes proposed in this pull request
--spcalculation
and--noglm
flags to Rapidtide interface.