5ttgen fsl error for run_first

Dear,

I am using the 5ttgen fsl command with the IndexError: list index out of range for the run_first step. How could I fix it? Thanks!

Hi Sunpan,

I would suggest trying the following:

  1. Use an older version of Python. I found that 5ttgen can throw error messages with modern Python versions if MRtrix3 isn’t fully up to date.
  2. Double-check that FSL is loaded in your virtual environment.
  3. Try loading an older version of FSL if you are currently using the latest release.

Following these steps resolved a similar issue I encountered.

I hope this helps,

John

Hi @sunpan,

This looks to be an unexpected scenario following #2609, which means it likely affects 3.0.5 and later. That change was intended to improve the interaction between FSL’s run_first_all, which has a lot of variation in how it executes and whether it fully executes successfully and how this is reported, and MRtrix3 scripts that invoke it.

While I can tweak the code to try to handle this more gracefully, it’s entirely possible that there is nevertheless something else going wrong. What would be useful to know is:

  1. Within the Python script’s scratch directory, have all of the files generated by FSL’s run_first_all been created successfully?
  2. If no:
    1. Do the FSL log files provide any insight?
    2. What happens if from within that directory you manually invoke run_first_all? Is anything produced at the command-line?

Thanks
Rob

This change is hopefully all that is required if you want to try just locally modifying your MRtrix3 code.