Getting started with rsfMRI analysis

965 views
Skip to first unread message

Shruti Kinger

unread,
Jan 22, 2024, 9:14:39 AM1/22/24
to HCP-Users
Hi

Can someone share any source/documentation for getting started with the analysis in the Workbench? I have used the CONN toolbox in the past, but the workbench seems completely different. I need help with the following

1. Where can I enter the variables such as age, IQ, gender etc., as covariates and behavioural data as another variable?
2. CONN has something called beta maps, which are generated after analysis and contain functional connectivity values. How are those values generated in the workbench, and how can the values be?
3. How can I do individual and group-level analysis?
4. What all can be done in the terminal window?
5. How to load the structural and functional data of each individual I have shortlisted for the analysis? 

It would be of great help if someone can reply to my queries. Thanks in advance!
Shruti

Joseph Orr

unread,
Jan 22, 2024, 2:32:45 PM1/22/24
to hcp-...@humanconnectome.org
Coming from a GUI-based tool like CONN to the script based workbench will definitely involve a learning curve. All of the HCP pipelines are run through the terminal. I'd first suggest looking over the HCP Pipeline paper (https://doi.org/10.1016/j.neuroimage.2013.04.127) to get an idea of what the different pipeline scripts are and what they do. There are HCP Courses available online that describe how to run the different steps and how to enter covariates and conduct individual and group level analyses. RE: your second question, the approach to analyzing functional connectivity is pretty different between CONN and HCP; see this paper to understand the HCP approach (https://pubmed.ncbi.nlm.nih.gov/23702415/). A beta map is a statistical map from a linear regression where beta is the regression coefficient. FSL (which the HCP pipeline uses for many of the statistics steps) produces parameter estimates (PE images) and contrast parameter estimates (COPE images). The parameter estimates are (at least usually) betas and the COPEs and the result of contrasts of betas.

To receive any more specific help you should answer the following questions. What are the reasons you want to use HCP Pipelines instead of CONN, i.e., what type of analysis are you trying to accomplish? What is your research question?
--
Joseph M. Orr, Ph.D.
Associate Professor | Associate Department Head
Department of Psychological and Brain Sciences


On Mon, Jan 22, 2024 at 8:14 AM Shruti Kinger <shr...@iiitd.ac.in> wrote:
Hi Can someone share any source/documentation for getting started with the analysis in the Workbench? I have used the CONN toolbox in the past, but the workbench seems completely different. I need help with the following 1. Where can I enter
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd
--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/12a4954f-4247-4a3a-b534-c461e0c24d25n%40humanconnectome.org.

Shruti Kinger

unread,
Jan 23, 2024, 4:38:44 AM1/23/24
to hcp-...@humanconnectome.org
Thank you very much for your reply.

1. To answer your first question, the reason we planned to use Workbench is because Matthew Glasser has suggested using preprocessed files of HCP-YA dataset. Since the CONN toolbox at present does not have a step to skip preprocessing analysis/ support CIFTI, we planned to switch to the workbench for our study. The HCP team has suggested using preprocessed data unless one is trying to work on the processing methods in MRI. Therefore we planned to go ahead with the preprocessed data.

2. We plan to explore ROI-to-ROI connectivity between a few a priori regions  and maybe later between different networks. We may switch to other methods later. Currently, the aim is to analyse data of 100 individuals selected on the basis of their fear/anxiety ratings and explore the brain-behaviour (tasks performed by the individuals such as flanker inhibition task etc.) correlates.

3. I need help regarding the analysis. Does Workbench have all the available tools and scripts required for analysis and generation of beta values etc.? Do I need to use FSL alongwith Workbench?

Thanks,
Shruti

You received this message because you are subscribed to a topic in the Google Groups "HCP-Users" group.
To unsubscribe from this topic, visit https://groups.google.com/a/humanconnectome.org/d/topic/hcp-users/DuKrhP96eso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hcp-users+...@humanconnectome.org.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/CAOxRjYkghpJyNJEa1uDZYwtXwng8hXdtbS0QWexbZVH-FA-hWQ%40mail.gmail.com.

