label file for wb_view

547 views
Skip to first unread message

Erika Raven

unread,
May 27, 2021, 12:03:08 PM5/27/21
to HCP-Users
Hello Experts ! 

I am attempting to make a dlabel (?) file for the macaque CHARM atlas to overlay on my gifti surface files. Thanks again re: previous posts on adapting the surface outputs to readable wb_view formats. Anyway, CHARM is a hierarchical atlas, with 6 levels - each level has an increased complexity of parcellation. My starting point is a txt file (there are actually 6, one for each level) with label values per vertex, and separate txt file with rgb color assignments. I have attached these for reference. I would also like to add label definitions eventually, as this is not available with what I have. I assume this could be done via text file as well? 

I can load the text files in brainbrowser, so I know the information is readable, but I cannot figure out even what to google (have been trying for a while now anyway) on how to convert this to wb_view formats. 

Any ideas would be appreciated! 

Erika 



CHARM_atlas_rsl_sym_hires_level_2.txt
hue_CHARM_cmap_v1.3_rgb.txt

Coalson, Timothy Scott (S&T-Student)

unread,
May 27, 2021, 3:56:02 PM5/27/21
to HCP-Users
It would probably be easiest to convert the per-vertex text file to gifti first, but that would need to be done with a bit of custom code (matlab, python, or anything else with a gifti library available) or some manual hackery (wb_command -gifti-convert an existing metric file to ASCII, paste the text values in).  While -cifti-convert is able to read text files, they have to be index-identical to the cifti file used as a template (which has some details that you probably don't want to deal with manually).  You can then use wb_command -metric-label-import to turn them into .label.gii files - if you want to specify label colors, you will also need to specify label names (or you can let it use random colors and integer-based names).  You can use any workbench label file and the corresponding -*-label-export-table command to get an example of the text format for name+color.

What surface resolution/mesh do these use?  We have done some macaque work using cifti files, but I'm not sure what surface meshes we recommend for a standard macaque cifti space.  You may need to resample the files to our recommended mesh to use a standardized cifti space (like the 91k we use for human data).  It is possible to use a custom cifti space based on some other surfaces, but this may result in extra work to compare it to other macaque data.

Tim


From: Erika Raven <erika....@gmail.com>
Sent: Thursday, May 27, 2021 11:03 AM
To: HCP-Users <hcp-...@humanconnectome.org>
Subject: [hcp-users] label file for wb_view
 
--
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/bedc6014-9e9b-4511-8700-051302a101dfn%40humanconnectome.org.

Erika Raven

unread,
May 28, 2021, 1:11:23 PM5/28/21
to hcp-...@humanconnectome.org
Hi Tim, 

Thanks for listing out some options. I felt most comfortable in the hacky space and tried this, 

wb_command -gifti-convert ASCII metric.func.gii ascii-metric.func.gii


# then copied vertices assigned with label integer values into the data field for ascii-metric.func.gii


wb_command -metric-label-import ascii-metric.func.gii CHARM_key_4_er.txt CHARM_level4.label.gii


There is this error , 'ERROR: label list file is malformed for entry #1: area_32'

I am basing my input file 'CHARM_key_4_er.txt' off the example data set obtained via here: 

wb_command -cifti-label-export-table parcellations_VGD11b.32k_fs_LR.dlabel.nii 1 wb_labels.txt


I think it is almost there, do you understand the error? I attached my txt file for reference. I was going to let it randomly assign colors. 

For surface mesh, it is 40,962. This is the default output from CIVIT-macaque. Do you see any issues here? 

Thanks so much, 
-e 

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/gBh41YBddEg/unsubscribe.
To unsubscribe from this group and all its topics, 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/SN6PR01MB49917DCFDEE8BD4E4084CAE881239%40SN6PR01MB4991.prod.exchangelabs.com.
CHARM_key_4_er.txt

Coalson, Timothy Scott (S&T-Student)

unread,
May 28, 2021, 4:03:46 PM5/28/21
to hcp-...@humanconnectome.org
The label import commands currently require you to set colors on every label you give a name for.  Each line with numbers must contain 5 numbers (key, red, green, blue, alpha), though we strongly recommend always using 255 for alpha (if you want to display labels on top of something else, wb_view layer display options are better than setting transparency in the file).

If random colors are okay, you can do the label import with an empty string ("") as the <label-list-file>, export the table, edit it to add the names, and redo the import.

wb_view can work with data on any mesh resolution, but it only allows one resolution (per hemisphere) at a time.  If you want to compare to data on another mesh, you will need to resample one way or another.  I don't know what surface registrations to/from CIVET-macaque currently exist.

Tim


From: Erika Raven <erika....@gmail.com>
Sent: Friday, May 28, 2021 12:11 PM
To: hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>
Subject: Re: [hcp-users] label file for wb_view
 
Reply all
Reply to author
Forward
0 new messages