Colortable for gifti file (label.gii)

336 views
Skip to first unread message

杨国元

unread,
Apr 8, 2021, 9:55:16 AM4/8/21
to hcp-...@humanconnectome.org

Hi HCP experts,


I have a question about how to change the colortable for gifti file (xxx.label.gii). I have used the python nibabel package to read the label file, the command is just as nibabel.gifti.giftiio.read(xxx.label.gii). Then, the format of the object is <nibabel.gifti.gifti.GiftiImage>. Further, how to get this object's colortable and modify it with my own defined colortable? Thanks for your time.


Best regards,

Guoyuan



Guoyuan Yang
Center for MRI Research
School of Physics
Peking University
Beijing, China

Tel:18800172884


Coalson, Timothy Scott (S&T-Student)

unread,
Apr 8, 2021, 4:37:48 PM4/8/21
to hcp-...@humanconnectome.org
I haven't used nibabel, but I found this page that might help:

which among other things, mentions "get_labeltable method deprecated. Use the gifti_img.labeltable property instead.", so "<your_object>.labeltable" sounds like a good starting point.  The GiftiLabelTable object is described on the same page, which is what I expect is the type of that property.

If you want to do this outside of python, wb_command -label-export table will give you a text file with all the names, keys, and colors for all labels, and -metric-label-import will let you set the names/keys/colors with the same format of text file.  There are similar commands for cifti and volume files.

Tim


From: 杨国元 <yangg...@pku.edu.cn>
Sent: Thursday, April 8, 2021 8:55 AM
To: hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>
Subject: [hcp-users] Colortable for gifti file (label.gii)
 
--
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/1359dae1.8be27.178b1c3ee6b.Coremail.yangguoyuan%40pku.edu.cn.

杨国元

unread,
Apr 9, 2021, 5:49:13 AM4/9/21
to hcp-...@humanconnectome.org

Hi Tim,


Thanks for your reply, the problem has been solved with wb_command. In addition, I have a small question. For the dtseries.nii file with 1200 time points, if I want to split it into two dtseries.nii files which including 700 and 500 time points. How to do that? Thanks a lot.


Best

Guoyuan

-----原始邮件-----
发件人:"Coalson, Timothy Scott (S&T-Student)" <tsc...@mst.edu>
发送时间:2021-04-09 04:37:44 (星期五)
收件人: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
抄送:
主题: Re: [hcp-users] Colortable for gifti file (label.gii)
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/SN6PR01MB49910E74C9AEF784B457244F81749%40SN6PR01MB4991.prod.exchangelabs.com.

Glasser, Matthew

unread,
Apr 9, 2021, 7:12:17 AM4/9/21
to hcp-...@humanconnectome.org

You can use wb_command -cifti-merge.

 

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.

Reply all
Reply to author
Forward
0 new messages