Labelsgmfix left thalamus not labelled

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 today, it’s important to trace back to the root of the problem, rather than focusing on the final symptom).

Rob