Are you planning to concatenate the timeseries across all subjects?  If so,
I would suggest parcellating in each subject before concatenating (so, swap
steps 4 and 5), so that the merged file isn't enormous, and so that the
parcellation can be done in parallel on a cluster.  The result of
concatenating before vs after parcellation should be the same if you use
the same arguments to -cifti-parcellate, but on the other hand,
parcellating in each subject would make it possible to use individual
subject parcellations instead of a group parcellation.

Side note, wb_shortcuts has a -cifti-demean function that can do steps 1
through 3 for you (assuming you don't want to keep the mean and stdev dense
maps around - also note that the mean and stdev files should actually be
dscalar.nii files, not dtseries.nii):

wb_shortcuts -cifti-demean -normalize output.dtseries.nii input.dtseries.nii

This command can also merge files, so you could for instance merge the 4
runs of each subject after normalizing them by specifying all of them as
inputs to that one command, and then only need to do -cifti-parcellate on
one file per subject.

There is also some explanatory text for the cifti format in the information
options of wb_command:

http://www.humanconnectome.org/software/workbench-command.php?function=-cifti-help

Tim


On Wed, Jan 4, 2017 at 3:28 PM, Shearrer, Grace <[email protected]>
wrote:

> Ah! Most excellent. Thank you again for your prompt reply.
>
>
> 1) wb_command -cifti-reduce <input> MEAN mean.dtseries.nii
>
> 2) wb_command -cifti-reduce <input> STDEV stdev.dtseries.nii
>
> 3) wb_command -cifti-math '(x - mean) / stdev' <output> -fixnan 0 -var x
> <input> -var mean mean.dtseries.nii -select 1 1 -repeat -var stdev
> stdev.dtseries.nii -select 1 1 -repeat
> 4) wb_command -cifit-merge
> 5) wb_command -cifti-parcellate
>
> 6) wb_command -cifit-correlation
>
>
> Grace
> ------------------------------
> *From:* Glasser, Matthew <[email protected]>
> *Sent:* Wednesday, January 4, 2017 6:22 PM
> *To:* Shearrer, Grace; Elam, Jennifer; [email protected];
> [email protected]
>
> *Subject:* Re: [HCP-Users] Creating Group Average Resting State fMRI
>
> I would insert the parcellation between steps 5 and 6.  The result if you
> use the file I suggested below will be a 360 X 360 cortical area
> correlation matrix.
>
> Peace,
>
> Matt.
>
> From: "Shearrer, Grace" <[email protected]>
> Date: Wednesday, January 4, 2017 at 4:16 PM
> To: Matt Glasser <[email protected]>, "Elam, Jennifer" <[email protected]>,
> "[email protected]" <[email protected]>, "[email protected]" <
> [email protected]>
> Subject: Re: [HCP-Users] Creating Group Average Resting State fMRI
>
> Hi Matt, thanks so much for all your work on HCP and for replying to my
> email, I really appreciate it (thank you to Jenn too!). I want to make sure
> I understand the sequence quickly:
>
> 1) wb_command -cifti-parcellate
>
> 2) wb_command -cifti-reduce <input> MEAN mean.dtseries.nii
>
> 3) wb_command -cifti-reduce <input> STDEV stdev.dtseries.nii
>
> 4) wb_command -cifti-math '(x - mean) / stdev' <output> -fixnan 0 -var x
> <input> -var mean mean.dtseries.nii -select 1 1 -repeat -var stdev
> stdev.dtseries.nii -select 1 1 -repeat
> 5) wb_command -cifit-merge
>
> 6) wb_command -cifit-correlation
>
> And then I would take this (giant) matrix and run my analyses on it with
> the brain connectivity toolbox (or the like).
>
> Thank you for your patience,
>
> Grace
>
> ------------------------------
> *From:* Glasser, Matthew <[email protected]>
> *Sent:* Wednesday, January 4, 2017 5:54 PM
> *To:* Elam, Jennifer; Shearrer, Grace; [email protected];
> [email protected]
> *Subject:* Re: [HCP-Users] Creating Group Average Resting State fMRI
>
> You will need to parcellate the data first using wb_command
> -cifti-parcellate.
>
> A parcellation is available here:
>
> https://balsa.wustl.edu/file/show/3VLx
>
> Peace,
>
> Matt.
>
> From: <[email protected]> on behalf of "Elam,
> Jennifer" <[email protected]>
> Date: Wednesday, January 4, 2017 at 3:47 PM
> To: "Shearrer, Grace" <[email protected]>, "[email protected]" <
> [email protected]>, "[email protected]" <
> [email protected]>
> Subject: Re: [HCP-Users] Creating Group Average Resting State fMRI
>
> Hi Grace,
>
> This is a grayordinate x grayordinate "dense" connectome and it will be a
> large (30GB) resulting file. Grayordinates are surface vertices for both
> hemispheres + subcortical voxels (total of 91,282 grayordinates in our
> case). To learn more about this and CIFTI, I would look at Glasser et al.
> 2013. <http://www.sciencedirect.com/science/article/pii/S1053811913005053>
>
>
> <http://www.sciencedirect.com/science/article/pii/S1053811913005053>
>
> Best,
>
> Jenn
>
>
> Jennifer Elam, Ph.D.
> Scientific Outreach, Human Connectome Project
> Washington University School of Medicine
> Department of Neuroscience, Box 8108
> 660 South Euclid Avenue
> St. Louis, MO 63110
> 314-362-9387
> [email protected]
> www.humanconnectome.org
>
> ------------------------------
> *From:* Shearrer, Grace <[email protected]>
> *Sent:* Wednesday, January 4, 2017 2:16:48 PM
> *To:* Elam, Jennifer; [email protected]; [email protected]
> *Subject:* Re: [HCP-Users] Creating Group Average Resting State fMRI
>
>
> ​Hi Jenn, oops the User list verification was going to my junk email. I
> just signed up though. I did see the wiki and it was helpful, I like this
> script though since it appears to loop through all the directories. I just
> wanted to make sure I was getting the final connectivity matrix. One other
> question, is the connectivity matrix voxelwise? Or is it connectivity based
> on a parcelation scheme?
>
> Thank you,
>
> Grace
>
>
> Grace Shearrer, PhD
> Post Doctoral Researcher
> Neuropsychology of Ingestive Behavior Lab
> University of North Carolina Chapel Hill
> ------------------------------
> *From:* Elam, Jennifer <[email protected]>
> *Sent:* Wednesday, January 4, 2017 4:57 PM
> *To:* Shearrer, Grace; [email protected]; [email protected]
> *Subject:* Re: [HCP-Users] Creating Group Average Resting State fMRI
>
>
> Hi Grace,
>
> You might also want to check out the instructions for creating individual
> and group average dense rfMRI connectomes in item #3 in the HCP Users FAQ
> on our wiki: https://wiki.humanconnectome.org/display/
> PublicData/HCP+Users+FAQ#HCPUsersFAQ-3.IseethatHCPdistributesgroupave
> ragedenseconnectomefiles.Doyoualsoprovideconnectivityma
> tricesforindividualsubjects?
>
>
>
> <https://wiki.humanconnectome.org/display/PublicData/HCP+Users+FAQ#HCPUsersFAQ-3.IseethatHCPdistributesgroupaveragedenseconnectomefiles.Doyoualsoprovideconnectivitymatricesforindividualsubjects?>
>
> Also, sign up for the HCP-Users list
> <https://www.humanconnectome.org/contact/#subscribe> to learn from other
> users and stay in the discussion.
>
>
> Best,
>
> Jenn
>
>
> Jennifer Elam, Ph.D.
> Scientific Outreach, Human Connectome Project
> Washington University School of Medicine
> Department of Neuroscience, Box 8108
> 660 South Euclid Avenue
> St. Louis, MO 63110
> 314-362-9387
> [email protected]
> www.humanconnectome.org
>
> ------------------------------
> *From:*[email protected] <hcp-users-bounces@
> humanconnectome.org> on behalf of Shearrer, Grace <[email protected]>
> *Sent:* Wednesday, January 4, 2017 1:24:49 PM
> *To:* [email protected]; [email protected]
> *Subject:* Re: [HCP-Users] Creating Group Average Resting State fMRI
>
>
>
> Hi Dr. Bari,
>
> thank you so much for script this is very helpful. I just want to check
> that I understand. I would use your script to get the mean time series,
> standard deviation, and then demean the data. Then I would use a command
> like:
>
>
> wb_command -cifit-merge
>
>
> to then merge all my demeaned data into a a single file, then I would use:
>
>
> wb_command -cifit-correlation
>
>
> to get a correlation matrix from which I could begin to use a graph theory
> toolkit (like brain connectivity tool box).
>
>
> Does this make sense? This is my first time using CIFTI files and I am
> still trying to wrap my head around it.
>
>
> Thanks,
>
> Grace
>
>
> This question is based on the following thread: http://www.mail-
> archive.com/[email protected]/msg00448.html
>
>
> Grace Shearrer, PhD
> Post Doctoral Researcher
> Neuropsychology of Ingestive Behavior Lab
> University of North Carolina Chapel Hill
>
> _______________________________________________
> HCP-Users mailing list
> [email protected]
> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>
> _______________________________________________
> HCP-Users mailing list
> [email protected]
> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>
>
> ------------------------------
>
> 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.
>
>
> ------------------------------
>
> 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.
>
> _______________________________________________
> HCP-Users mailing list
> [email protected]
> http://lists.humanconnectome.org/mailman/listinfo/hcp-users
>

_______________________________________________
HCP-Users mailing list
[email protected]
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

Reply via email to