<p>Usually, but not always, fMRI timeseries are used to compute functional connectivity by calculating Pearson correlations among voxels or ROIs.</p>
<p>The equation for the Pearson correlation <a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient" rel="nofollow noreferrer">can be written as</a>:</p>
<p><span class="math-container">$$\rho_{X,Y} = \frac{\mathbb{E}\left[ (X-\mu_X)(Y-\mu_Y)\right]}{\sigma_X \sigma_Y}$$</span></p>
<p>(<a href="https://i.sstatic.net/nNRA5.png" rel="nofollow noreferrer">screenshot</a>)</p>
<p>As you can see, the numerator involves subtracting the mean of <span class="math-container">$X$</span> from <span class="math-container">$X$</span> and the mean of <span class="math-container">$Y$</span> from <span class="math-container">$Y$</span>; when you're computing Pearson correlations on a large scale it's typically most computationally efficient to first <span class="math-container">$z$</span>-score the data, so that the mean is 0 and SD is 1, which saves a couple computational steps for every pairwise comparison and turns it into just <span class="math-container">$\text{mean} \ (X \cdot Y$</span>).</p>
<p>Changes in the spatial distribution caused by your denoising are different than the &quot;centering&quot; part of the transformation, though.</p>

CC BY-SA 4.0
2022-04-05T08:27:48.620Z
Thank you for your illuminating response!
Now I see that as far as computing the correlation (i.e. functional graph) goes, centeirng (done by denoising) shouldn’t affected matter!

