daducci / AMICO

Accelerated Microstructure Imaging via Convex Optimization (AMICO) from diffusion MRI data
Other
105 stars 62 forks source link

problem with load.data #184

Open Bea9619 opened 7 months ago

Bea9619 commented 7 months ago

Dear all, I'm running AMICO on my dwi data. However, an error occurs when loading data: _Nan or Inf values in the signal after the pre-processing. Try using the "replace_bad_voxels" or "b0_min_signal" parameters when calling "loaddata()" I tried both with replace_bad_voxels and b0_min_signal. In the first case I'm not sure which value should I put in the replacement. In the latter, when choosing different thresholds based on my b0 image, the output ODI, NDI, FWF maps are very corrupted even setting a very low value as threshold. What is the best approach in order to not corrupt or manipulate input data? As preprocessing I only corrected the images with FSL's topup and eddy tools. Any advice and correction is welcome
Many thanks

Beatrice

daducci commented 7 months ago

Dear Beatrice,

In the presence of NaN of Inf, which can be caused by a number of situations, you can replace them with a finite value, e.g. 0, to avid breaking the processing. Did you try setting replace_bad_voxels to zero?

Bea9619 commented 7 months ago

Dear Alessandro,

Thanks for your reply. Yes, I tried to replace the value of these voxels with 0, but I was unsure about the correctness of this option. However, I'm not sure what's causing NaN or Inf values. I took the raw DWI data and I used FSL's topup and eddy tools for correct the images. Do you think it could be the correct approach? Thanks

Beatrice

daducci commented 7 months ago

Most likely you have some voxels equal to zero in the b0 image, so when you normalize the data by this, you get NaN or Inf.

Do you get meaningful maps when you use this option?

Bea9619 commented 6 months ago

They seems meaningful. I attached them here fit_fwf fit_ndi fit_odi

However, for NDI map there are some white voxels (value 1) at the border of the brain that are obviously not WM What do think about the output maps?

many thanks again

daducci commented 6 months ago

Voxels outside the brain cannot provide good fit results, and it's normal to have spurious values. Also, I suggest you have a look at the doSaveModulatedMaps option in AMICO, e.g.:

ae = amico.Evaluation()
ae.set_config('doSaveModulatedMaps', True)

and then use the file fit_NDI_modulated.nii.gz rather than fit_NDI.nii.gz. See a detailed discussion here.

Bea9619 commented 6 months ago

Thanks for your prompt reply. I just tried the modulation. Now voxels outside the brain seem better. However, especially for NDI, I found values of voxels that contain fibers are significantly lower. Also ODI changed. Schermata da 2024-05-03 10-27-18 Schermata da 2024-05-03 10-26-41

Which are the best fitted maps in your opinion to run voxel-wise analyses? the modulated ones or the previous ones with just replace_bad_voxels=0 option? Thank you