Labelconvert error

Hi all,

I’m encountering an issue when running MRtrix3’s 5ttgen freesurfer command. During processing, the labelconvert step throws the following error:

[ERROR] Inconsistent number of columns in LUT file "FreeSurferColorLUT.txt"
[ERROR] Initial file contents contain 6 columns, but line 511 contains 7 entries:
[ERROR] "819 Left-HypoThal-noMB           0  80   0 0 2"

Upon inspecting the FreeSurferColorLUT.txt file, I noticed that some lines (e.g., below) contain 7 columns instead of the expected 6:

# sclimbic
819 Left-HypoThal-noMB           0  80   0 0 2
820 Right-HypoThal-noMB         15 165   15 0 2
821 Left-Fornix                  0 255 255 0 3
822 Right-Fornix                27 187 253 0 3 
843 Left-MammillaryBody        178 255  80 0 2
844 Right-MammillaryBody        25 246  80 0 2
853 Mid-AntCom                  60  58 210 0 3
865 Left-Basal-Forebrain       170  85   0 0 2
866 Right-Basal-Forebrain      139  69  19 0 2
869 Left-SeptalNuc             255 170 255 0 2
870 Right-SeptalNuc            191 127 191 0 2
...

Could someone please advise how to handle or fix this 7-column format so that labelconvert runs correctly? Any recommended solutions or workarounds would be greatly appreciated!

Thanks in advance!

Hi Maiwulanjiang,
Welcome to the forum!

This has been flagged by Freesurfer (see here for details).

A quick fix would be to remove the last column containing the 2s and 3s from the LUT

Hope this helps :slight_smile:
Arkiev

Thanks a lot, adsouza! That fix did the trick—removing the last column solved the issue. Really appreciate your help!

Cheers,
Maiwulanjiang

1 Like