Tractoflow error at DTI_Metrics + Compute_FRF steps

Hello,

I am running into some error messages that I can’t parse, using Tractoflow 2.2.1 with Singularity. All the steps leading up to this error run normally.

Firstly, the command I am running is:

~/test_tractoflow/nooralsh/nextflow-21.10.6-all run ~/test_tractoflow/nooralsh/tractoflow/main.nf --input ~/test_tractoflow/nooralsh/input/ --fodf_shells "5 1500 3000" -with-singularity ~/test_tractoflow/nooralsh/tractoflow_2.2.1.sif -w ~/test_tractoflow/nooralsh/tf_results/ -resume

The DTI_Metrics error (below) I get makes me think it’s reading an empty file but I’ve opened the mask, b0, dwi_dti, resampled volumes and all of them look normal to me. Is there a different file I should be checking? Or is this related to the error message about the lowest bval=5?

WARNING:root:Warning: No b=0 image. Setting b0_threshold to the minimum bval: 5.0
/usr/local/lib/python3.7/dist-packages/dipy/reconst/dti.py:498: RuntimeWarning: invalid value encountered in true_divide
return 3 * np.sqrt(6) * determinant((A_squiggle / A_s_norm))
Traceback (most recent call last):
File "/usr/local/bin/scil_compute_dti_metrics.py", line 4, in <module>
    __import__('pkg_resources').run_script('scilpy==1.1', 'scil_compute_dti_metrics.py')
File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 667, in run_script
    self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 1464, in run_script
    exec(code, namespace, namespace)
File "/usr/local/lib/python3.7/dist-packages/scilpy-1.1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/scil_compute_dti_metrics.py", line 457, in <module>
    main()
  File "/usr/local/lib/python3.7/dist-packages/scilpy-1.1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/scil_compute_dti_metrics.py", line 310, in main
    pis_mask = np.max(S0 < DWI, axis=-1)
  File "<__array_function__ internals>", line 6, in amax
  File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 2668, in amax
    keepdims=keepdims, initial=initial, where=where)
  File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity

The second error I’m getting is in the Compute_FRF step (below), again with a b0 warning and similarly stating it can’t find enough voxels so maybe reading an empty file. I just can’t figure out which file!

WARNING:root:Warning: No b=0 image. Setting b0_threshold to the minimum bval: 5.0
WARNING:root:No white matter mask specified! Only mask will be used (if it has been supplied). 
Be *VERY* careful about the estimation of the fiber response function to ensure no invalid voxel was used.
Traceback (most recent call last):
  File "/usr/local/bin/scil_compute_ssst_frf.py", line 4, in <module>
    __import__('pkg_resources').run_script('scilpy==1.1', 'scil_compute_ssst_frf.py')
  File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 667, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 1464, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.7/dist-packages/scilpy-1.1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/scil_compute_ssst_frf.py", line 132, in <module>
    main()
  File "/usr/local/lib/python3.7/dist-packages/scilpy-1.1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/scil_compute_ssst_frf.py", line 126, in main
    force_b0_threshold=args.force_b0_threshold)
  File "/usr/local/lib/python3.7/dist-packages/scilpy-1.1-py3.7-linux-x86_64.egg/scilpy/reconst/frf.py", line 118, in compute_ssst_frf
    "to estimate the FRF!".format(min_nvox))
ValueError: Could not find at least 300 voxels with sufficient FA to estimate the FRF!

Any help would be appreciated, thanks!

Hi @nooralsh,

Please add this --b0_thr_extract_b0 10 to your command line. It should fix your issue.

Best,
Arnaud

Thanks @abore ! I did that (and that was already the setting in the nextflow.config file) and reran but I still have the same errors for both steps. It shouldn’t be an issue that I’m using the -resume flag, correct? I am restarting without it just in case but in the meantime, I’m still getting the same error messages.

Thanks,
Noor