[RESOLVED] rsfMRI analysis


I need help regarding rsfMRI analysis of HCP data. We aim to explore the effect of depression using self report measure on functional connectivity. I found the following message posted by QuNex expert on HCP forum and would like to seek help regarding how to map it back to the matrix and generate a pconn file. Could someone share the PALM command that can be used to run the GLM model on N*1 vector and using depression rating as design matrix? Should I use pearson? Any help would be greatly appreciated.

The group analysis in this case is somewhat complex and currently there is no dedicated command to perform it in PALM using QuNex. The issue is that each file holds a full parcellated connectome, which is a N x N matrix (with N being the number of parcels). The current QuNex commands for working with PALM expect the individual data to be N x 1 vectors (e.g., a single activation map, a seed-based connectivity map, or a GBC map). To run the group analysis on the whole connectome, I would suggest exporting the pconn file to a text file, removing the upper (or lower) triangle of the matrix, unwrapping the matrix to a vector, running PALM on the text (csv) file, in which each row is a subject and each column is a specific parcel-to-parcel Fz value, and then mapping the results back to a matrix and a pconn file for visualization.

Shruti, hello!

For specific PALM command, it would be best if you consult PALM manual on how to use .csv files as data input, and how to correctly specify a design matrix. In terms of PALM input, you will have a M x N matrix, where N is the number of datapoints (unwrapped connectivity matrix) and M is the number of participants. The design matrix would then be M x 1 vector of depression ratings and the parameter of interest can be Pearson correlations.

In terms of mapping the values back into a pconn file, you can use QuNex Matlab code to accomplish that. What you would need to do is open a single subject pconn file (e.g., img = nimage('some_file.pconnb.nii'), that you can use as template. You can then replace the data in img.data with the data you obtained using PALM reconstructed back into full connectivity matrix. After than you can save the resulting file using img.img_save('<new file name>.pconn.nii").

I hope this helps. You can use the reading function also to read the original pconn, extract the data, unwrap the matrix and save in the csv file.

If you need more specific help, let me know.

All the best,


Hi Shruti,

Did we manage to help you out on this, or do you still have any questions or issues that we can help you with?

Best, Jure


Thanks a lot for the reply. I haven’t yet tried the method posted on the QuNex forum, as I didn’t receive any notification earlier. I will let you know after trying. Could you tell if QuNex can be used to generate a connectome ring? Or is there any other tool? I am only able to visualise the ROI on the workbench, but I am looking for a better visualisation tool for functional connectivity.



Hi shruti,

As far as I know (could be wrong though), more advanced visualizations (like the connectome ring) need to be prepared in specialized visualization tools manually.

Best, Jure

Okay, thank you very much. Sorry to bother you again. Can you refer any tool?

  1. Will Brain Net Viewer work?
  2. Which stat values do I need to input to show connectivity?


I am not familiar with Brain Net Viewer. The pconn file contains a matrix that is sized NxN, where N is the number of parcels in the parcellation. In each cell, you have the grade of the connectivity that is calculated via an FC measure (say correlation, covariance, mutual information …). When we prepare visualizations we usually do it manually in R or Python. We convert the pconn to a .csv with wb_command (Connectome - Workbench Commands), you can then load the connectome into a data frame in the programming language and use the standard plotting libraries (e.g., ggplot2). There are many specialized tools for “ring” plots, also called circos plots (Making genomic data come alive with circos plots | by Maria Nattestad | Medium, BioCircos: Generating circular multi-track plots). I assume this is what you mean with ring connectome?

Best, Jure

Yes, I am planning to generate a same plot using MATLAB as depicted in the paper shared ( (Making genomic data come alive with circos plots | by Maria Nattestad | Medium, BioCircos: Generating circular multi-track plots).

Thank you very much. I will look for a corresponding package in MATLAB. Thanks a ton!