<p>I have a single subject data(T1w and rs-fMRI BOLD). I am wanting to generate functional connecitivty matrix after preprocessing the raw fMRI. I already used CONN toolbox to do the entire preprocessing. I have now completed the first-level analysis as well. </p>

<p>Since I am wanting to calculate FC matrix, I have computed ROI-to-ROI connectivty during first-level analysis. I belieive this is the correct way forward. I am having the output file named "resultsROI_Subject###_Condition###.mat". Can someone please show me how to compute FC matrix values using this file.</p>

<p>I am extracting 'Z' values from "resultsROI_Subject###_Condition###.mat". I am then calculating correlation coefficients of Z using MATLAB 'corrcoef' function. So the resultant matrix that I get after doing this MATLAB operation, is it the FC matrix that I want?</p>

<p>Here is the Z matrix obtained after running CONN preprocessing pipeline. Z is of size (RoI<span class="math-container">$\times$</span>RoI). Here, the number of RoI is 105. Z represents Fischer-transformed correlation coefficient between each source and target RoI.</p>

<p><a href="https://i.sstatic.net/8RVFa.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8RVFa.jpg" alt="Z matrix - 105x105"></a></p>

<p>Here is the result after applying MATLAB tanh function.
MATLAB code -> <code>Z_tanh = tanh(Z);</code></p>

<p><a href="https://i.sstatic.net/Jd0iz.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Jd0iz.jpg" alt="Z_tanh"></a></p>

CC BY-SA 4.0
2019-07-05T19:37:15.230Z
I haven't used that specific toolbox, but is this not covered at https://web.conn-toolbox.org/tutorials ?
Bryan Krause
CC BY-SA 4.0
2019-07-06T08:41:38.710Z
No, its not given there.
zoozoo
CC BY-SA 4.0
2019-07-06T09:01:50.393Z
Given that FC is kind of the bread and butter of fMRI I am skeptical you should need to do this manually with a distributed package...
Bryan Krause
CC BY-SA 4.0
2019-07-06T11:22:15.147Z
I've been talking behind the scenes with other mods. Across the SE network we kind of lack the expertise in this field. Another mod suggested you 'computerize' your Q and enter some code and some outputs so people can have more insight in the code issues. Even then it may not be answerable, but then we could migrate it to another site for you with more computer science experts.
AliceD
CC BY-SA 4.0
2019-07-09T09:15:32.967Z
Added matrix visualizations and MATLAB function for transformation.
zoozoo
CC BY-SA 4.0
2019-07-09T14:52:18.213Z
@AliceD The answer now with the edits is "yes", but I am uncertain how to answer with more than what I just wrote or what would be a suitable reference. I don't think migration to another SE site will be that helpful, though.
Bryan Krause
<fmri>
How to generate functional connectivity matrices after first-level analysis in CONN toolbox?
zoozoo
# How to generate functional connectivity matrices after first-level analysis in CONN toolbox?

(Asked by: username_0 on 2019-07-04)

I have a single subject data(T1w and rs-fMRI BOLD). I am wanting to generate functional connecitivty matrix after preprocessing the raw fMRI. I already used CONN toolbox to do the entire preprocessing. I have now completed the first-level analysis as well.

Since I am wanting to calculate FC matrix, I have computed ROI-to-ROI connectivty during first-level analysis. I belieive this is the correct way forward. I am having the output file named "resultsROI\_Subject###\_Condition###.mat". Can someone please show me how to compute FC matrix values using this file.

I am extracting 'Z' values from "resultsROI\_Subject###\_Condition###.mat". I am then calculating correlation coefficients of Z using MATLAB 'corrcoef' function. So the resultant matrix that I get after doing this MATLAB operation, is it the FC matrix that I want?

Here is the Z matrix obtained after running CONN preprocessing pipeline. Z is of size (RoI$\times$RoI). Here, the number of RoI is 105. Z represents Fischer-transformed correlation coefficient between each source and target RoI.

[![Z matrix - 105x105](https://i.sstatic.net/8RVFa.jpg)](https://i.sstatic.net/8RVFa.jpg)

Here is the result after applying MATLAB tanh function.
MATLAB code -> `Z_tanh = tanh(Z);`

[![Z_tanh](https://i.sstatic.net/Jd0iz.jpg)](https://i.sstatic.net/Jd0iz.jpg)

**Tags:** fmri

> **Comments:**
> **username_1**: I haven't used that specific toolbox, but is this not covered at https://web.conn-toolbox.org/tutorials ?  
> **username_0**: No, its not given there.  
> **username_1**: Given that FC is kind of the bread and butter of fMRI I am skeptical you should need to do this manually with a distributed package...  
> **username_2**: I've been talking behind the scenes with other mods. Across the SE network we kind of lack the expertise in this field. Another mod suggested you 'computerize' your Q and enter some code and some outputs so people can have more insight in the code issues. Even then it may not be answerable, but then we could migrate it to another site for you with more computer science experts.  
> **username_0**: Added matrix visualizations and MATLAB function for transformation.  
> **username_1**: @username_2 The answer now with the edits is "yes", but I am uncertain how to answer with more than what I just wrote or what would be a suitable reference. I don't think migration to another SE site will be that helpful, though.  

---

## 0 answers

