5TT hsvs fails in some but not all subjects

Dear experts,

I’m trying to use the hsvs option in 5ttgen using existing freesurfer segmentations (FreeSurfer 7.1.1.). For most of my subjects this works beautifully but for 5-10% of my sample I end up with something that looks like this for the grey matter:

The white matter looks similar and the subcortical segmentations are not present eventhough 5ttgen doesn’t give an error when it is running FSL FIRST.

Conversely others look like this:

in both cases the same version of freesurfer was used and the freesurfer segmentations look correct. I’m running MRtrix3 version 3.0.2. the full command is:

5ttgen hsvs freesurferdir/sub-JobName JobName_5TThsvs.nii.gz -hippocampi aseg -thalami nuclei -white_stem -nthreads 10 -nocrop -scratch workdir/temp_5ttgen

do you have any idea what might be going wrong here?

many thanks!


one additional observation: the fourth volume in the 5TT image, the CSF compartment, consists of a cube of 1’s spanning the entire FOV.

Maybe check when you run FAST and FIRST on the T1 of one of these participants, whether it completes successfully? It might have something to do with these FSL commands failing…

Sometimes, using fslreorient2std before running FIRST and FAST improves the internal brain extraction, registration and segmentation steps.

Hope this helps,

Hi Nick,

thanks for your reply. I was under the impression that the different compartments were not segmented (again) by FSL FAST when using hsvs but that these were derived from the FreeSurfer segmentation and that only FSL FIRST was run? in any case FAST and FIRST give good segmentations when running them separately on the same T1w image that was used in FreeSurfer so I think the problem lies somewhere else.

best, Chris

Hi again,

You are right, the CSF segmentation is obtained from the FS image. In the meantime, I found a similar problem for one of my participants and was trying to debug.

It looks like the issue lies at the step of creating the CSF compartment from the FS labels, and I could see that the 5th ventricle image was not created correctly for this participant which then threw everything off.

You might need to check which of the images contributing to the CSF compartment are problematic, and you could potentially leave it out if it has a small coverage.


Hi Nick,

thanks for the tip. I checked the freesurfer aseg.stats files of these subjects and the 5th ventricle indeed has a volume of 0.0. Nevertheless, scans from other subjects also have a 0.0 volume of that ventricle and seem to be processed ok. I tried to change the 5ttgen hsvs code to not include the 5th ventricle but that did not fix the issue. Neither did switching to FreeSurfer 7.2. Did you have more luck debugging the issue and/or do you have another way in which I can leave out images from the CSF compartment and still rung 5ttgen hsvs?

all the best, Chris

Hi Chris,

Okay, I think you will need to debug it yourself to see exactly which label is causing trouble in this participant.

You can run 5ttgen hsvs with the -nocleanup option. Once it runs through, look at the log.txt file and find the images that are used to create the tissue3_init.mif file. When you view each of these individually, it will become clear which is the faulty one. Then you can leave that one out and see if the result is fine. If so, just copy paste the remaining commands from the log.txt file to get the 5TT file.


Hi Nick,

That did the trick! it seemed that something went wrong with Left-Vessel or Right-Vessel (but mostly Right-Vessel) that threw off the entire CSF compartiment. Not taking them into account when constructing tissue3_init.mif and rerunning the other steps led to accurate 5TT images.

thanks a lot for your help!

best, Chris

1 Like