-nan in response_wm.txt



Hi all,
I am using the following command:
dwi2response dhollander ${WP}/eddy_corrected_dataup.nii.gz -fslgrad ${WP}/eddy_corrected_dataup.eddy_rotated_bvecs ${WP}/dataup.bval -lmax 6,6 -mask ${WP}/hifi_nodifupdn_brain_mask.nii.gz -shell 0,700 ${WP}/response_wm.txt ${WP}/response_gm.txt ${WP}/response_csf.txt

eddy_corrected_dataup.nii.gz has 6 b0 volumes at the beginning followed by 61 diffusion volumes.
The b-value is 700.

The content of the response files are:


-nan -nan -nan -nan
755.059604344493 -213.7063470553111 25.29787863911833 -2.212186330560793

What are the -nan values in “response_wm”?

Thank you!


Hi Mahmoud,

NaN = Not A Number.

I’m not 100% sure what’s causing that issue, though I have a strong suspicion. Would it be possible for you to provide me with some example data so I can reproduce the issue?



Hi @zeydabadi,

The -nan values are wrong indeed (and that output should certainly not be used). The problem is simply due to the -lmax 6,6 option you specified. Nowadays, for data like yours, you don’t even have to specify the -lmax option at all; by default it’ll estimate the responses up to lmax=10 for you, which works perfectly even for data with “apparently” too few directions. Don’t worry about it. Just removing the -lmax 6,6 option will solve your problem. If you want, you can always report back here with the output you get when removing the -lmax 6,6 option, and I’ll be able to reassure you whether the output makes sense.


(Side-note: If for some very specific reason (but again, generally, this is not needed at all) you’d want to limit the WM response to lmax=6, the correct option to specify would be -lmax 0,6 in your case. The b=0 data can/should only be estimated isotropically, hence the first “0” in that option.)


Hi Thijs,

Thanks for your response. That solved the problem but I guess I did something fundamentally wrong as my data is single shell and I followed the pipeline for multi shell/tissue.
I also wonder whether the single shell pipeline gives me valid output as my b-value is 700 while it is mentioned in the tutorial that it need to be around 2000.