Add two gifts files together

63 views
Skip to first unread message

Steph

unread,
Jul 23, 2021, 5:42:56 AM7/23/21
to HCP-Users
Dear all,

I have several ....func.gii files and want to add them together in python.
The goal is one overlap func.gii file which combines the other ..func.gii files together
The ..func.gii files are generated from .npy files


1.func.gii+2.func.gii+3....

How to do so?



Steph

unread,
Jul 23, 2021, 5:44:10 AM7/23/21
to HCP-Users, Steph
Sorry, I meant SEVERAL GIFTI files

Glasser, Matthew

unread,
Jul 23, 2021, 7:36:52 AM7/23/21
to hcp-...@humanconnectome.org, Steph

There is wb_command -metric-math.

 

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/219f2ae8-4090-492c-b4d9-10378a53239bn%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.

Coalson, Timothy Scott (S&T-Student)

unread,
Jul 23, 2021, 2:12:32 PM7/23/21
to hcp-...@humanconnectome.org, Steph
Depending on how large "several" is, there is also wb_command -metric-merge and -metric-reduce.

If they are already loaded in python (via nibabel, presumably), you should be able to get the data as a numpy matrix, add those like any other numpy matrix, and put the result into a new gifti file.

Tim


From: Glasser, Matthew <glas...@wustl.edu>
Sent: Friday, July 23, 2021 6:36 AM
To: hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>
Cc: Steph <stephan.wu...@gmail.com>
Subject: Re: [hcp-users] Re: Add two gifts files together
 

Steph

unread,
Oct 5, 2021, 6:34:16 AM10/5/21
to HCP-Users, tsc...@mst.edu, Steph
So I used:

wb_command -metric-resample ses-1_task-rest_Atlas_s0.dtseries_CortexLeft.func.gii L.sphere.32k_fs_LR.surf.gii Sphere.6k.L.surf.gii ADAP_BARY_AREA ses-1_task-rest_Atlas_s0.dtseries_CortexLeft_6k.func.gii -area-metrics sub-1.L.midthickness.32k_fs_LR.surf.gii


but results in

While running:

/Users/neurolab/Desktop/Stephan/Programmes/workbench/bin_macosx64/../macosx64_apps/wb_command.app/Contents/MacOS/wb_command -metric-resample ses-1_task-rest_Atlas_s0.dtseries_CortexLeft.func.gii L.sphere.32k_fs_LR.surf.gii Sphere.6k.L.surf.gii ADAP_BARY_AREA ses-1_task-rest_Atlas_s0.dtseries_CortexLeft_6k.func.gii -area-metrics sub-1.L.midthickness.32k_fs_LR.surf.gii


ERROR: NAME OF FILE: sub-1.L.midthickness.32k_fs_LR.surf.gii


All data arrays (columns) in the file must have the same number of rows.  The first array (column) contains 32492 rows.  Array 2 contains 64980 rows.


Glasser, Matt

unread,
Oct 5, 2021, 9:19:09 AM10/5/21
to hcp-...@humanconnectome.org, tsc...@mst.edu, Steph

Use -area-surfs with a surface. 

Reply all
Reply to author
Forward
0 new messages