Assistance Needed in Analyzing Resting-State fMRI CIFTI Format

487 views
Skip to first unread message

Harsh Pandey

unread,
Jan 24, 2024, 10:04:23 AM1/24/24
to HCP-Users
Hi HCP community,
I hope this message finds you well. Currently, I am working on analyzing resting-state fMRI data and have a single participant fMRI file named "rfMRI_REST2_RL_Atlas_MSMAll_hp2000_clean.dtseries.nii" in CIFTI format. Could someone kindly provide a step-by-step procedure for getting started with the  analysis of this data using wb_command? Additionally, any recommended resources would be highly appreciated.
Thanks in advance for any help you can provide!

Best regards,
Harsh Pandey

Glasser, Matt

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

You would want to use all of the resting state fMRI data, not just a single run.  What kind of analysis are you wanting to do?

Matt.

--
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/ba2c8195-0fc3-4f2f-a721-e7b66db84c5bn%40humanconnectome.org.

 


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.

Harsh Pandey

unread,
Jan 24, 2024, 10:42:46 AM1/24/24
to HCP-Users, glas...@wustl.edu
Hi Matt,
Thank you for your response.  My primary goal is to perform a seed-based connectivity analysis using the resting-state fMRI data. I would like to explore the functional connectivity of specific regions. Could you please provide steps or recommendations on how to proceed with this type of analysis using wb_command  in connectome workbench?

Glasser, Matt

unread,
Jan 24, 2024, 2:46:07 PM1/24/24
to Harsh Pandey, HCP-Users

To use all the data, you can follow #3 here to demean and variance normalize the data (not quite as good as what we do now, but simpler for now too): https://wiki.humanconnectome.org/display/PublicData/HCP+Users+FAQ

 

You can use wb_command -cifti-parcellate and wb_command -cifti-correlation to make a functional connectome with this multi-modal parcellation: https://balsa.wustl.edu/file/87B9N

Message has been deleted
Message has been deleted

Harsh Pandey

unread,
Jan 29, 2024, 6:21:08 PM1/29/24
to HCP-Users, glas...@wustl.edu, Harsh Pandey
Hi Matt,
I used these commands to demean and variance normalize all four runs per subject:-

./wb_command -cifti-reduce rfMRI_REST2_RL_Atlas_MSMAll.dtseries.nii MEAN mean_REST2_RL.dscalar.nii
./wb_command -cifti-reduce rfMRI_REST2_RL_Atlas_MSMAll.dtseries.nii STDEV stdev_REST2_RL.dscalar.nii
./wb_command -cifti-math '(x - mean) / stdev' demeaned_varnorm_REST2_RL.dtseries.nii -fixnan 0 -var x rfMRI_REST2_RL_Atlas_MSMAll.dtseries.nii -var mean mean_REST2_RL.dscalar.nii -select 1 1 -repeat -var stdev stdev_REST2_RL.dscalar.nii -select 1 1 -repeat

and for merging all the four demeaned variance normalized files I used:-
./wb_command -cifti-merge merged_runs.dtseries.nii -cifti demeaned_varnorm_REST1_LR.dtseries.nii -cifti demeaned_varnorm_REST1_RL.dtseries.nii -cifti demeaned_varnorm_REST2_LR.dtseries.nii -cifti demeaned_varnorm_REST2_RL.dtseries.nii

and then to parcellate the cortical surface into regions of interest (ROIs) using multi model parcellation provided by hcp link:- click ( I saved this file as temp.dlabel.nii)
 and to make a functional connectome, I used command:-
./wb_command -cifti-parcellate merged_runs.dtseries.nii temp.dlabel.nii COLUMN parcellated.ptseries.nii -method MEAN

./wb_command -cifti-correlation parcellated.ptseries.nii functional_connectome.pconn.nii -fisher-z

However, Now I want to do group analysis for 100 subjects (each containing 4 resting scans)
Could you please provide the step step-wise method or wb_commands I should use to do that?

Thank you for being so helpful. I am new to HCP, so I appreciate your patience if some of these questions are rudimentary.
Best
Harsh

Glasser, Matt

unread,
Jan 29, 2024, 8:44:13 PM1/29/24
to Harsh Pandey, HCP-Users

What do you mean by a group analysis?

