Segmentation fault (core dumped)


I am getting segmentation fault error after creating the WM_FODs and also a warning “Diffusion encoding of input file does not match number of image volumes; omitting gradient information from output image” while performing mrconvert WM_FODs.mif … and then "segmentation fault " in mrview WM_FODs.mif and in “tckgen WM_FODs.mif 1M.tck -act TT.mif -backtrack -crop_at_gmwmi -seed_dynamic WM_FODs.mif -maxlength 250 -number 1M -cutoff 0.06”.
I have also put the mrinfo of WM_FODs,mif. But I am not be able to interpret what is causing the error “segmentation fault”.
I have done these steps before with same set of HCP data (subject 100307) and it was successful. Now only thing which is different is ubuntu 16. 04, does that cause anything?

The commands execution snippet:

DQ77MK:~/HCP_Data/2016-09-20/100307$ dwi2fod msmt_csd DWI.mif RF_WM.txt WM_FODs.mif RF_GM.txt GM.mif RF_CSF.txt CSF.mif -mask nodif_brain_mask.nii.gz
dwi2fod: [100%] uncompressing image "nodif_brain_mask.nii.gz"
dwi2fod: [100%] performing multi-shell, multi-tissue CSD
DQ77MK:~/HCP_Data/2016-09-20/100307$ mrconvert WM_FODs.mif - -coord 3 0 | mrcat CSF.mif GM.mif - tissueRGB.mif -axis 3
mrconvert: [WARNING] Diffusion encoding of input file does not match number of image volumes; omitting gradient information from output image
mrconvert: [100%] copying from “WM_FODs.mif” to "/tmp/mrtrix-tmp-vQLG1q.mif"
mrcat: [100%] concatenating "CSF.mif"
mrcat: [100%] concatenating "GM.mif"
mrcat: [100%] concatenating "/tmp/mrtrix-tmp-vQLG1q.mif"
DQ77MK:~/HCP_Data/2016-09-20/100307$ mrview tissueRGB.mif -odf.load_sh WM_FODs.mif
Segmentation fault (core dumped)

DQ77MK:~/HCP_Data/2016-09-20/100307$ tckgen WM_FODs.mif 1M.tck -act 5TT.mif -backtrack -crop_at_gmwmi -seed_dynamic WM_FODs.mif -maxlength 250 -number 1M -cutoff 0.06
tckgen: [100%] resampling ACT 5TT image to fixel image space
tckgen: [100%] segmenting FODs
Segmentation fault (core dumped)

DQ77MK:~/HCP_Data/2016-09-20/100307$ mrinfo WM_FODs.mif

Image: “WM_FODs.mif”

Dimensions: 145 x 174 x 145 x 45
Voxel size: 1.25 x 1.25 x 1.25 x 1
Data strides: [ -2 3 4 1 ]
Format: MRtrix
Data type: 32 bit float (little endian)
Intensity scaling: offset = 0, multiplier = 1
Transform: 1 0 0 -90
-0 1 0 -126
-0 0 1 -72
comments: FSL5.0
dw_scheme: [ 288 entries ]
mrtrix_version: 0.3.15-266-g2bf78387

Mrregister error

Am I correct in assuming that you’ve just switched to Ubuntu 16.04, and that these commands worked fine before on the same data running on a previous version of Ubuntu? If so, then the reason is most likely related to the particular version of Eigen that Ubuntu ships on 16.04, as in this post.

Can I just check whether your MRtrix install is up to date? We committed some changes a couple of weeks ago that were supposed to fix this problem, but it’s likely we might have missed some edge cases, which might not have been picked up in testing. If your install is more recent, then we’ll need to investigate these particular errors on our side. Maybe you can update with git pull; ./build and try again just to make sure…?

If that didn’t help, then the simplest fix is to download the stable release of Eigen - you’ll find instructions to do this here.


Hi @jdtournier
Thanks for the input.
Yes I have switched to Ubuntu 16.04 but not very recently.
I had updated the Eigen version for Ubuntu 16 .04 discarding the beta version and kept it in mrtrix3 folder.
But recently I have deleted the mrtrix3 and re-cloned it again. So may be the latest eigen version has been deleted and again mrtix3 is working on eigen beta 1-2 version.
So thanks for the insight, I will definitely start checking with eigen version.

Many thanks!


OK, that would explain it. If that was the issue, can you check how recent your MRtrix install was? If it was up to date (i.e. after the additions we made recently), yet still crashes out, then we have some work to do…


Hi @jdtournier,
Here is my reply:

  1. Before today, I reinstall MRtrix on 19/09/16. (That’s the time the Eigen version was deleted from mrtrix3 folder).
  2. But for safer side I again did git pull & ./build mrtrix.
  3. I run the tckgen command but got the segmentation fault error.
  4. I updated the Eigen version:-
    tar xvfz 3.2.8.tar.gz
    rm -f 3.2.8.tar.gz
    mv eigen-eigen-* eigen
    EIGEN_CFLAGS="-isystem $(pwd)/eigen" ./configure

5. I run the tckgen command and it is running successfully.



Thanks for checking, that’s really useful. We’ll look into what we might have overlooked, and hopefully get it fixed properly…