5ttgen FSL hanging indefinetly

Hi,

I have inherited a project from a colleague, which involved using 5ttgen fsl to classify tisue. I have set up fsl and mrtrix on my computer (ubuntu 18.04), but when I run the same command that works on his computer (and using the same dataset) on my computer, it hangs indefinetly. I suspected that this had to do with with the program not finding the right files in the MRtrix/bin folder, so I added that to the PATH, but it still does not work. I would be grateful if you can help me troubleshoot this problem.

aelkady@rutland:~/work/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii$ echo $PATH
/export02/data/Toolboxes/mrtrix3/bin:/usr/share/fsl/5.0/bin:/export02/data/Toolboxes/mrtrix3/bin:/home/bic/aelkady/bin:/opt/minc/1.9.16/bin:/opt/minc/1.9.16/p
ipeline:/opt/sge/bin:/opt/sge/bin/lx-amd64:/home/bic/aelkady/bin:/opt/sge/bin:/opt/sge/bin/lx-amd64:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/local/mni/b
in:/usr/local/matlab/bin:/opt/bin:/usr/games
aelkady@rutland:~/work/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii$ source /usr/share/fsl/5.0/etc/fslconf/fsl.sh; export FSLDIR=/usr/share/fsl/5.0; expo
rt PATH=/usr/share/fsl/5.0/bin:${PATH}; export PATH=/export02/data/Toolboxes/mrtrix3/bin:${PATH}; cd ~/Desktop/work/Tim/data/20190326_invivowavecaipi_m-m_005_
m12/nii; 5ttgen fsl 20190326_075937mnigre3DT1wPreGds028a1001.nii.gz 5ttgenOut.nii.gz -debug -nocrop -force ;
5ttgen:
5ttgen: Note that this script makes use of commands / algorithms that have relevant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please c
onsult the help page (-help option) for more information.
5ttgen:
5ttgen: [DEBUG] path.scriptSubDirName() (from algorithm.py:52): _5ttgen
5ttgen: Generated temporary directory: /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/
5ttgen: [DEBUG] path.fromUser() (from fsl.py:24): 20190326_075937mnigre3DT1wPreGds028a1001.nii.gz -> /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_
m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz
5ttgen: [DEBUG] path.newTemporary() (from image.py:11): /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/mrtrix-tmp-U3F0L5.j
son
5ttgen: [DEBUG] run.exeName() (from run.py:349): mrinfo -> mrinfo
5ttgen: [DEBUG] run.versionMatch() (from image.py:12): Version-matched executable for mrinfo: /export02/data/Toolboxes/mrtrix3/bin/mrinfo
5ttgen: [DEBUG] run.exeName() (from image.py:12): /export02/data/Toolboxes/mrtrix3/bin/mrinfo -> /export02/data/Toolboxes/mrtrix3/bin/mrinfo
5ttgen: Loading header for image file '/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz'
5ttgen: [DEBUG] image.__init__() (from image.py:105): ['/export02/data/Toolboxes/mrtrix3/bin/mrinfo', '/export02/data/Tim/data/20190326_invivowavecaipi_m-m_00
5_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz', '-json_all', '/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/m
rtrix-tmp-U3F0L5.json']
5ttgen: [DEBUG] image.__init__() (from image.py:105): {'_intensity_offset': 0.0, '_format': u'NIfTI-1.1 (GZip compressed)', '_transform': [[1.0, 0.0, 0.0, -90
.4662628173828], [-0.0, 0.982287250364135, -0.18738131649678, -102.33479309082], [-0.0, 0.18738131649678, 0.982287250364135, -115.826759338379], [0.0, 0.0, 0.
0, 1.0]], '_intensity_scale': 1.0, '_datatype': u'Int16LE', '_name': u'/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3
DT1wPreGds028a1001.nii.gz', '_keyval': {u'comments': u'irl_a_gre_helms\nTE=4.920000076;sec=32954.8475;phaseDir=+'}, '_size': [192, 256, 192], '_spacing': [1.0
, 1.0, 1.0], '_strides': [-1, 2, 3]}
5ttgen: [DEBUG] image.check3DNonunity() (from fsl.py:24): Image '/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPr
eGds028a1001.nii.gz' is >= 3D, and does not contain a unity spatial dimension
5ttgen: [DEBUG] path.fromUser() (from fsl.py:25): 20190326_075937mnigre3DT1wPreGds028a1001.nii.gz -> /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_
m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz
5ttgen: [DEBUG] path.toTemp() (from fsl.py:25): input.mif -> /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/input.mif
5ttgen: [DEBUG] run.exeName() (from run.py:349): mrconvert -> mrconvert
5ttgen: [DEBUG] run.versionMatch() (from run.py:57): Version-matched executable for mrconvert: /export02/data/Toolboxes/mrtrix3/bin/mrconvert
5ttgen: [DEBUG] run._shebang() (from run.py:67): File "/export02/data/Toolboxes/mrtrix3/bin/mrconvert": Not a text file
5ttgen: [DEBUG] run.command() (from fsl.py:25): To execute: [['/export02/data/Toolboxes/mrtrix3/bin/mrconvert', '/export02/data/Tim/data/20190326_invivowaveca
ipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz', '/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/inpu
t.mif', '-info']]
Command:  mrconvert /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz /export02/data/Tim/data/2
0190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/input.mif
mrconvert: [INFO] opening image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz"..
.
mrconvert: [INFO] Axes and transform of image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a
1001.nii.gz" altered to approximate RAS coordinate system
mrconvert: [INFO] image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz" opened wi
th dimensions 192x256x192, voxel spacing 1x1x1, datatype Int16LE
mrconvert: [  0%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [  3%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [  6%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [  8%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 11%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 14%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 17%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 19%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 22%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 25%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 28%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 31%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 33%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 36%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 39%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 42%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 44%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 47%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 50%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 53%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 56%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 58%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 61%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 64%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 67%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 69%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 72%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 75%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 78%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 81%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 83%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 86%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 89%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 92%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 94%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [ 97%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
mrconvert: [100%] uncompressing image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii
.gz"
mrconvert: [INFO] creating image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/input.mif"...
mrconvert: [INFO] image "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/input.mif" created with dimensions 192x2
56x192, voxel spacing 1x1x1, datatype Int16LE                                                                                                                  
mrconvert: [100%] copying from "/export02/...e3DT1wPreGds028a1001.nii.gz" to "/export02/...5ttgen-tmp-66TSZP/input.mif"
5ttgen: Changing to temporary directory (/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/)
5ttgen: [DEBUG] fsl.exeName() (from fsl.py:47): fsl5.0-bet
5ttgen: [DEBUG] fsl.exeName() (from fsl.py:48): fsl5.0-fast
5ttgen: [DEBUG] fsl.exeName() (from fsl.py:49): fsl5.0-run_first_all
5ttgen: [DEBUG] fsl.exeName() (from fsl.py:50): fsl5.0-standard_space_roi
5ttgen: [DEBUG] fsl.suffix() (from fsl.py:56): NIFTI_GZ -> .nii.gz
5ttgen: [DEBUG] path.newTemporary() (from image.py:11): /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/mrtrix-tmp-LVUYAK.j
son                                                                                                                                                            
5ttgen: [DEBUG] run.exeName() (from run.py:349): mrinfo -> mrinfo
5ttgen: [DEBUG] run.versionMatch() (from image.py:12): Version-matched executable for mrinfo: /export02/data/Toolboxes/mrtrix3/bin/mrinfo
5ttgen: [DEBUG] run.exeName() (from image.py:12): /export02/data/Toolboxes/mrtrix3/bin/mrinfo -> /export02/data/Toolboxes/mrtrix3/bin/mrinfo
5ttgen: Loading header for image file 'input.mif'
5ttgen: [DEBUG] image.__init__() (from fsl.py:62): ['/export02/data/Toolboxes/mrtrix3/bin/mrinfo', 'input.mif', '-json_all', '/export02/data/Tim/data/20190326
_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/mrtrix-tmp-LVUYAK.json']                                                                                    
5ttgen: [DEBUG] image.__init__() (from fsl.py:62): {'_intensity_offset': 0.0, '_format': u'MRtrix', '_transform': [[1.0, 0.0, 0.0, -90.4662628173828], [-0.0,
0.982287250364135, -0.18738131649678, -102.33479309082], [-0.0, 0.18738131649678, 0.982287250364135, -115.826759338379], [0.0, 0.0, 0.0, 1.0]], '_intensity_sc
ale': 1.0, '_datatype': u'Int16LE', '_name': u'input.mif', '_keyval': {u'command_history': u'/export02/data/Toolboxes/mrtrix3/bin/mrconvert "/export02/data/Ti
m/data/20190326_invivowavecaipi_m-m_005_m12/nii/20190326_075937mnigre3DT1wPreGds028a1001.nii.gz" "/export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12
/nii/5ttgen-tmp-66TSZP/input.mif" "-info"  (version=3.0_RC3-135-g2b8e7d0c)', u'mrtrix_version': u'3.0_RC3-135-g2b8e7d0c', u'comments': u'irl_a_gre_helms\nTE=4
.920000076;sec=32954.8475;phaseDir=+'}, '_size': [192, 256, 192], '_spacing': [1.0, 1.0, 1.0], '_strides': [-1, 2, 3]}                                         
5ttgen: [DEBUG] run.exeName() (from run.py:349): mrconvert -> mrconvert
5ttgen: [DEBUG] run.versionMatch() (from run.py:57): Version-matched executable for mrconvert: /export02/data/Toolboxes/mrtrix3/bin/mrconvert
5ttgen: [DEBUG] run._shebang() (from run.py:67): File "/export02/data/Toolboxes/mrtrix3/bin/mrconvert": Not a text file
5ttgen: [DEBUG] run.command() (from fsl.py:71): To execute: [['/export02/data/Toolboxes/mrtrix3/bin/mrconvert', 'input.mif', 'T1.nii', '-strides', '-1,+2,+3',
'-info']]                                                                                                                                                     
Command:  mrconvert input.mif T1.nii -strides -1,+2,+3
mrconvert: [INFO] opening image "input.mif"...
mrconvert: [INFO] image "input.mif" opened with dimensions 192x256x192, voxel spacing 1x1x1, datatype Int16LE
mrconvert: [INFO] opening image "-1,+2,+3"...
mrconvert: [INFO] creating image "T1.nii"...
mrconvert: [INFO] image "T1.nii" created with dimensions 192x256x192, voxel spacing 1x1x1, datatype Int16LE
mrconvert: [100%] copying from "input.mif" to "T1.nii"
5ttgen: [DEBUG] run.exeName() (from run.py:349): maskfilter -> maskfilter
5ttgen: [DEBUG] run.versionMatch() (from run.py:57): Version-matched executable for maskfilter: /export02/data/Toolboxes/mrtrix3/bin/maskfilter
5ttgen: [DEBUG] run._shebang() (from run.py:67): File "/export02/data/Toolboxes/mrtrix3/bin/maskfilter": Not a text file
5ttgen: [DEBUG] run.command() (from fsl.py:115): To execute: [['/export02/data/Toolboxes/mrtrix3/bin/maskfilter', '/usr/share/fsl/5.0/data/standard/MNI152_T1_
1mm_brain_mask_dil.nii.gz', 'dilate', 'mni_mask.nii', '-npass', '4', '-info']]                                                                                 
Command:  maskfilter /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain_mask_dil.nii.gz dilate mni_mask.nii -npass 4
maskfilter: [INFO] opening image "/usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain_mask_dil.nii.gz"...
maskfilter: [INFO] Axes and transform of image "/usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain_mask_dil.nii.gz" altered to approximate RAS coo
rdinate system                                                                                                                                                 
maskfilter: [INFO] image "/usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain_mask_dil.nii.gz" opened with dimensions 182x218x182, voxel spacing 1x
1x1, datatype Float32LE                                                                                                                                        
maskfilter: [100%] uncompressing image "/usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain_mask_dil.nii.gz"
maskfilter: [INFO] creating image "mni_mask.nii"...
maskfilter: [WARNING] requested datatype (Bit) not supported - substituting with UInt8
maskfilter: [INFO] image "mni_mask.nii" created with dimensions 182x218x182, voxel spacing 1x1x1, datatype UInt8
maskfilter: [100%] applying dilate filter to image MNI152_T1_1mm_brain_mask_dil.nii.gz
5ttgen: [DEBUG] run.exeName() (from run.py:66): fsl5.0-standard_space_roi -> fsl5.0-standard_space_roi
5ttgen: [DEBUG] run.versionMatch() (from run.py:373): Command fsl5.0-standard_space_roi not found in MRtrix3 bin/ directory
5ttgen: [DEBUG] run.exeName() (from run.py:375): fsl5.0-standard_space_roi -> fsl5.0-standard_space_roi
5ttgen: [DEBUG] run._shebang() (from run.py:67): File "fsl5.0-standard_space_roi": string "#! /bin/sh -e": ['/bin/sh', '-e']
5ttgen: [DEBUG] run.command() (from fsl.py:120): To execute: [['/bin/sh', '-e', '/usr/bin/fsl5.0-standard_space_roi', 'T1.nii', 'T1_preBET.nii.gz', '-maskMASK
', 'mni_mask.nii', '-roiNONE']]                                                                                                                                
Command:  fsl5.0-standard_space_roi T1.nii T1_preBET.nii.gz -maskMASK mni_mask.nii -roiNONE
5ttgen: [DEBUG] fsl.findImage() (from fsl.py:123): Image at expected location: "T1_preBET.nii.gz"
5ttgen: [DEBUG] run.exeName() (from run.py:66): fsl5.0-bet -> fsl5.0-bet
5ttgen: [DEBUG] run.versionMatch() (from run.py:373): Command fsl5.0-bet not found in MRtrix3 bin/ directory
5ttgen: [DEBUG] run.exeName() (from run.py:375): fsl5.0-bet -> fsl5.0-bet
5ttgen: [DEBUG] run._shebang() (from run.py:67): File "fsl5.0-bet": string "#! /bin/sh -e": ['/bin/sh', '-e']
5ttgen: [DEBUG] run.command() (from fsl.py:126): To execute: [['/bin/sh', '-e', '/usr/bin/fsl5.0-bet', 'T1_preBET.nii.gz', 'T1_BET.nii.gz', '-f', '0.15', '-R'
]]                                                                                                                                                             
Command:  fsl5.0-bet T1_preBET.nii.gz T1_BET.nii.gz -f 0.15 -R
5ttgen: [DEBUG] fsl.findImage() (from fsl.py:127): Image at expected location: "T1_BET.nii.gz"
5ttgen: [DEBUG] run.exeName() (from run.py:66): fsl5.0-fast -> fsl5.0-fast
5ttgen: [DEBUG] run.versionMatch() (from run.py:373): Command fsl5.0-fast not found in MRtrix3 bin/ directory
5ttgen: [DEBUG] run.exeName() (from run.py:375): fsl5.0-fast -> fsl5.0-fast
5ttgen: [DEBUG] run._shebang() (from run.py:67): File "fsl5.0-fast": string "#! /bin/sh -e": ['/bin/sh', '-e']
5ttgen: [DEBUG] run.command() (from fsl.py:143): To execute: [['/bin/sh', '-e', '/usr/bin/fsl5.0-fast', 'T1_BET.nii.gz']]
Command:  fsl5.0-fast T1_BET.nii.gz
5ttgen: [DEBUG] run.exeName() (from run.py:66): fsl5.0-run_first_all -> fsl5.0-run_first_all
5ttgen: [DEBUG] run.versionMatch() (from run.py:373): Command fsl5.0-run_first_all not found in MRtrix3 bin/ directory
5ttgen: [DEBUG] run.exeName() (from run.py:375): fsl5.0-run_first_all -> fsl5.0-run_first_all
5ttgen: [DEBUG] run._shebang() (from run.py:67): File "fsl5.0-run_first_all": string "#! /bin/sh -e": ['/bin/sh', '-e']
5ttgen: [DEBUG] run.command() (from fsl.py:160): To execute: [['/bin/sh', '-e', '/usr/bin/fsl5.0-run_first_all', '-m', 'none', '-s', 'L_Accu,R_Accu,L_Caud,R_C
aud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal', '-i', 'T1.nii', '-o', 'first', '-v']]                                                                          
Command:  fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first -v
5ttgen: FSL FIRST job has been submitted to SGE; awaiting completion
5ttgen: (note however that FIRST may fail silently, and hence this script may hang indefinitely)
5ttgen: [DEBUG] file.waitFor() (from fsl.py:17): ['first-L_Accu_first.vtk', 'first-R_Accu_first.vtk', 'first-L_Caud_first.vtk', 'first-R_Caud_first.vtk', 'fir
st-L_Pall_first.vtk', 'first-R_Pall_first.vtk', 'first-L_Puta_first.vtk', 'first-R_Puta_first.vtk', 'first-L_Thal_first.vtk', 'first-R_Thal_first.vtk']        
5ttgen: [  0%] Waiting for creation of 10 new items...

Does this thread help?

Thanks for your reply.

The same command works on a different computer, so I think it has to do with the way mrtrix was setup on this computer. Does the “not found” error message give any indication to the source of this problem? Example: “5ttgen: [DEBUG] run.versionMatch() (from run.py:373): Command fsl5.0-standard_space_roi not found in MRtrix3 bin/ directory”

No, I don’t think you need to worry about that. That’s just the script trying to figure out where the executable is located, etc.

I think this will probably be due to the use of SGE, which I can see you’re running here:

5ttgen: FSL FIRST job has been submitted to SGE; awaiting completion

coupled with FIRST failing to produce one or more of the expected outputs. I suggest you look into the temporary folder created by the script, located as stated in the output:

5ttgen: Generated temporary directory: /export02/data/Tim/data/20190326_invivowavecaipi_m-m_005_m12/nii/5ttgen-tmp-66TSZP/

and see if you can find all the .vtk output files listed on the waitFor() line:

5ttgen: [DEBUG] file.waitFor() (from fsl.py:17): ['first-L_Accu_first.vtk', 'first-R_Accu_first.vtk', 'first-L_Caud_first.vtk', 'first-R_Caud_first.vtk', 'first-L_Pall_first.vtk', 'first-R_Pall_first.vtk', 'first-L_Puta_first.vtk', 'first-R_Puta_first.vtk', 'first-L_Thal_first.vtk', 'first-R_Thal_first.vtk']

If they’re not all there, that’s the issue: the script will assume FIRST hasn’t completed and wait until that file appears. Problem is if FIRST gets invoked on an SGE-capable system, it’s difficult to query the system to figure out if the task has completed…

You can also try to avoid the use of SGE by unsetting any SGE related environment variables (if I remember right). I think that makes it easier for the script to detect failures…

Thanks for the quick response. I did not find any of the .vtk files, so that means that FSL FIRST has failed and I should troubleshoot FSL FIRST? Also, how would I “avoid the use of SGE by unsetting any SGE related environment variables”?

I think this thread should cover it…

Thanks for your reply. I have tried:
SGE_ROOT="" 5ttgen fsl 20190326_075937mnigre3DT1wPreGds028a1001.nii.gz 5ttgenOut.nii.gz -debug -nocrop -force ;

and got the following error:

Command: fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first -v

      Unable to initialize environment because of error: SGE_ROOT directory "" doesn't exist
      Exiting.

5ttgen:
5ttgen: [ERROR] Command failed: fsl5.0-run_first_all -m none -s

I have also tried unset SGE_ROOT; 5ttgen fsl 20190326_075937mnigre3DT1wPreGds028a1001.nii.gz 5ttgenOut.nii.gz -debug -nocrop -force ;

and got the following error:

Command: fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first -v

      Unable to initialize environment because of error: Please set the environment variable SGE_ROOT.
      Exiting.

5ttgen:
5ttgen: [ERROR] Command failed: fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first -v (fsl.py:160)

Unable to initialize environment because of error: SGE_ROOT directory "" doesn't exist
Unable to initialize environment because of error: Please set the environment variable SGE_ROOT.

These suggest that unsetting the SGE_ROOT environment variable was not adequate to prevent the run_first_all script from attempting to use SGE. I don’t know exactly what code is used in FSL to make the decision as to whether to use SGE, or indeed whether it is downstream of their code.

You should however still be able to gain some insight into the failure by checking the error log text files generated by the FIRST commands that are stored in the 5ttgen script’s scratch directory.

Hi again,

IT has unistalled SGE client from my computer, but I am still getting an error:

(base) aelkady@rutland:~$ source /usr/share/fsl/5.0/etc/fslconf/fsl.sh; export FSLDIR=/usr/share/fsl/5.0; export PATH=/usr/share/fsl/5.0/bin:${PATH}; export PATH=/export02/data/Toolboxes/mrtrix3/bin:${PATH}; cd /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii; 5ttgen fsl 20181018_101029mnigre3DT1wPreGds028a1001.nii.gz 5ttgenOut.nii.gz -nocrop -force ; 
5ttgen: 
5ttgen: Note that this script makes use of commands / algorithms that have relevant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please consult the help page (-help option) for more information.
5ttgen: 
5ttgen: Generated temporary directory: /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-CPW7XV/
Command:  mrconvert /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/20181018_101029mnigre3DT1wPreGds028a1001.nii.gz /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-CPW7XV/input.mif
5ttgen: Changing to temporary directory (/export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-CPW7XV/)
Command:  mrconvert input.mif T1.nii -strides -1,+2,+3
Command:  maskfilter /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain_mask_dil.nii.gz dilate mni_mask.nii -npass 4
Command:  fsl5.0-standard_space_roi T1.nii T1_preBET.nii.gz -maskMASK mni_mask.nii -roiNONE
Command:  fsl5.0-bet T1_preBET.nii.gz T1_BET.nii.gz -f 0.15 -R
Command:  fsl5.0-fast T1_BET.nii.gz
Command:  fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first
5ttgen: 
5ttgen: [ERROR] Command failed: fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first (fsl.py:160)
5ttgen: Output of failed command:
        The command you have requested cannot be found or is not executable
        Warning: SGE_ROOT environment variable is set but Grid Engine software not found, will run locally
        /usr/share/fsl/5.0/bin/fsl_sub: line 499: exec: qsub: not found
        Warning: SGE_ROOT environment variable is set but Grid Engine software not found, will run locally
        Warning: SGE_ROOT environment variable is set but Grid Engine software not found, will run locally
        Warning: SGE_ROOT environment variable is set but Grid Engine software not found, will run locally
5ttgen: 
5ttgen: Changing back to original directory (/export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii)
5ttgen: Script failed while executing the command: fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first
5ttgen: For debugging, inspect contents of temporary directory: /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-CPW7XV/

I also tried the command with “unset SGE_ROOT” but it also gives ana error:

(base) aelkady@rutland:/export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii$ ^C
(base) aelkady@rutland:/export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii$ source /usr/share/fsl/5.0/etc/fslconf/fsl.sh; export FSLDIR=/usr/shar
e/fsl/5.0; export PATH=/usr/share/fsl/5.0/bin:${PATH}; export PATH=/export02/data/Toolboxes/mrtrix3/bin:${PATH}; cd /export02/data/Tim/data/20181018_invivowav
ecaipi_b-p_027_m00/nii; unset SGE_ROOT; 5ttgen fsl 20181018_101029mnigre3DT1wPreGds028a1001.nii.gz 5ttgenOut.nii.gz -nocrop -force ;
5ttgen:
5ttgen: Note that this script makes use of commands / algorithms that have relevant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please c
onsult the help page (-help option) for more information.
5ttgen:
5ttgen: Generated temporary directory: /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-DL02YE/
Command:  mrconvert /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/20181018_101029mnigre3DT1wPreGds028a1001.nii.gz /export02/data/Tim/data/2
0181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-DL02YE/input.mif
5ttgen: Changing to temporary directory (/export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-DL02YE/)
Command:  mrconvert input.mif T1.nii -strides -1,+2,+3
Command:  maskfilter /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain_mask_dil.nii.gz dilate mni_mask.nii -npass 4
Command:  fsl5.0-standard_space_roi T1.nii T1_preBET.nii.gz -maskMASK mni_mask.nii -roiNONE
Command:  fsl5.0-bet T1_preBET.nii.gz T1_BET.nii.gz -f 0.15 -R
Command:  fsl5.0-fast T1_BET.nii.gz
Command:  fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first
5ttgen:
5ttgen: [ERROR] Command failed: fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1.nii -o first (fsl.
py:160)
5ttgen: Output of failed command:
The command you have requested cannot be found or is not executable
/usr/share/fsl/5.0/bin/fsl_sub: line 499: exec: qsub: not found
5ttgen:
5ttgen: Changing back to original directory (/export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii)
5ttgen: Script failed while executing the command: fsl5.0-run_first_all -m none -s L_Accu,R_Accu,L_Caud,R_Caud,L_Pall,R_Pall,L_Puta,R_Puta,L_Thal,R_Thal -i T1
.nii -o first                                                                                                                                                  
5ttgen: For debugging, inspect contents of temporary directory: /export02/data/Tim/data/20181018_invivowavecaipi_b-p_027_m00/nii/5ttgen-tmp-DL02YE/

Please use formatting for terminal dumps; it makes them infinitely more readable :+1:

All of these suggest that despite the “uninstallation” of SGE, and the unsetting of SGE_ROOT, FSL is still trying to execute FIRST using SGE. This is outside of the scope of MRtrix3, and I don’t know what internal logic is used when that script is run to decide how to execute the underlying commands. It might be possible that the FSL configuration script is setting something that causes SGE to be used?

Otherwise, even if running with SGE, it should still be possible to get more insight: while the .vtk files are absent, there should be some text files in the script directory that contain the stdout and stderr contents of the individual jobs. These should contain some indication of why the commands are failing.

I would also suggest reading this PR. The behaviour has not yet been changed in MRtrix3 (this will happen with the next update), but the fact that the fsl5.0-* commands are being invoked may be indicative of a setup issue. These files should not appear in PATH, and the FSL configuration script should be used.

Rob