Error while running tractoflow's tractography pipeline

I am getting following error on running the tractoflow pipeline:
[66/94972d] NOTE: Process Bet_Prelim_DWI (S1) terminated with an error exit status (1) -- Execution is retried (1)

Here’s the command I ran:
nextflow run tractoflow -r 2.4.3 --input /home/turing/tractoflow/via_direct_input/on_ismrm -with-singularity /home/turing/tractoflow/bids_project/scilus_1.6.0.sif -profile use_gpu -resume --run_local_tracking true

whole output log:

N E X T F L O W  ~  version 21.12.1-edge                                                                                                                    
Launching `scilus/tractoflow` [cheesy_varahamihira] - revision: 2ca9dad434 [2.4.3]                                                                          
TractoFlow pipeline                                                                                                                                         
===================                                                                                                                                         
                                                                                                                                                            
Start time: 2024-01-06T12:35:56.486694+05:30                                                                                                                
                                                                                                                                                            
Max DTI shell extracted: 1200                                                                                                                               
Min FODF shell extracted: 700                                                                                                                               
Input: /home/turing/tractoflow/via_direct_input/on_ismrm                                                                                                    
executor >  local (2)                                                                                                                                       
executor >  local (2)                                                                                                                                       
executor >  local (3)                                                                                                                                       
[65/dd03f0] process > README (README)          [100%] 1 of 1 ✔                                                                                              
[9d/38f449] process > Bet_Prelim_DWI (S1)      [ 50%] 1 of 2, failed: 1, retries: 1                                                                         
executor >  local (4)                                                                                                                                       
[65/dd03f0] process > README (README)          [100%] 1 of 1 ✔                                                                                              
[8f/5c4652] process > Bet_Prelim_DWI (S1)      [ 66%] 2 of 3, failed: 2, retries: 2                                                                         
[97/c79597] process > Denoise_DWI (S1)         [100%] 1 of 1, cached: 1 ✔                                                                                   
[-        ] process > Gibbs_correction         -                                                                                                            
executor >  local (4)                                                                                                                                       
[65/dd03f0] process > README (README)          [100%] 1 of 1 ✔                                                                                              
[8f/5c4652] process > Bet_Prelim_DWI (S1)      [ 66%] 2 of 3, failed: 2, retries: 2                                                                         
[97/c79597] process > Denoise_DWI (S1)         [100%] 1 of 1, cached: 1 ✔                                                                                   
[-        ] process > Gibbs_correction         -                                                                                                            
executor >  local (5)                                                                                                                                       
[65/dd03f0] process > README (README)          [100%] 1 of 1 ✔                                                                                              
[d3/48ff24] process > Bet_Prelim_DWI (S1)      [ 75%] 3 of 4, failed: 3, retries: 3                                                                         
[97/c79597] process > Denoise_DWI (S1)         [100%] 1 of 1, cached: 1 ✔                                                                                   
[-        ] process > Gibbs_correction         -                                                                                                            
[-        ] process > Prepare_for_Topup        -                                                                                                            
[-        ] process > Topup                    -                                                                                                            
executor >  local (5)                                                                                                                                       
[65/dd03f0] process > README (README)          [100%] 1 of 1 ✔                                                                                              
[d3/48ff24] process > Bet_Prelim_DWI (S1)      [100%] 4 of 4, failed: 4, retries: 3 ✔   
[97/c79597] process > Denoise_DWI (S1)         [100%] 1 of 1, cached: 1 ✔                                                                                   
[-        ] process > Gibbs_correction         -                                                                                                            
[-        ] process > Prepare_for_Topup        -                                                                                                            
[-        ] process > Topup                    -                              
[-        ] process > Prepare_dwi_for_eddy     -                                                                                                            
[-        ] process > Eddy_Topup               -                                                                                                            
[-        ] process > Eddy                     -                                                                                                            
[-        ] process > Bet_DWI                  -                                                                                                            
[-        ] process > N4_DWI                   -                              
[-        ] process > Crop_DWI                 -                              
[-        ] process > Denoise_T1               -                              
[c9/5f565b] process > N4_T1 (S1)               [100%] 1 of 1, cached: 1 ✔                                                                                   
[7a/90d97a] process > Resample_T1 (S1)         [100%] 1 of 1, cached: 1 ✔                                                                                   
[6c/de3242] process > Bet_T1 (S1)              [100%] 1 of 1, cached: 1 ✔                                                                                   
[6b/42873c] process > Crop_T1 (S1)             [100%] 1 of 1, cached: 1 ✔                                                                                   
[-        ] process > Normalize_DWI            -                              
[-        ] process > Resample_DWI             -                                                                                                            
[-        ] process > Extract_B0               -                              
[-        ] process > Extract_SH_Fitting_Shell -                              
[-        ] process > SH_Fitting               -                                                                                                            
[-        ] process > Extract_DTI_Shell        -                              
[-        ] process > DTI_Metrics              -                                                                                                            
[-        ] process > Extract_FODF_Shell       -                              
[-        ] process > Register_T1              -                              
[-        ] process > Register_Freesurfer      -                                                                                                            
[-        ] process > Segment_Freesurfer       -                              
[-        ] process > Segment_Tissues          -                                                                                                            
[-        ] process > Compute_FRF              -                              
[-        ] process > Mean_FRF                 -                              
[-        ] process > FODF_Metrics             -                                                                                                            
[-        ] process > PFT_Tracking_Maps        -                              
[-        ] process > PFT_Seeding_Mask         -                                                                                                            
[-        ] process > PFT_Tracking             -                              
[-        ] process > Local_Tracking_Mask      -                                                                                                            
[-        ] process > Local_Seeding_Mask       -                              
[-        ] process > Local_Tracking           -                              
Pipeline completed at: 2024-01-06T12:36:15.888949+05:30                                                                                                     
Execution status: OK                   
Execution duration: 19.4s                          
[66/94972d] NOTE: Process `Bet_Prelim_DWI (S1)` terminated with an error exit status (1) -- Execution is retried (1)
[9d/38f449] NOTE: Process `Bet_Prelim_DWI (S1)` terminated with an error exit status (1) -- Execution is retried (2)
[8f/5c4652] NOTE: Process `Bet_Prelim_DWI (S1)` terminated with an error exit status (1) -- Execution is retried (3)
[d3/48ff24] NOTE: Process `Bet_Prelim_DWI (S1)` terminated with an error exit status (1) -- Error is ignored

