I have been trying to use the NODDI code (single_batch_fitting) and have been coming across the following error:
292272 of voxels to fit
Fitting voxel 1
Error using eig
Input matrix contains NaN or Inf.
Error in GridSearchRician (line 60)
[evec, eval] = eig(dt);
Error in ThreeStageFittingVoxel (line 66)
[x0 liks] = GridSearchRician(Epn, modelname, grid, protocol, constantsGD, sig);
Error in batch_fitting_single (line 71)
[gsps(i,:), fobj_gs(i), mlps(i,:), fobj_ml(i), error_code(i)] = ThreeStageFittingVoxel(voxel, protocol, model);
I have attached my NODDI_roi.mat code to see if you can see any problems. There do not appear to be any 0s so I am not sure what I am doing wrong.
The 3D brain mask is well within the 4D DWI volume.. (by the way I used the topup corrected DWI volume, I hope that isn't a problem).
I would really appreciate any advice.