# 5ttgen fsl ERROR

**URL:** https://community.mrtrix.org/t/5ttgen-fsl-error/1379
**Category:** Uncategorized
**Created:** [December 18, 2017, 3:11pm UTC](https://community.mrtrix.org/t/5ttgen-fsl-error/1379 "2017-12-18T15:11:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jnovak](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jnovak](https://community.mrtrix.org/u/jnovak)
#### Post date: [December 18, 2017, 3:11pm UTC](https://community.mrtrix.org/t/5ttgen-fsl-error/1379/1 "2017-12-18T15:11:21Z")

</div>

Hi All,

I have encountered an error in my analysis that has started happening half way through my patient cohort. Part of the way through the 5ttgen fsl script this error occurs and I don’t know how to get around it:

[ERROR] Unable to find FSL output file for path “first\_all\_none\_firstseg”

There have been no updates to any of the software to my knowledge in this intervening time. I am currently stuck as I can’t produce any more 5ttgen maps for my analysis and was wondering if anybody had a solution.

Thanks,  
Jan

---

<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: [December 19, 2017, 3:58am UTC](https://community.mrtrix.org/t/5ttgen-fsl-error/1379/2 "2017-12-19T03:58:50Z")

</div>

Hi Jan,

FSL’s FIRST tool is genuinely failing for some of your subjects. Unfortunately `5ttgen fsl` is producing an intermediate error regarding one of the internal library functions, rather than providing the error it was intended to (see code [here](https://github.com/MRtrix3/mrtrix3/blob/master/lib/mrtrix3/_5ttgen/fsl.py#L177-L180)); however fundamentally the issue is that the `run_first_all` script is failing, and hence `5ttgen fsl` cannot proceed.

While I have implemented improvements to the Python library regarding how the outcomes of the `run_first_all` script are assessed & reported to users, and hope to push this to users, I cannot provide support on the underlying operation of FSL commands themselves. Unless by chance your failure is being caused by [unnecessary image down-sampling](https://community.mrtrix.org/t/5ttgen-waiitng-for-creation-of-new-file/1044/3?u=rsmith).

Cheers  
Rob

---

<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: [December 20, 2017, 1:10am UTC](https://community.mrtrix.org/t/5ttgen-fsl-error/1379/3 "2017-12-20T01:10:48Z")

</div>

Jan / anybody else who has had issues with `5ttgen fsl` or `labelsgmfix` (I know there’s plenty of you out there),

I’ve now merged an update to the _MRtrix3_ master branch that alters how these scripts assess the outcomes of the FSL `run_first_all` script and report any issues back to the user. It should also negate the necessity to disable SGE. While it can’t prevent overall failure of the script if FIRST is genuinely unable to segment one or more structures, I’m hoping that this new solution will be more robust and provide more meaningful feedback. So any independent testing of these changes with problematic data would be very much appreciated.

Note that updating _MRtrix3_ via the master branch will _not_ alter the outcome of any command, unless the existing outcome is considered egregious. Any changes to _MRtrix3_ that alter outcomes that may otherwise be considered reasonable are reserved for a tagged update, with associated announcement about those changes. Therefore, updating _MRtrix3_ on the `master` branch can be done without fear of altering experimental outcomes.

Cheers  
Rob

---

<div class="post-metadata">

### Author: ![jnovak](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jnovak](https://community.mrtrix.org/u/jnovak)
#### Post date: [December 20, 2017, 2:11pm UTC](https://community.mrtrix.org/t/5ttgen-fsl-error/1379/4 "2017-12-20T14:11:29Z")

</div>

Hi Rob,

Thanks so much for your rapid response. I have now solved my particular problem.

In my case I was mistakenly using skull-stripped T1-weighted images for the 5ttgen image creation which was never going to work. It now makes sense now that I know that the FIRST algorithm was failing.

Thanks,  
Jan

---

<div class="post-metadata">

### Author: ![Antonin\_Skoch](https://community.mrtrix.org/user_avatar/community.mrtrix.org/antonin_skoch/32/358_2.png) [@Antonin\_Skoch](https://community.mrtrix.org/u/Antonin_Skoch)
#### Post date: [December 20, 2017, 6:18pm UTC](https://community.mrtrix.org/t/5ttgen-fsl-error/1379/5 "2017-12-20T18:18:37Z")

</div>

> [@jnovak](#):
>
> using skull-stripped T1-weighted images for the 5ttgen image creation which was never going to work.

I am regularly using skull-stripped T1 images (from FreeSurfer) for `5ttgen` without any problem. In that case `-premasked` option has to be specified. I consider avoiding `bet` (which is run as part of `5ttgen` when using not skull-stripped image) even beneficial due to the common difficulties with accuracy of `bet` on T1 structural images.