Matt.

Harsh Pandey

unread,
Jan 29, 2024, 10:47:33 PM1/29/24
to HCP-Users, glas...@wustl.edu, Harsh Pandey
By group level analysis,I want to get the final step file as shown in the image attached i.e. group parcellated connectome. Also, why there is one additional step mentioned, like making group dense connectome? Why we did not just merge the all rfMRI runs after doing demeaning and variance normalization across all subjects and  then just using the step you mentioned earlier i.e.  using wb_command -cifti-parcellate and wb_command -cifti-correlation to make a functional connectome with this multi-modal parcellation: https://balsa.wustl.edu/file/87B9N

Group_level_analysis.png


Harsh

Glasser, Matt

unread,
Jan 29, 2024, 10:52:16 PM1/29/24
to Harsh Pandey, HCP-Users

Use wb_command -cifti-average across the individual connectomes to make the group connectome.


Matt.

 

From: Harsh Pandey <harshpand...@gmail.com>
Date: Monday, January 29, 2024 at 9:47 PM
To: HCP-Users <hcp-...@humanconnectome.org>
Cc: "Glasser, Matt" <glas...@wustl.edu>, Harsh Pandey <harshpand...@gmail.com>
Subject: Re: [hcp-users] Assistance Needed in Analyzing Resting-State fMRI CIFTI Format

 

 

By group level analysis,I want to get the final step file as shown in the image attached i.e. group parcellated connectome. Also, why there is one additional step mentioned, like making group dense connectome? Why we did not just merge the all rfMRI runs after doing demeaning and variance normalization across all subjects and  then just using the step you mentioned earlier i.e.  using wb_command -cifti-parcellate and wb_command -cifti-correlation to make a functional connectome with this multi-modal parcellation: https://balsa.wustl.edu/file/87B9N

Tim Coalson

unread,
Jan 30, 2024, 12:06:43 AM1/30/24
to hcp-...@humanconnectome.org, glas...@wustl.edu, Harsh Pandey
Merging the timeseries of all subjects before parcellating would make an extremely large file, we use things like MIGP to avoid this when we want dense group connectivity.  By parcellating first, concatenating becomes easier, but it also averages out a lot of the noise that the group concatenation method would be useful for, so you can get away with parcellation, correlation per-subject, and then doing averaging last.

Tim


Harsh Pandey

unread,
Feb 9, 2024, 1:21:54 AM2/9/24
to HCP-Users, tim.c...@gmail.com, glas...@wustl.edu, Harsh Pandey
Dear HCP Team,
Thank you very much for your prompt response.

I require further assistance with my analysis, specifically:-
How can I use the generated ptseries.nii /pconn.nii to check for correlation with depression scores after controlling for age and gender? In the HCP course, COPEs were used as input arguments for tsfMRI data in the following steps. Could you help me with what input arguments need to be inserted to check the correlation with the anxiety scores (design matrix)? I have lifted and pasted the block of code from the HCP course, 2018 for your reference. 

args="${args} -cifti
${PRACTICALS}/day4/tfMRI/DATA/${subj}/MNINonLinear/Results/tfMRI_WM/tfMRI_W
M_hp200_s2_level2_Glasser.feat/ParcellatedStats/cope11.feat/cope1.ptseries.
nii -column 1"

done

# Run the wb_command to merge all into a single file:
wb_command -cifti-merge Y.ptseries.nii ${args}

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

Best regards,
Harsh 

Glasser, Matt

unread,
Feb 9, 2024, 7:08:20 AM2/9/24
to Harsh Pandey, HCP-Users, Anderson Winkler, tim.c...@gmail.com

I have the same question and I think there is at least one other HCP User who asked this recently.  Hopefully, Anderson can tell us how to use PALM with .pconn files.


Matt.

 

From: Harsh Pandey <harshpand...@gmail.com>
Date: Friday, February 9, 2024 at 12:21 AM
To: HCP-Users <hcp-...@humanconnectome.org>
Cc: "tim.c...@gmail.com" <tim.c...@gmail.com>, "Glasser, Matt" <glas...@wustl.edu>, Harsh Pandey <harshpand...@gmail.com>
Subject: Re: [hcp-users] Assistance Needed in Analyzing Resting-State fMRI CIFTI Format

 

