pyAFQ tractometry fails with CsdNanResponseError on neonatal single-shell data

Summary of what happened:

Hi all,

We are processing infant dMRI data using QSIPrep + QSIRecon and have encountered an error during the reconstruction step. We would appreciate any advice on how to troubleshoot this issue.

Dataset information

  • Population: neonates
  • Structural MRI: T2w
  • Diffusion MRI: single-shell, b = 700 s/mm², 30 directions

Our diffusion image has the following properties:

data shape: (125, 151, 123, 31)
datatype: float64
pixdim: [1. 1. 1. 1.]
scl_slope: nan
scl_inter: nan

We are unsure what might be causing this issue.

Any suggestions on how to resolve or debug this issue would be greatly appreciated.

Thank you very much for your help!

Command used (and if a helper script was used, a link to the helper script or the command generated):

For preprocessing with QSIPrep, we used a T2w structural image with the -infant flag, and the preprocessing completed successfully.

For reconstruction with QSIRecon, we ran the pyafq_tractometry workflow, but it failed and displayed a CSD-related error when running AFQ.

Version:

  • QSIPrep: 1.0.0rc1
  • QSIRecon: 1.1.1

Environment (Docker, Singularity / Apptainer, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

The key error message is:

AFQ.models.csd.CsdNanResponseError:
Could not compute CSD response function

Part of the traceback is shown below:

File ".../AFQ/tasks/data.py", line 347, in csd_params
    raise CsdNanResponseError
AFQ.models.csd.CsdNanResponseError:
Could not compute CSD response function

Screenshots / relevant information:


Hi @XinyangLiu and welcome to neurostars!

Not a direct answer to your issue, but some people have had better success using the MRTrix–>PyAFQ recon specs when they receive this bug. But also, if you have neonate data, you might be better off using DSI Studio Autotrack like the HBCD workflow does if you want to stay in QSIRecon. The default PyAFQ bundle set may not generalize well to neonates. There is BabyAFQ software that will work better with neonates, but it is not yet incorporated into QSIRecon.

Best,
Steven

Just to add to Steven’s suggestions: the default tractography algorithm in pyAFQ does not work well with infant data (but we are working on that), and in our previous work with infant data, we used a variant of the mrtrix tractography (also not the default behavior, see: https://www.pnas.org/doi/10.1073/pnas.2303491120), so you might need to separate your tractography step from your pyAFQ step. As mentioned, once you have a whole-brain tractography for your subjects, you can use the code in this example: BabyAFQ : tractometry for infant dMRI data — AFQ 2.1 documentation