Issues using -volume-label-import

88 views
Skip to first unread message

Julie Grier

unread,
May 31, 2024, 1:55:34 PM5/31/24
to HCP-Users
While trying to use wb_command -volume-label-import, the output is in 'MNI152' and FLOAT32 with none of the regions labeled with the appropriate information from the label-list-file, despite the input being 'Scanner Anat' and INT16. I forced the image to be in INT16 (using fsledithd) because when originally in FLOAT32, I thought that maybe the label-list-file was expecting 8 but getting 8.0. However, it's still not working even when the input values are integers and when I look at the output, it is the same as the input except the values are floats instead of integers. Anyone know what I am doing wrong?

Here's part of the label list file:
CEREBELLUM_LEFT
8 230 148 34 0
CEREBELLUM_RIGHT
47 230 148 34 0
ACCUMBENS_LEFT
26 230 148 34 0
ACCUMBENS_RIGHT
58 230 148 34 0

Here's an example of the command:
wb_command -volume-label-import input.nii.gz SubcorticalLabels.txt outputlabels.nii.gz

wb_command -volume-label-import
      <input> - the input volume file
      <label-list-file> - text file containing the values and names for labels
      <output> - output - the output workbench label volume


Tim Coalson

unread,
May 31, 2024, 1:57:38 PM5/31/24
to hcp-...@humanconnectome.org
Use 255 for alpha, not 0.

Tim


--
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/edb130a1-93ed-46fc-b714-aa9588094023n%40humanconnectome.org.

Glasser, Matt

unread,
May 31, 2024, 1:58:04 PM5/31/24
to hcp-...@humanconnectome.org

Connectome Workbench may not care about that particular NIFTI flag and may not support alternative data types.  What problem are you specifically having with the output from the wb_command?


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/edb130a1-93ed-46fc-b714-aa9588094023n%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.

Julie Grier

unread,
May 31, 2024, 2:34:34 PM5/31/24
to hcp-...@humanconnectome.org
Unfortunately it still produces the same output with the original input values as floats. 

Tim Coalson

unread,
May 31, 2024, 2:36:45 PM5/31/24
to hcp-...@humanconnectome.org
Alternate nifti data types are supported, but irrelevant to this.

We don't have the program try to understand what coordinate space each volume is in, or have any kind of built-in transforms between them (we most frequently use the subject's original shape and the nonlinear MNI coordinates, and the transform between them is different per-subject, so it wouldn't be easy to do "automatically").  The user is expected to know what volume space each file is in, and only compare images that are in the same space.  Since we don't try to have the internal code keep track of this, for every volume file we write, we just use the MNI code for the sform/qform, which just means "this qform/sform is usable" to us.  Originally I think we used the "scanner anat" code, and someone complained, so we switched it, but we don't plan to use different codes for different files, as "which registration is it" is in general too complicated a question for the set of available nifti transform codes.

Tim


Julie Grier

unread,
May 31, 2024, 3:34:16 PM5/31/24
to HCP-Users, Glasser, Matt
I've checked that the values in the input file correspond to those in the label list .txt, but the output file does not have any of the labels, just the values still. 

Tim Coalson

unread,
May 31, 2024, 3:38:15 PM5/31/24
to hcp-...@humanconnectome.org, Glasser, Matt
I may not have been clear, these lines:

CEREBELLUM_LEFT
8 230 148 34 0

Will create a fully-transparent label color, because the last value is the alpha (opacity) value.  Use this instead:

CEREBELLUM_LEFT
8 230 148 34 255

Make that same change to all of your labels.

Tim


Reply all
Reply to author
Forward
0 new messages