Here is the log file: (tractoflow/via_direct_input/work/d3/48ff2466a7d638e2fad8ea69b731c1/.command.log)


nxf-scratch-dir turing:/tmp/nxf.NVD7rMTrOF
/fsl/bin/bet: line 399: 2571036 Segmentation fault      (core dumped) ${FSLDIR}/bin/bet2 $IN $OUT $bet2opts
/fsl/bin/bet failed during command:S1__b0.nii.gz S1__b0_bet.nii.gz -m -R -f 0.16

I was having this same error, did you ever figure our what the issue was?

Hello @Katherine_Haines,

I would like to know which version of tractoflow you are using and also if your data comes from a Philips scanner and also what is the command line you’re trying to run.

Knowing this information, I’ll be able to help you.

Best,
Arnaud

Hi @abore,

Thanks for helping! I am running version 2.4.3, my data is not from a Philips scanner, and this is the command I am running:

NXF_VER=21.10.6 nextflow run /mnt/c/Users/khaines/tractoflow_code_not_lab/tractoflow/main.nf -work-dir ./intermediate_results --run_pft_tracking false --input /mnt/c/Users/khaines/pre_tractoflow/Pat188/ --output_dir /mnt/c/Users/khaines/Pat188tractoflow_processed/ -with-docker scilus/scilus:1.6.0

Where the input folder contains one patient’s data in the following format:
└───SBStroke_188
bvals.bval
bvecs.bvec
dwi.nii.gz
t1.nii.gz

Thanks,
Katherine Haines

Hi @Katherine_Haines ,
I haven’t used the pipeline for preprocessing in a long time. I use it for segmentation of tracts now.
But if you are facing same error, one possibility is ‘S1__b0.nii.gz’ is not there, which is generated in the process via previous command to this…
Order of commands:

scil_extract_b0.py dwi.nii.gz bval bvec S1__b0.nii.gz --mean        --b0_thr 10 --force_b0_threshold
bet S1__b0.nii.gz S1__b0_bet.nii.gz -m -R -f 0.16
scil_image_math.py convert S1__b0_bet_mask.nii.gz S1__b0_bet_mask.nii.gz --data_type uint8 -f
maskfilter S1__b0_bet_mask.nii.gz dilate S1__b0_bet_mask_dilated.nii.gz        --npass 5 -nthreads 1
mrcalc S1__b0.nii.gz S1__b0_bet_mask_dilated.nii.gz        -mult S1__b0_bet.nii.gz -quiet -force -nthreads 1

So, b0, if not extracted via scil_extract_b0.py, could have potentially caused this error, can you manually generate ‘S1__b0.nii.gz’ via running ‘scil_extract_b0.py’ and place it in input directory
you can use following script for that:
scil_dwi_extract_b0.py