The -cifti-merge command does not have that type of option (it is not
intended to do as many things as melodic - wb_command commands are building
blocks, not pipelines).  You could accomplish something similar with shell
tricks (though it isn't safe with regards to spaces in filenames):

$ cat inputsfile.txt
-cifti input1.dtseries.nii -cifti input2.dtseries.nii

$ wb_command -cifti-merge output.dtseries.nii `cat inputsfile.txt`

The wb_shortcuts script uses a safer way to do this (arrays), so you can
use a command like this instead to concatenate some file across all
subjects in a directory:

wb_shortcuts -cifti-concatenate output.dtseries.nii
$subjdir/*/<some-path-to-subject-file>/subjectinput.dtseries.nii

If you only want a subset of subjects, you can use a loop to build the list
of files in an array variable, or a string if you don't use spaces in file
or folder names.

Tim


On Fri, Jan 6, 2017 at 10:57 AM, Shearrer, Grace <[email protected]>
wrote:

> ​Hi Tim, I have a follow up question about the cifti-merge command. Given
> I will be merging upwards of 500 subjects does the cifti-merge command have
> the ability to take a .txt listing the paths to all the parcellated files?
> Similar to the fsl's group ica function which allows:
>
> melodic -i inputlist_clean.txt -o groupmelodic_fix.ica -v --nobet 
> --bgthreshold=10 --tr=2.000 --report -d 25 --mmthresh=0.5 --Ostats -a concat​
>
> Thanks,
>
> Grace
> ------------------------------
> *From:* Timothy Coalson <[email protected]>
> *Sent:* Wednesday, January 4, 2017 8:43 PM
>
> *To:* Shearrer, Grace
> *Cc:* Glasser, Matthew; Elam, Jennifer; [email protected];
> [email protected]
> *Subject:* Re: [HCP-Users] Creating Group Average Resting State fMRI
>
> Not quite, you still need to do -cifti-merge to concatenate across
> subjects to get one matrix that reflects data from all subjects.
>
> Per subject, with a little bit of pattern matching magic:
> 1) wb_shortcuts -cifti-demean -normalize 
> <subject-output-dir>/all_normalized.dtseries.nii
> rfMRI_REST?*/rfMRI_REST*Atlas.dtseries.nii
> 2) wb_command -cifti-parcellate
>
> Once, across all subjects:
> 3) wb_command -cifti-merge (or wb_shortcuts -cifti-concatenate, which is a
> friendlier front-end to the same command - due to a bug, you'd need the
> latest version, here: https://github.com/Washi
> ngton-University/wb_shortcuts/raw/master/wb_shortcuts)
> 4) wb_command -cifti-correlation
>
> Tim
>
>
> On Wed, Jan 4, 2017 at 4:09 PM, Shearrer, Grace <[email protected]>
> wrote:
>
>> Hi Tim, yes I am planning on concatenating all subjects. Okay so new work
>> flow to make sure I understand:
>>
>>
>> 1) wb_shortcuts -cifti-demean -normalize output.dtseries.nii
>> input.dtseries.nii #do this on each subject where the input would be the
>> 4 resting states runs
>>
>> 2) wb_command -cifti-parcellate #on each subject
>>
>> 3) wb_command -cifit-correlation #this will create a 360x360 matrix for
>> further analysis
>>
>>
>> Thanks so much for tips. I am brand new to workbench so I need all the
>> help I can get.
>>
>> Grace
>> ------------------------------
>> *From:* Timothy Coalson <[email protected]>
>> *Sent:* Wednesday, January 4, 2017 7:00 PM
>> *To:* Shearrer, Grace
>> *Cc:* Glasser, Matthew; Elam, Jennifer; [email protected];
>> [email protected]
>>
>> *Subject:* Re: [HCP-Users] Creating Group Average Resting State fMRI
>>
>> 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.humanconnec
>>> tome.org/display/PublicData/HCP+Users+FAQ#HCPUsersFAQ-3.Isee
>>> thatHCPdistributesgroupaveragedenseconnectomefiles.Doyoualso
>>> provideconnectivitymatricesforindividualsubjects?
>>>
>>>
>>>
>>> <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] <
>>> [email protected]> 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-archiv
>>> e.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