Dear HCP Team,


Thank you very much for your prompt response.

I require further assistance with my analysis, specifically:-
How can I use the generated ptseries.nii /pconn.nii to check for correlation with depression scores after controlling for age and gender? In the HCP course, COPEs were used as input arguments for tsfMRI data in the following steps. Could you help me with what input arguments need to be inserted to check the correlation with the anxiety scores (design matrix)? I have lifted and pasted the block of code from the HCP course, 2018 for your reference. 

args="${args} -cifti
${PRACTICALS}/day4/tfMRI/DATA/${subj}/MNINonLinear/Results/tfMRI_WM/tfMRI_W
M_hp200_s2_level2_Glasser.feat/ParcellatedStats/cope11.feat/cope1.ptseries.
nii -column 1"


done


# Run the wb_command to merge all into a single file:
wb_command -cifti-merge Y.ptseries.nii ${args}

 

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

Best regards,
Harsh 

On Tuesday 30 January, 2024 at 10:36:43 am UTC+5:30 tim.c...@gmail.com wrote:

Merging the timeseries of all subjects before parcellating would make an extremely large file, we use things like MIGP to avoid this when we want dense group connectivity.  By parcellating first, concatenating becomes easier, but it also averages out a lot of the noise that the group concatenation method would be useful for, so you can get away with parcellation, correlation per-subject, and then doing averaging last.

 

Tim

 

 

On Mon, Jan 29, 2024 at 9:47 PM Harsh Pandey <harshpand...@gmail.com> wrote:

By group level analysis,I want to get the final step file as shown in the image attached i.e. group parcellated connectome. Also, why there is one additional step mentioned, like making group dense connectome? Why we did not just merge the all rfMRI runs after doing demeaning and variance normalization across all subjects and  then just using the step you mentioned earlier i.e.  using wb_command -cifti-parcellate and wb_command -cifti-correlation to make a functional connectome with this multi-modal parcellation: https://balsa.wustl.edu/file/87B9N

Namrata Tamang

unread,
Aug 29, 2025, 2:39:46 AM (9 days ago) Aug 29
to HCP-Users, Glasser, Matt, tim.c...@gmail.com, Harsh Pandey, Anderson Winkler
Dear Harsh and HCP team,

Apologies for reviving this thread after a year, but I wanted to ask whether you were able to find a solution to your question.  
I am currently working with dpconn/dscalar data and aiming to perform a similar correlation analysis with depression scores while controlling for covariates. If you have identified a suitable approach, it would be very helpful if you could share it.  
Thank you in advance for your time and guidance.  

Best regards,  
Namrata 

Shruti Kinger

unread,
Aug 31, 2025, 4:43:54 AM (7 days ago) Aug 31
to hcp-...@humanconnectome.org
Hi Namrata,

Harsh and I were working on the same project. The analysis was done on FSL PALM in MATLAB.  See the below MATLAB code. Suppose, you want to see parcel 126 (brain region) is correlated with rest of the parcels>> extract the Fisher z values (I suppose in your case it will be in dconn files) and  store them in a format which PALM accepts>> design a matrix containing the regressor such as depression scores, intercept, or any nuisance covariate>> create a contrast , for example if you want to see positive correlation with depression scores controlling for age, gender , it will be 0 0 0 1 (where the 0/1 corresponds to intercept, age, gender, depression)>> feed the number of permutations , correction type, tail etc.

The -eb parameter is optional but please double check the documentation. You may automate the process if you have more than one parcel.

Shruti

palm -i parcel_126.csv -d design_3regressors.csv -t two_contrast.csv -eb EB_400.csv -n 5000 -fdr -corrcon -logp -accel tail

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/LxYAuPP0li4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hcp-users+...@humanconnectome.org.
To view this discussion visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/448e2043-fcc6-4883-a1c0-d66db5c2c296n%40humanconnectome.org.

Namrata Tamang

unread,
Aug 31, 2025, 11:53:51 PM (6 days ago) Aug 31
to HCP-Users, Shruti Kinger
Hi Shruti,

Thank you for your prompt reply.  It is very helpful. I'll check out the PALM documentation.

Best regards,
Namrata 

Reply all
Reply to author
Forward
0 new messages