Shruti Kinger

unread,
Jan 23, 2024, 10:26:42 AM1/23/24
to hcp-...@humanconnectome.org
In continuation to the previous mail, is there any file format in the HCP dataset that can be used in the CONN toolbox for analysis? Is any GUI-based toolbox compatible with the HCP file format I can use for the analysis? 

Thanks,
Shruti

Glasser, Matt

unread,
Jan 23, 2024, 10:45:23 AM1/23/24
to hcp-...@humanconnectome.org

There may be a conflict between doing things well and doing them easily.  If you rely solely on GUI-based tools in Neuroimaging, you will end up way behind the technology curve.  You can use wb_command -cifti-parcellate to get the .dtseries.nii file parcellated and then wb_command -cifti-correlation to make a Connectome (e.g., using the HCP’s multi-modal parcellation: https://balsa.wustl.edu/file/87B9N).  You can then use the PALM software to do statistical analyses of the resulting Connectomes.

 

Matt.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Shruti Kinger

unread,
Jan 23, 2024, 10:52:14 AM1/23/24
to hcp-...@humanconnectome.org
Okay, thank you for your advice and for providing the steps to get started. 

Shruti

Andraž Matkovič

unread,
Jan 25, 2024, 3:01:21 PM1/25/24
to HCP-Users, shr...@iiitd.ac.in
Dear Shruti,

You may be interested in QuNex, a CLI-based toolbox, which includes functional connectivity and task-based analysis functionality. The latest development branch also has some new functionality for FC analysis, so be sure to read the inline documentation before using it. Also feel free to ask for help in the QuNex forum.

Best,
Andraž

torek, 23. januar 2024 ob 16:52:14 UTC+1 je oseba shr...@iiitd.ac.in napisala:

Shruti Kinger

unread,
Feb 4, 2024, 9:20:02 AM2/4/24
to hcp-...@humanconnectome.org
Hi!

After creating a 'functional_connectome.pconn' file for each participant using -cifti-correlation, I want to do within-group-level analysis in PALM. Currently, we are not extracting ROIs and just doing a whole-brain (379*379 parcel) analysis to understand the dataset and the tools. Can you provide answers to the following questions?

1. Do I have to create separate nifti/gifti files for the left cortex, right cortex, and subcortex and run a t-test separately for each file? If yes, how can I merge the three later to generate just one connectome? Where can I find the -cifti template required to convert back to cifti?

2. PALM documentation has the following code but it is for a scalar file. If I have to convert a dconn file, do I need to use COLUMN twice in the same command? 
wb_command -cifti-separate data.dscalar.nii COLUMN -volume-all data_sub.nii -metric CORTEX_LEFT data_L.func.gii -metric CORTEX_RIGHT data_R.func.gii

3. Can I directly convert the file  using -cifti-convert and run the analysis in PALM? 

4. In the HCP manual, it is mentioned that  "NIFTI-1 matrices were processed separately for left and right surface and subcortical volume data, and surface outputs were converted to GIFTI at the conclusion of analysis. Subject-level and group-level z-statistic maps were combined from left and right hemisphere cortical and subcortical gray matter into the CIFTI data format". If I convert the file into nifti format, do I still have to analyse the data separately? 

5. Is there a way to generate a connectome ring in wb view/visualisation tool?

Thanks,
Shruti



On Tue, Jan 23, 2024 at 9:15 PM 'Glasser, Matt' via HCP-Users <hcp-...@humanconnectome.org> wrote:

Glasser, Matt

unread,
Feb 4, 2024, 9:27:31 AM2/4/24
to hcp-...@humanconnectome.org, Anderson Winkler, Guo, Grace

I would also be interested in Anderson’s advice as we also plan to do some analyses of pconn files (parcels x parcels connectivity matrices) in PALM.  Anderson, how do we do this?

Thanks,

Shruti Kinger

unread,
Feb 7, 2024, 3:20:13 AM2/7/24
to hcp-...@humanconnectome.org, Anderson Winkler, Guo, Grace
Hi!

I have generated both ptseries.nii files for each of the four scans as well as pconn.nii files. To my limited understanding, I don't think the pconn.nii files can be used in PALM for group analysis like ptseries.nii. In the HCP course of 2018, the following command was provided

palm -i Y.ptseries.nii -transposedata -d M_ListSort_AgeAdj.mat -t C.con -eb EB.csv -o results_ListSort_AgeAdj -n 5000 -corrcon -logp

Could you answer the following queries regarding the analysis of ptseries.nii and pconn.nii files?

1. Since 'Y.ptseries.nii' is concatenated data of N subjects. How were the 4 rsfMRI scans of one participant incorporated? Which command to use -cifti-merge OR -cifti-average for analysing the 4 scans of one participant?

2. In the forum as well as the FAQ section, it was written to use -cifti-correlation for generating individual dense connectome files. We generated pconn.nii file for each participant. I need help in understanding the use of these correlation matrices. How can we analyse these files to generate meaningful results? I have 2 independent variables-anxiety scores and Penn Progressive Matrices task accuracy. 

3. If I want to generate parameter estimates for 10 participants' data, is the following command correct, as I have only one group?

palm -i ptseries.nii -tonly -d FearAffect.mat -n5000 -o palm_results

Thanks,
Shruti

Shruti Kinger

unread,
Feb 11, 2024, 1:55:06 AM2/11/24
to HCP-Users, Shruti Kinger, Anderson M. Winkler, Guo, Grace
Hello!

I apologise for asking the same questions again, but currently we are stuck in our project and it would be great if any suggestion could be provided regarding my previous query on how to group-level analysis to check the effect of anxiety after controlling for covariates on functional connectivity after generating ptseries.nii/pconn.nii files. I have come across one solution on one platform, which, to my limited understanding, seems correct which is

To use  N x N correlation matrix(pconn.nii) (with N being the number of parcels) and since PALM expects N x 1 vectors (e.g., a single activation map, a seed-based connectivity map, or a GBC map), export 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.

1. Could you tell if the above approach can be used?
2. How to map the results back to a matrix and generate a pconn file?

Sincerely,
Shruti

Shruti Kinger

unread,
Feb 11, 2024, 4:10:34 AM2/11/24
to hcp-...@humanconnectome.org, Anderson Winkler, Guo, Grace
Hello!

I apologise for asking the same questions again, but currently we are stuck in our project and it would be great if any suggestion could be provided regarding my previous query on how to group-level analysis to check the effect of anxiety after controlling for covariates on functional connectivity after generating ptseries.nii/pconn.nii files. I have come across one solution on one platform, which, to my limited understanding, seems correct which is

To use  N x N correlation matrix(pconn.nii) (with N being the number of parcels) and since PALM expects N x 1 vectors (e.g., a single activation map, a seed-based connectivity map, or a GBC map), export 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.

Could you tell if the above approach can be used?


Sincerely,
Shruti

Tim Coalson

unread,
Feb 12, 2024, 5:15:21 PM2/12/24
to hcp-...@humanconnectome.org, Anderson Winkler, Guo, Grace
That will treat each pair of parcels as an independent measurement.  Since they are correlations of N inputs, rather than N * (N + 1) / 2 fully independent inputs, there might be some theoretically fancier way to do the statistics, but I don't see a reason why a result that passes permutation significance testing under these assumptions wouldn't be valid.

Tim



Shruti Kinger

unread,
Feb 14, 2024, 1:34:26 AM2/14/24
to hcp-...@humanconnectome.org, Anderson Winkler, Guo, Grace
Thanks a lot for the explanation.

Sincerely,
Shruti

Anderson Winkler

unread,
Feb 16, 2024, 1:19:22 AM2/16/24
to Shruti Kinger, hcp-...@humanconnectome.org, Guo, Grace

Hi Shruti,

 

That approach is indeed valid as long as the N*(N-1)/2 measures (edges) are not what is being permuted.

 

Currently PALM will not read .pconn.nii files. So, the workaround is to unwrap the matrices and reassemble as a .csv file, one column per edge of the connectivity matrix, and one row per subject. Then feed this table into PALM as input. Once the results are ready, wrap back to the original network matrix format.

 

I was talking to Matt yesterday and it seems the modifications to accommodate .pconn.nii are relatively minor so I hope we can have the ability of operating on those files soon. Meanwhile, the above workaround should work.

 

All the best,


Anderson

 

 

From: Shruti Kinger <shr...@iiitd.ac.in>
Date: Wednesday, February 14, 2024 at 12:34 AM
To: hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>
Cc: Anderson Winkler <anderson...@utrgv.edu>, Guo, Grace <gra...@wustl.edu>
Subject: Re: [hcp-users] Getting started with rsfMRI analysis

  External Mail

  This email originated outside of The University of Texas Rio Grande Valley.
  Please exercise caution when clicking on links or opening attachments.

Shruti Kinger

unread,
Feb 16, 2024, 1:55:12 AM2/16/24
to Anderson Winkler, hcp-...@humanconnectome.org, Guo, Grace
Thank you very much for your reply. Could you explain why the approach is invalid if N*(N-1)/2 measures (edges) are what is being permuted, as it appears to be a symmetric matrix? I have attached the N*N matrix here for your reference.

I am sorry if what I am asking is very rudimentary. I just want to make sure that our project is on the right track.

Thanks,
Shruti
correlation_matrix.mat

Anderson Winkler

unread,
Feb 16, 2024, 1:48:05 PM2/16/24
to Shruti Kinger, hcp-...@humanconnectome.org, Guo, Grace

Hi Shruti,

 

The correlation matrix here is a 379 by 379, and this is presumably for 1 subject. For investigations that involve multiple subjects, we’d want to have them and permute across them. Permuting among the 379 network nodes isn’t helpful for inference.

Shruti Kinger

unread,
Feb 20, 2024, 9:48:14 AM2/20/24
to Anderson Winkler, hcp-...@humanconnectome.org, Guo, Grace
Hello!

I have used the following line of code to do group analysis to check for the effect of anxiety/correlation with functional connectivity values. Could you tell if it is correct?

palm -i all51_correctfile.csv -evperdat rawfaffect_51subj.csv 2 -d fear_affect_scores_intercept.csv -t contrasts.csv -eb EB.csv -fdr -n 1000

1. I have converted the correlation matrix(.pconn.nii) into N*1 vector for all 51 subjects. each row of  all51_correctfile.csv represents one subject.
2. contains fear affect scores --> rawfaffect_51subj.cs
3. -d contains two columns [intercept(1) and fear affect scores ]
4. contrasts.csv contain [0 1]
5. Could you share how I can run Sidak's correction on fsl palm?

Thanks,
Shruti


On Fri, Feb 16, 2024 at 11:49 AM Anderson Winkler <anderson...@utrgv.edu> wrote:

Shruti Kinger

unread,
Mar 11, 2024, 5:50:32 AM3/11/24
to HCP-Users, tim.c...@gmail.com, Anderson M. Winkler, Guo, Grace
Hi

We are analysing '.pconn.nii ' files and need your further guidance. Could you answer the following questions?

1. Can the parcels belonging to the same component be merged for each individual separately? If it can be done could you share the method? 
2.  If I am analysing each parcel to parcel connectivity in fsl palm say left anterior cingulate cortex  with rest of the parcels, what spatial correction should I use?
3. I have copied significant parcels' p values in a csv file, is there a way to use them to visualise them on workbench to generate correlation maps? Earlier I visualised parcels using   -cifti-label-import <cifti file> <label text file containing label name and key and rgb, alpha values> <output 

Thanks,
Shruti

Glasser, Matt

unread,
Mar 11, 2024, 3:00:29 PM3/11/24
to hcp-...@humanconnectome.org, tim.c...@gmail.com, Anderson M. Winkler

Just an update here: We will soon have this functionality in the latest version of PALM ready for use. 

Shruti Kinger

unread,
Mar 11, 2024, 4:30:19 PM3/11/24
to hcp-...@humanconnectome.org, tim.c...@gmail.com, Anderson M. Winkler
Thanks a lot for sharing the update. I just want to understand what all can be done with pconn files. Could you share the potential uses of .pconn.nii files to draw inferences?

Thanks for your time and patience.

Shruti

Glasser, Matt

unread,
Mar 11, 2024, 4:57:51 PM3/11/24
to hcp-...@humanconnectome.org, tim.c...@gmail.com, Anderson M. Winkler

The plan is to be able to merge pconn files across subjects into a pconnscalar file type.  Then PALM operates on that as it does any other file type (with a default behavior to consider only a triangle of a symmetric matrix) and outputs a pconn of the stats for each cell of the connectome matrix.  You would be able to then use PALM to compare with any non-imaging variables that you wanted.  We are doing that locally for our own purposes and working with Anderson to get this functionality implemented. 

Shruti Kinger

unread,
Mar 11, 2024, 5:01:01 PM3/11/24
to hcp-...@humanconnectome.org, Anderson M. Winkler, tim.c...@gmail.com
Thank you very much for sharing the information.

Shruti

Tim Coalson

unread,
Mar 11, 2024, 5:43:58 PM3/11/24
to Shruti Kinger, HCP-Users, Anderson M. Winkler, Guo, Grace
wb_command -cifti-convert can probably convert your csv files to .pscalar.nii with -from-text and -reset-scalars, as long as the csv has one value per parcel (in the same order) and doesn't have parcel names or other non-numeric text in it.

Tim

Negar Memarian

unread,
Mar 24, 2024, 11:23:41 PM3/24/24
to HCP-Users, tim.c...@gmail.com, HCP-Users, Anderson M. Winkler, Guo, Grace, shr...@iiitd.ac.in
On the topic of how to visualize the parcel pair p-values from PALM's group analysis .csv output file, would it be correct if I do this in MATLAB:
(a) wrap the vector of p-values to 379x379 square matrix form.
(b) read the average pconn.nii file (i.e., average of all individual pconns in the group) with cifti_read and replace its .cdata field with the square matrix of p-values from (a).
(c) save this as a new pconn.nii file (e.g., group-pval-map.pconn.nii) using cifti_write.
(d) in wb_view, overlay "group-pval-map.pconn.nii" on the inflated average cortical surface. 

Thank you,
Negar

Glasser, Matt

unread,
Mar 25, 2024, 7:07:33 AM3/25/24
to hcp-...@humanconnectome.org, tim.c...@gmail.com, Anderson M. Winkler, shr...@iiitd.ac.in

The latest version of PALM can take .pconnscalar.nii files in (which you can produce with the CIFTI matlab toolbox as concatenated .pconn.nii files across subjects along the third dimension) and outputs files in .pconn.nii format.

 

Matt.

 

From: Negar Memarian <negar.m...@gmail.com>


Reply-To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Date: Sunday, March 24, 2024 at 10:23 PM
To: HCP-Users <hcp-...@humanconnectome.org>

Negar Memarian

unread,
Mar 25, 2024, 3:46:02 PM3/25/24
to hcp-...@humanconnectome.org, Anderson M. Winkler, shr...@iiitd.ac.in, tim.c...@gmail.com
Thank you very much. 

Kind regards,
Negar 


Negar Memarian

unread,
Mar 26, 2024, 7:41:13 PM3/26/24
to HCP-Users, glas...@wustl.edu, tim.c...@gmail.com, Anderson M. Winkler, shr...@iiitd.ac.in
Hi,
Could you please advise:
1. I concatenated the pconn.nii files for all my subjects in Matlab and now have a 379x379x20 array (20 is the number of my subjects, and 379 is the number of brain parcels).  How can I write this array to a file that will be recognizable by PALM? I cannot simply replace the .cdata field and use ciftiwrite in Matlab because I get this error: "number of cdata dimensions does not match diminfo field".

2.  Is ".pconnscalar.nii" a new file format recognized by both the CIFTI Matlab toolbox and PALM (version palm-alpha119)?  

I have been using PALM with vectorized .csv inputs but I would like to be able to use PALM's new capability to produce pconn of the group-level analysis stats for each cell of the connectome matrix.
Many thanks,
Negar

Tim Coalson

unread,
Mar 26, 2024, 7:59:37 PM3/26/24
to Negar Memarian, HCP-Users, glas...@wustl.edu, Anderson M. Winkler, shr...@iiitd.ac.in
Do this to your concatenated cifti structure, and it should let you save the 3D .cdata matrix:

cifti.diminfo{3} = cifti_diminfo_make_scalars(20);

The cifti format allows almost any combination of 2 or 3 mapping types.  This, however, was one mentioned as a "standard combination" in the specification, where we defined combinations that we expected to be useful for some purpose, though it hadn't seen much use until Matt recently proposed it for this application.

Tim

Negar Memarian

unread,
Mar 26, 2024, 10:42:41 PM3/26/24
to Tim Coalson, HCP-Users, glas...@wustl.edu, Anderson M. Winkler, shr...@iiitd.ac.in
Many thanks Tim. It worked and I was able to run PALM on it successfully. 
Users need to make sure that they have the most recent version of PALM (March 2024) for it to work. 

Best regards,
Negar

Shruti Kinger

unread,
Dec 10, 2025, 1:02:19 PM (11 days ago) Dec 10
to Anderson Winkler, hcp-...@humanconnectome.org
Hello, Dr. Winkler

We extracted Fisher z-transformed connectivity values between parcel A and all other parcels (approximately 300) from the first-level analysis from 400 participants from the HCP dataset to examine their association with working-memory scores in FSL PALM, while controlling for nuisance covariates. This provided us with the p-values and t-values for each connection. 

We now intend to use a machine-learning model to predict behaviour (e.g., working memory score) from brain connectivity, which requires obtaining the corresponding second-level Fisher z estimates.

Could you please clarify whether PALM provides a way to compute second-level Fisher z values directly? If not, could you share an alternative approach? We require these values to serve as features in our model. [Features (X) = Fisher z values; Outcome (y) = working memory scores]

I would appreciate your guidance on this.  

Thanks,
Shruti



On Sat, Feb 17, 2024 at 9:02 AM Anderson Winkler <anderson...@utrgv.edu> wrote:

Hi Shruti,

 

You can, absolutely. If the matrix is symmetric, just the upper or lower triangular part are sufficient.

 

All the best,


Anderson

 

From: Shruti Kinger <shr...@iiitd.ac.in>
Date: Friday, February 16, 2024 at 1:31 PM
To: Anderson Winkler <anderson...@utrgv.edu>
Subject: Re: [hcp-users] Getting started with rsfMRI analysis

  External Mail

  This email originated outside of The University of Texas Rio Grande Valley.
  Please exercise caution when clicking on links or opening attachments.

Yes, Sir, I understand that. I just meant if it is a symmetrical matrix then can’t I use just the upper/lower triangular part of the matrix which will give me N*(N-1)/2 =72010 measures (edges) of one participant .

 

I understand the logic for using the entire N*N matrix (379*379=143641 edges) for an asymmetrical matrix. But I didn’t understand why can’t I use N*(N-1)/2 for a symmetrical matrix. 

 

Thanks a lot for your patience and time for replying to my queries.

Reply all
Reply to author
Forward
0 new messages