In matlab, log is ln Just remove negative values before you calculate the sse On 29 Sep 2016, at 10:49, Ana Maria Escorza <[log in to unmask]<mailto:[log in to unmask]>> wrote: Hi, with log you mean log10 or ln? what you mean with safeguards? I do that I obtain complex numbers in sse. Cheers 2016-09-29 10:51 GMT+02:00 Saad Jbabdi <[log in to unmask]<mailto:[log in to unmask]>>: Hi - I believe DTIFIT outputs the sum squared error in log-space, i.e. sum( { log(data) - log(prediction) }^2 ) There are also a couple of safeguards inside DTIFIT to make sure it can take the log. Cheers Saad On 29 Sep 2016, at 08:21, Ana Maria Escorza <[log in to unmask]<mailto:[log in to unmask]>> wrote: Once I have got the original DWIs and 'DWIs from DTs' exported (with dtigen) and load into matlab, I try to calculate the sse of tensor estimation that is calculated by sum((orDWI-DWI_DT).^2,4) But I didn't obtain the same that with --sse in dtifit, why? 2016-09-28 18:22 GMT+02:00 Ana Maria Escorza <[log in to unmask]<mailto:[log in to unmask]>>: How Can I subtract? with fslmaths from both .nii? 2016-09-28 18:18 GMT+02:00 Saad Jbabdi <[log in to unmask]<mailto:[log in to unmask]>>: Hi - you can use ‘dtigen’ to generate predictions given the DTI tensor (which you can save in DTIFIT with —save_tensor) and then substract that prediction from the data. Cheers Saad On 28 Sep 2016, at 14:42, Ana E. <[log in to unmask]<mailto:[log in to unmask]>> wrote: Hello, I am looking for a function to obtain the residual DWI from the diffusion tensor. I see that I can use --sse in dtifit, but this is for 3D volume. I would like 4D. Thanks Ana.