# \[labelconvert\] bilateral thalamus gone

**URL:** https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580
**Category:** Uncategorized
**Tags:** preprocessing
**Created:** [April 13, 2018, 6:07pm UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580 "2018-04-13T18:07:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Jiook\_Cha](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jiook_cha/32/2485_2.png) [@Jiook\_Cha](https://community.mrtrix.org/u/Jiook_Cha)
#### Post date: [April 13, 2018, 6:07pm UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580/1 "2018-04-13T18:07:41Z")

</div>

Hi Rob,

In my group analysis (N=~200), I found that labelconvert “skipped” specifically the bilateral thalamus. No error messages until I ran tck2connectome:

> tck2connectome: [WARNING] existing output files will be overwritten  
> tck2connectome: [WARNING] The following nodes are missing from the parcellation image:  
> tck2connectome: [WARNING] 76, 83  
> tck2connectome: [WARNING] (This may indicate poor parcellation image preparation, use of incorrect or incomplete LUT file(s) in labelconvert, or very poor registration)

Please find this figure showing the original freesurfer aparc+aseg (greyscale) overlaid with the “converted” aparc+aseg (yellow-red), which does not include the thalamus.

 ![Untitled-1](https://community.mrtrix.org/uploads/default/original/2X/2/23b107b4dcaad203e38e0de8ee854afb4e0f88f4.png)

I used FreeSurferColotLUT.txt containing:

> 49 Right-Thalamus-Proper

and mrtrix’s fs\_default.txt containing:

> 43 R.TH Right-Thalamus-Proper

Why would this error occur only to the thalamus across all subjects??

Best,  
Jiook

---

<div class="post-metadata">

### Author: ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)
#### Post date: [April 19, 2018, 5:18am UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580/2 "2018-04-19T05:18:37Z")

</div>

> Why would this error occur only to the thalamus across all subjects?

🤷‍♂️

Never seen this before…

Only thing I can suggest is checking the raw image intensity within the thalami of the input image to `labelconvert` i.e. the raw FreeSurfer output: maybe they have been labelled by FreeSurfer as e.g. “`Right-Thalamus`” (48) instead of “`Right-Thalamus-Proper`” (49)?

This issue can crop up with custom lookup tables due to minor spelling errors: The _name_ of the node must be _precisely_ identical between the two lookup tables in order for `labelconvert` to construct the input-output index mapping. But given you’re using software-provided lookup table files as both input and output, I wouldn’t expect this to have occurred in your case.

Rob

---

<div class="post-metadata">

### Author: ![chunhungyeh](https://community.mrtrix.org/user_avatar/community.mrtrix.org/chunhungyeh/32/4570_2.png) [@chunhungyeh](https://community.mrtrix.org/u/chunhungyeh)
#### Post date: [April 19, 2018, 8:06am UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580/3 "2018-04-19T08:06:57Z")

</div>

Hi @Jiook_Cha,

> [@Jiook\_Cha](#):
>
> tck2connectome: [WARNING] 76, 83

According to this line, I guess you actually used `fs_a2009s.txt` for the `lut_out` argument when running `labelconvert`? In this case, the input parcellation image needs to be `aparc.a2009s+aseg.mgz` as provided by FreeSurfer, not the `aparc+aseg` as you described.

But having said that you also mentioned:

> [@Jiook\_Cha](#):
>
> and mrtrix’s fs\_default.txt containing:

So, I would suggest that you check your `labelconvert` step to ensure the consistency of your inputs.

Regarding:

> [@rsmith](#):
>
> maybe they have been labelled by FreeSurfer as e.g. “Right-Thalamus” (48) instead of “Right-Thalamus-Proper” (49)?

No, that has not been changed with the latest FreeSurfer (v6.0).

Cheers.  
Jimmy

---

<div class="post-metadata">

### Author: ![Jiook\_Cha](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jiook_cha/32/2485_2.png) [@Jiook\_Cha](https://community.mrtrix.org/u/Jiook_Cha)
#### Post date: [April 22, 2018, 12:33pm UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580/4 "2018-04-22T12:33:24Z")

</div>

Thanks for the suggestions, but I actually matched the input files and LUT files.

Strangely, when I ran labelconvert on my local computer, I was able to see the bilateral thalamus again (without changing any). The issue only occurs on the supercomputer.

---

<div class="post-metadata">

### Author: ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)
#### Post date: [April 24, 2018, 5:05am UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580/5 "2018-04-24T05:05:18Z")

</div>

While I’m curious to know why that might be the case, without the ability to reproduce the problem I can’t really help over and above suggestions for what to test:

- Is the `FreeSurferColorLUT.txt` file _identical_ between the two systems?

- Is `fs_default.txt` _identical_ between the two systems?

- Is the input image _identical_ between the two systems?

- Is the compiled version of _MRtrix3_ _identical_ between the two systems?

- Another I’ll throw in for the sake of it: Is the _locale_ _identical_ between the two systems?

Rather than just checking that they’re the same, actually copy each potential source of variation from one system to the other, run the same command, and repeat until you achieve the same outcome on both systems.

While it’s possible for the outcomes of floating-point computations to vary slightly between processors, the `labelconvert` command is entirely integer-based; so unfortunately the cause is more likely to be a discrepancy between your usages on the two systems than a difference between the two systems themselves 😟

---

<div class="post-metadata">

### Author: ![singular527](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/9de0a6/32.png) [@singular527](https://community.mrtrix.org/u/singular527)
#### Post date: [July 25, 2025, 6:06am UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580/7 "2025-07-25T06:06:38Z")

</div>

Hi Rob,

I’m also encountering the same issue. After checking the contents of FreeSurferColorLUT.txt and fs\_default.txt, I noticed discrepancies in the naming conventions for thalamic regions. I believe modifying fs\_default.txt might resolve this problem.

Additionally, I’ve run into another issue: when processing different subjects using the same command, the fiber tractography fails for some subjects, and no valid fiber bundles can be selected. Sometimes re-executing the command fixes it, but other times it doesn’t work.

In FreeSurferColorLUT.txt:  
9 Left-Thalamus-unused 0 118 14 0  
10 Left-Thalamus 0 118 14 0  
48 Right-Thalamus-unused 0 118 14 0  
49 Right-Thalamus 0 118 14 0  
8001 Thalamus-Anterior 74 130 181 0  
8002 Thalamus-Ventral-anterior 242 241 240 0  
8003 Thalamus-Lateral-dorsal 206 65 78 0  
8004 Thalamus-Lateral-posterior 120 21 133 0  
8005 Thalamus-Ventral-lateral 195 61 246 0  
8006 Thalamus-Ventral-posterior-medial 3 147 6 0  
8007 Thalamus-Ventral-posterior-lateral 220 251 163 0  
8008 Thalamus-intralaminar 232 146 33 0  
8009 Thalamus-centromedian 4 114 14 0  
8010 Thalamus-mediodorsal 121 184 220 0  
8011 Thalamus-medial 235 11 175 0  
8012 Thalamus-pulvinar 12 46 250 0  
8013 Thalamus-lateral-geniculate 203 182 143 0  
8014 Thalamus-medial-geniculate 42 204 167 0  
Tractography-based Segmentation of the Human Thalamus; Cerebral Cortex

And in fs\_default.txt:  
76 Left-Thalamus-Proper 0 118 14 255  
77 Left-Caudate 122 186 220 255  
78 Left-Putamen 236 13 176 255  
79 Left-Pallidum 12 48 255 255  
80 Left-Hippocampus 220 216 20 255  
81 Left-Amygdala 103 255 255 255  
82 Left-Accumbens-area 255 165 0 255

83 Right-Thalamus-Proper 0 118 14 255  
84 Right-Caudate 122 186 220 255  
85 Right-Putamen 236 13 176 255  
86 Right-Pallidum 13 48 255 255  
87 Right-Hippocampus 220 216 20 255  
88 Right-Amygdala 103 255 255 255  
89 Right-Accumbens-area 255 165 0 255

---

<div class="post-metadata">

### Author: ![singular527](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/9de0a6/32.png) [@singular527](https://community.mrtrix.org/u/singular527)
#### Post date: [July 28, 2025, 10:01am UTC](https://community.mrtrix.org/t/labelconvert-bilateral-thalamus-gone/1580/8 "2025-07-28T10:01:06Z")

</div>

I compared the data of failed and successful subjects during the processing and found that the error seems to occur in the generation of the transformation matrix:

flirt -dof 6 -cost normmi -ref “$T1w”.nii.gz -in b0.nii -omat T\_fsl.txt  
transformconvert T\_fsl.txt b0.nii “$T1w”.nii.gz flirt\_import T\_DWItoT1.txt

All subjects’ data were collected in the same manner, with no differences whatsoever. The text file shows that the registration transformation matrix (T\_DWItoT1.txt) of the failed subjects may be incorrect, causing the align.mif to be severely distorted or rotated upside down in space.

T\_DWItoT1.txt of failed subjects:  
0.0421641352273587 0.958538769191152 -0.281825442567315 -33.9870323321221  
-0.999102888937667 0.0415694722733054 -0.00809137117458897 7.33454194403716  
0.00395945227677019 0.281913755733053 0.959431568452144 199.843631658064  
0 0 0 1

T\_DWItoT1.txt of successful subjects:  
0.999998759047338 0.00143857549017103 0.000584124524436271 0.121877574512344  
-0.00144455474726325 0.999945280622288 0.0103628337985956 -0.228377658637532  
-0.000569184741492841 -0.0103636854523763 0.999946150616915 -0.334588904044225  
0 0 0 1
