help > RE: data from one subject may have all NaN values
Jan 25, 2024  01:01 AM | Alfonso Nieto-Castanon - Boston University
RE: data from one subject may have all NaN values

Hi Patrick


That's strange. All NaN's could indicate simply missing-data (e.g. if you had computed ICA on a subset of subjects), but if that was the case those missing-data subjects would have been excluded from your second-level analyses. I imagine it could also indicate some extreme mis-coregistration of a subject, where the analysis mask may lie outside of the field of view of a subject's functional image, but that seems also a far-fetched case. I would suggest to load your SPM.mat file and look into the files in the SPM.xY.VY field, and see whether the data in those files looks ok to see if you can identify the subject(s) with possible NaN data, e.g. using something like the following


load SPM.mat
for n1=1:size(SPM.xY.VY,1)
for n2=1:size(SPM.xY.VY,2)
fprintf('Subject %d measure %d contains %d NaN values\n', n1, n2, nnz(isnan(conn_vol_read( SPM.xY.VY(n1,n2).fname ))));
end
end


Hope this helps


Alfonso


Originally posted by Patrick Lachmair:



When I get the error message: data from one subject may have all NaN values,


how can I check for NaNs and how do I solve this problem? It appears when I want to compute the ICA data obtained in the sencond level analysis tab of my CONN toolbox.



 

Threaded View

TitleAuthorDate
Patrick Lachmair Nov 28, 2023
RE: data from one subject may have all NaN values
Alfonso Nieto-Castanon Jan 25, 2024