You mentioned however that the changes in spatial distribution caused by denoising might affect the “information” contained in the fmri data itself. Is this OK for most purposes? (When trying to run machine learning into this data, for instance, (i.e. analyzing data  in a way that the spatial distribution might be important), is the issue of the changes in spatial distribution usually talked about or considered?
Danny  Han
CC BY-SA 4.0
2022-04-10T09:46:36.150Z
Pardon my edit, I converted the screenshot of the equation to MathJax and made a few more MathJax replacements as well. Feel free to roll back, edit further, etc.
uhoh
CC BY-SA 4.0
2022-04-04T15:13:21.000Z
2022-04-10T19:08:38.653Z
2022-04-10T19:08:38.653Z
Bryan Krause
<p>I was denoising fMRI data using GLM and had a question regarding the “data” of fMRI in general.</p>
<p>(For reference you can look at the “GLM” part of <a href="https://fmriprep.org/en/stable/outputs.html" rel="nofollow noreferrer">https://fmriprep.org/en/stable/outputs.html</a> or <a href="https://www.sciencedirect.com/science/article/pii/S1053811917310972" rel="nofollow noreferrer">https://www.sciencedirect.com/science/article/pii/S1053811917310972</a>)</p>
<p>Below is a time series of the before/after GLM for a given voxel: <a href="https://i.sstatic.net/iDHcb.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iDHcb.jpg" alt="enter image description here" /></a></p>
<p>As you can see, the raw values (actually we went through a preprocessing step prior to GLM denoising) had a value of around <span class="math-container">$600\pm 50$</span>, while the residual (i.e. denoised data) had a value around <span class="math-container">$0\pm 50$</span>. In other words, it seems that via GLM, the raw data was somewhat “centered”. At first I thought this was OK, as I thought that only the fluctuations of the data matter (i.e. I had this assumption that mean centering doesn’t remove any information in the data). However, I realized that when we did this, the spatial distribution of signal values before and after GLM changes, as the pictures below show (the picture below is the distribution of fMRI signal for a given time point before and after GLM denoising) :
<a href="https://i.sstatic.net/WPTE0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WPTE0.png" alt="enter image description here" /></a>
<a href="https://i.sstatic.net/rhAiS.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rhAiS.jpg" alt="enter image description here" /></a></p>
<p>Is this OK?</p>
<p>In other words,</p>
<ul>
<li>does only the “fluctuations” (across time) of the data matter in fMRI (i.e. is adding a constant to an fMRI time series data irrelevant?).</li>
<li>if so, then since adding a constant to an voxel’s time series data is irrelevant, it stands to reason that if I add different constant values to different voxels (for example as part of a detrending step), the spatial distribution of values before and after would change. Is this OK? (In other words, does the distribution of fMRI signals for a given time point meaningless?)</li>
</ul>
<p>Thank you :)</p>

<neuroscience><neuroimaging><fmri>
Does only the time-series data of fMRI matter or does spatial distribution of the signal values also matter?
Danny  Han
# Does only the time-series data of fMRI matter or does spatial distribution of the signal values also matter?

(Asked by: username_0 on 2022-04-04)

I was denoising fMRI data using GLM and had a question regarding the “data” of fMRI in general.

(For reference you can look at the “GLM” part of <https://fmriprep.org/en/stable/outputs.html> or <https://www.sciencedirect.com/science/article/pii/S1053811917310972>)

Below is a time series of the before/after GLM for a given voxel: [![enter image description here](https://i.sstatic.net/iDHcb.jpg)](https://i.sstatic.net/iDHcb.jpg)

As you can see, the raw values (actually we went through a preprocessing step prior to GLM denoising) had a value of around $600\pm 50$, while the residual (i.e. denoised data) had a value around $0\pm 50$. In other words, it seems that via GLM, the raw data was somewhat “centered”. At first I thought this was OK, as I thought that only the fluctuations of the data matter (i.e. I had this assumption that mean centering doesn’t remove any information in the data). However, I realized that when we did this, the spatial distribution of signal values before and after GLM changes, as the pictures below show (the picture below is the distribution of fMRI signal for a given time point before and after GLM denoising) :
[![enter image description here](https://i.sstatic.net/WPTE0.png)](https://i.sstatic.net/WPTE0.png)
[![enter image description here](https://i.sstatic.net/rhAiS.jpg)](https://i.sstatic.net/rhAiS.jpg)

Is this OK?

In other words,

* does only the “fluctuations” (across time) of the data matter in fMRI (i.e. is adding a constant to an fMRI time series data irrelevant?).
* if so, then since adding a constant to an voxel’s time series data is irrelevant, it stands to reason that if I add different constant values to different voxels (for example as part of a detrending step), the spatial distribution of values before and after would change. Is this OK? (In other words, does the distribution of fMRI signals for a given time point meaningless?)

Thank you :)

**Tags:** neuroscience, neuroimaging, fmri


---

## 1 answers

### Answer by username_1 on 2022-04-04. Score: 3 | Accepted answer

Usually, but not always, fMRI timeseries are used to compute functional connectivity by calculating Pearson correlations among voxels or ROIs.

The equation for the Pearson correlation [can be written as](https://en.wikipedia.org/wiki/Pearson_correlation_coefficient):

$$\rho\_{X,Y} = \frac{\mathbb{E}\left[ (X-\mu\_X)(Y-\mu\_Y)\right]}{\sigma\_X \sigma\_Y}$$

([screenshot](https://i.sstatic.net/nNRA5.png))

As you can see, the numerator involves subtracting the mean of $X$ from $X$ and the mean of $Y$ from $Y$; when you're computing Pearson correlations on a large scale it's typically most computationally efficient to first $z$-score the data, so that the mean is 0 and SD is 1, which saves a couple computational steps for every pairwise comparison and turns it into just $\text{mean} \ (X \cdot Y$).

Changes in the spatial distribution caused by your denoising are different than the "centering" part of the transformation, though.

> **Comments:**
> **username_0**: Thank you for your illuminating response! Now I see that as far as computing the correlation (i.e. functional graph) goes, centeirng (done by denoising) shouldn’t affected matter!  You mentioned however that the changes in spatial distribution caused by denoising might affect the “information” contained in the fmri data itself. Is this OK for most purposes? (When trying to run machine learning into this data, for instance, (i.e. analyzing data  in a way that the spatial distribution might be important), is the issue of the changes in spatial distribution usually talked about or considered?  
> **username_2**: Pardon my edit, I converted the screenshot of the equation to MathJax and made a few more MathJax replacements as well. Feel free to roll back, edit further, etc.  

---

