5ttgen stuck at first-L_accu_first.vtk


#1

Hi all,

I’m using 5ttgen fsl on a T1 to DWI registered image and it’s stuck on Waiting for creation of new file "first-L_Accu_first.vtk". I checked the first.logs with cat * . logs/*.e*:

Cannot open volume first-L_Accu_corr for reading!
Cannot open volume first-L_Accu_first for reading!
Image Exception : #22 :: ERROR: Could not open image first_all_none_origsegs
Aborted

I checked the tmp folder and It seems first can not build first-L_accu_first.vtk from the beginning. All other first.vtks like Thal, Put, etc are built. Any suggestions on what should I do?

Bests,
Amir


5ttgen waiitng for creation of new file
#2

Hi Amir,

I have encountered a similar issue, fsl first has actually failed to segment the L Accumbens.

I haven’t actually tried to solve this issue, but must ask two questions first:

  1. Are you using a MPRAGE or MP2RAGE T1-image as input into 5ttgen?. Only the MP2RAGE is problematic for me.

  2. Does the error still arise without first co-registrating the image into DWI space?

Thanks,

Alistair


#3

Hi Alistair,

  1. All images are acquired on a 3T Siemens TimTrio scanner and dicom header says the T1 is t1_mpr_ns_sag_p2_iso. I guess this means MPRAGE, not MP2RAGE, right?.

  2. Interestingly it’s running smoothly on native T1 image. I think the registration was problematic. But a further problem arises: Is it possible to register after 5ttgen?
    For more info, to perform the registration I converted biasfield corrected preprocessed dwi into nifti, extract the first b0, and use fsl flirt (cost function=mutualinfo, dof=12). Couldn’t do it by mrregister, the command is not suitable for such conversions.

Bests,
Amir

Update: 5ttgen has finished with this error:

5ttgen: [WARNING] Command failed: 5ttcheck result.mif
5ttgen: [WARNING] Generated image does not perfectly conform to 5TT format


Image "5TT.mif" contains 1 brain voxels with non-unity sum of partial volume fractions
#4

All other first.vtks like Thal, Put, etc are built.

OK, that’s interesting; I was under the impression that it was most typically the registration steps in run_first_all that failed, in which case none of the segmentations would be produced.

Firstly, I would confirm that you are able to reproduce the fault by manually executing run_first_all on the relevant T1 image. It may seem like a pointless exercise, but from a software support perspective it makes a very big difference whether MRtrix3 is doing something that is causing an FSL tool to fail, or whether the FSL tool is failing for your data independently of MRtrix3.

The second thing you could try is executing the fsl_anat script. I mentioned here that 5ttgen fsl could conceivably be modified to make use of this FSL-maintained script; it’s possible that some of the extra steps in that script are making the process more robust. (Or maybe I could just duplicate those extra steps)

Interestingly it’s running smoothly on native T1 image. I think the registration was problematic. But a further problem arises: Is it possible to register after 5ttgen?

5ttgen does not incorporate any multi-modal registration, nor does it depend on DWI data in any way.

Update: 5ttgen has finished with this error:

OK, an up-to-date MRtrix3 5ttgen shouldn’t be producing that error. If you run 5ttcheck manually, you should be able to get a more specific error message, and optionally a mask of image voxels where an error was detected.


#5

Thanks Robert.

I manually ran run_first_all and it completed without error, but there’s the same error in the logs, it can not generate L-accu. It seems the problem is because of the registration, since it runs without any error on native T1 brain.[quote=“rsmith, post:4, topic:941”]
5ttgen does not incorporate any multi-modal registration, nor does it depend on DWI data in any way.
[/quote]
I’m doing 5ttgen to perform ACT. That’s why I registered the T1 to DWI before any other step to prevent further misalignments. Can I do the registration after 5ttgen? Or does MRtrix does it itself for ACT?

I’ve just updated MRtrix before analysis using git pull. Maybe there’re some old binaries still remaining. Moreover, as I noticed, 5ttgen has brain extraction (BET) within its steps. So, I ran it on raw head T1 image (I did it on extracted brain tissue previously, the result was with massive grey matter erosions). Although it gave me the same 5ttgen error as it gave me previously, it’s visually ok. I ran 5ttcheck manually and here’s the error:

5ttcheck: [WARNING] Image “5tt_from_t1.mif” contains 1 brain voxels with non-unity sum of partial volume fractions
5ttcheck: [ERROR] Input image does not conform to 5TT format


#6

I manually ran run_first_all and it completed without error, but there’s the same error in the logs, it can not generate L-accu. It seems the problem is because of the registration, since it runs without any error on native T1 brain.

Depends on your definition of “completed without error”. As far as I can tell, run_first_all never actually returns a non-zero error code to indicate that a problem has occurred; hence the gymnastics in 5ttgen fsl trying to determine whether or not the segmentation was successful.

I would have expected that if the registration had failed, then none of the sub-cortical structures would be segmented. If some structures are segmented but others aren’t, I don’t see how this could be caused by the registration step.

I’m doing 5ttgen to perform ACT. That’s why I registered the T1 to DWI before any other step to prevent further misalignments. Can I do the registration after 5ttgen? Or does MRtrix does it itself for ACT?

Some explicit registration between DWI and T1 is required. You can do this registration before or after 5ttgen, though personally I recommend before, as there’s a possible mistake to be made in registering the T1 to DWI after 5ttgen but failing to apply that transformation to the 5TT image. The point I was making here is that, internally, 5ttgen is entirely independent of the DWI data, and therefore should be invariant to whether or not such a registration step has already been performed.

Moreover, as I noticed, 5ttgen has brain extraction (BET) within its steps. So, I ran it on raw head T1 image (I did it on extracted brain tissue previously, the result was with massive grey matter erosions).

If the image you provide as input to 5ttgen fsl has already been brain extracted, you should indicate this using the -premasked option. This will bypass the brain masking steps in the script.

5ttcheck: [WARNING] Image "5tt_from_t1.mif" contains 1 brain voxels with non-unity sum of partial volume fractions

So there’s a single voxel in the brain where the tissue fractions don’t sum to 1. Unlikely to severely affect your analysis, hence why it’s only a warning in 5ttgen rather than an error. From memory, this can occasionally occur in isolated voxels in the output of FAST, independently of 5ttgen, and it would seem that in some instances these gymnastics are not sufficient to correct it. But you can use 5ttcheck -masks then maskdump to tell you exactly where that voxel is, and then examine it through the script’s intermediate images to see where the problem arises.


#7

Hey @rsmith, @AmirHussein,

Ill weigh in with the co-registrations question:

My preference is to do the co-registration after, as the tissue-segmentation software is already highly-sensitive to different scanners, acquisition types, and bias correction options etc. Interpolating the T1-weighted tissue-signal intensities with co-registration (and reducing the spatial-resolution), could hence influence the segmentation-accuracy - although this is something I haven’t directly tested.

I achieve the best results with freesurfers bbregister, and then do a few transforms afterwards (but yes it can be error prone to the non-informed). @rsmith, @jdtournier - perhaps a section on the mrtrix docs briefly describing co-registration steps would be suitable for newer-users?

Best,

Alistair


#8

I think that there is no need to do any interpolation / resampling to lower resolution in coregistration. It absolutely suffices for mrtrix processing only to modify the vox2ras transform in the image header of either T1 or DWI. This operation is absolutely safe and therefore can be done before or after 5ttgen, as said @rsmith.

I confirm that bbregister is in my view best tool for rigid body coregistration (or bbr option in FLIRT which effectively uses the same algorithm).


#9

Hi everyone,

I ran 5ttgen with gif option. I had the same issue as Amir. As you suggested I investigated the voxels where the tissue fraction don’t sum up to 1 (figure bellow)

. In black are the voxels that don’t sum to 1 and in white the voxels that sum to 1.
It seems the grey matter tissue is where the problem occurs. I tried using fsl and T1 images but I got the same problem. And help?
Thank you.

Hassna