"NaN" weight after running encode...
Opened this issue · 5 comments
Hi Franco and all,
When I run LiFE using encode for specific dataset, I found a case in which small number of streamlines got "NaN" weights after fitting.
For example, I got something like
fe.life.fit.weights(1:10)
ans =
0
0.0102
0
0
0
NaN
0.0086
In this case, streamlines #6 got "NaN" weight.
It is a first time for me to see this phenomenon. Are there anybody who see similar sort of phenomenon?
- what are the details of the data and tract?
- What are the DWI params and how many fibers does the connectome have?
- Are you sure the white matter mask, the DWI signal, and the fibers are well aligned?
- Is this a human brain?
It is West Haven dataset (analyzed in Yeatman et al. Nat Comm), collected at Stanford. Therefore, it is a human data, with b=2000 s/mm2 and 96 directions. As far as we exported streamlines from connectome (2 million streamlines), they are correctly aligned.
There may be one issue which we need to test in our side about this dataset, and I will contact back with you this later...
We made several testing in our side. It seems to be that NaN appears when dMRI data is not exactly isotropic. When data were resampled into exactly isotropic voxel size (e.g. 2 x 2 x 2 mm), we don't see NaN after fitting LiFE in encode. I'm not sure whether it is worth solving, but perhaps one of the practical guide for LiFE user is to recommend isotropic voxel acquisition, or if the acquisition cannot be exactly isotropic, it may be good to resample data into isotropic voxels...
Thanks for the checks @htakemur would you please check the distribution of signal (make a histogram and check the min-max and median) of both the original and resampled data? Use the fe.life fieldss to compute the hist, please. Resampling can also smooth the signal, I wonder whether you have some weird values in the signal.
Sorry for my delayed responses. I have checked a variable (fe.life.diffusion_signal_img).
I don't see a major difference in distribution, except for voxel size difference coming from the resampling. Median of whole signal is almost identical (141 for resampled, 142 for without resampling). Min is identical (0 for both cases). Max is not identical but close (948 for resampled, 954 for without resampling).