# Labelsgmfix left thalamus not labelled

**URL:** <https://community.mrtrix.org/t/labelsgmfix-left-thalamus-not-labelled/1075>\
**Category:** Uncategorized\
**Created:** [August 1, 2017, 8:58pm UTC](https://community.mrtrix.org/t/labelsgmfix-left-thalamus-not-labelled/1075 "2017-08-01T20:58:04Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [August 10, 2017, 7:57am UTC](https://community.mrtrix.org/t/labelsgmfix-left-thalamus-not-labelled/1075/6 "2017-08-10T07:57:16Z")

</div>

> `NameError: name 'struct' is not defined`

OK, there’s a silly error in there with me using the wrong variable name, which is why you don’t get a more nicely formatted error message; but you can nevertheless tell from the message that FIRST isn’t happy.

> However it works fine if I use brain.mgz, and the parcellation with brain.mgz also looks fine.

If you’re using `brain.mgz`, you should be running `labelsgmfix` with the `-premasked` option. This passes the message through to FIRST that the image has already undergone brain extraction, and this influences which template image is used for registration.

If the script works with `brain.mgz` but not `orig.mgz`, I’m guessing that you acquisition includes a lot of neck, and that this is subsequently throwing out the initial registration step in the `run_first_all` script. Purely a guess though.

> Because of this I had thought to use brain.mgz in place of orig.mgz however I run into problems using  
> `5ttgen fsl brain.nii.gz 5tt.mif -force`  
> as i get an error with the 5tt.mif when trying to calculate the response functions.

You should also use the `-premasked` option if providing `brain.mgz` to the `5ttgen fsl` script; otherwise it will try to itself run brain extraction, which may remove large volumes of brain, causing concomitant issues down the line when you try to subsequently use the 5TT image to derive something else (as I mentioned in [another thread](http://community.mrtrix.org/t/5ttgen-output-vis-file-and-quality-control/1050/4) today, it’s important to trace back to the root of the problem, rather than focusing on the final symptom).

Rob

---

_[View the full topic](https://community.mrtrix.org/t/labelsgmfix-left-thalamus-not-labelled/1075)._
