nipreps / fmripost-rapidtide

A BIDS App for running rapidtide on a preprocessed fMRI dataset.
https://fmripost-rapidtide.readthedocs.io
Apache License 2.0
2 stars 1 forks source link

Characterize FC inflation with post-rapidtide figure? #14

Closed tsalo closed 1 month ago

tsalo commented 1 month ago

What would you like to see added in fMRIPost-Rapidtide?

@bbfrederick WDYT about including a step after the rapidtide part that measures and plots FC inflation from the preprocessed, confound-denoised, and rapidtide-denoised data?

Do you have any interest in helping implement the feature?

Yes

Additional information / screenshots

No response

bbfrederick commented 1 month ago

I like that idea! It may be a little hard to get good SNR on an individual run - judging the amplitude of a single noise signal over time is a bit tricky, but it's worth a go. I think the best way to do that would be: 1) Derive the sLFO regressor using rapidtide 2) Calculate a filtered RMS envelope function (square the signal, lowpass filter, take the square root). 3) Do a linear fit to the filtered RMS function and compare the amplitude at the beginning and end of the run.

I'll cobble something together and put it into rapidtide.

tsalo commented 1 month ago

I thought FC inflation was characterized as the mean z-value across pair-wise correlations in an atlas for a 60-TR sliding window? Is the RMS envelope an alternative you came up with after the Korponay paper?

bbfrederick commented 1 month ago

Ah, yes. The sliding window method would be better, and would probably be more stable (and informative) on individual subjects. We had observed that FC inflation tracks with the sLFO amplitude, so in my head I think of them interchangeably. Cole put his sliding window code on GitHub somewhere - I think it just calls some AFNI tools, so it should be easy to add.

tsalo commented 1 month ago

I took a look at that last night and I think I can reproduce it in Python pretty easily (Nilearn does a lot of the heavy lifting).

If there are other measures worth tracking/plotting, I'm happy to add them.

With the BIDS App, we can also implement the rare analysis level "group" to aggregate measures and generate plots using the whole dataset, like MRIQC's group-level HTML report has, so if there are things that don't tend to show up at the subject level, then perhaps the group-level report will be helpful.

ckorponay commented 1 month ago

Hey Taylor, Blaise looped me in. I think adding this feature is an excellent idea. A few recommendations:

1) The 60TR sliding window works well for long scans like in HCP, but for more typical scan lengths 60TR windows doesn't give you very many data points. In the paper we were able to track FC inflation in shorter scans just fine using 30TR windows, so I'd suggest using 30TR windows.

2) Would suggest adding a metric(s) to quantify FC inflation alongside the graph. We used A) percent increase in FC in the last window relative to the first window, B) 'Avg FC in 2nd Half of Scan' minus 'Avg FC in 1st Half of Scan', and C) correlation of FC with time.

3) The 30TR window size grabs enough data to make the trends fairly clear at the subject-level, but I'd also definitely second the suggestion to add the group-level graphs/metrics as well. (Maybe stats comparing the before and after useful as well)

Let me know if I can be of any further help!

Cole

tsalo commented 1 month ago

I like all those ideas! Thanks!

bbfrederick commented 1 month ago

One thing - it might be better to define the connectivity windows in terms of time rather than TRs, so that datasets would be comparable. For the 30TR datasets, what was the TR? We should do that number of seconds.

tsalo commented 1 month ago

I believe the paper used HCP-YA, so that would be a 0.72 second TR. 30 TRs is ~21.6 seconds.

ckorponay commented 1 month ago

Is this all live/operational now?

tsalo commented 1 month ago

The QC measures are in the workflow, but the workflow itself isn't fully working yet. I think I still need a modified version of RetroGLM on rapidtide's end to get everything working in #17.