Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with load.data #184

Open
Bea9619 opened this issue Apr 23, 2024 · 6 comments
Open

problem with load.data #184

Bea9619 opened this issue Apr 23, 2024 · 6 comments
Assignees

Comments

@Bea9619
Copy link

Bea9619 commented Apr 23, 2024

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 "load_data()"
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
Copy link
Owner

daducci commented Apr 24, 2024

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
Copy link
Author

Bea9619 commented Apr 24, 2024

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
Copy link
Owner

daducci commented Apr 25, 2024

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
Copy link
Author

Bea9619 commented May 2, 2024

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
Copy link
Owner

daducci commented May 3, 2024

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
Copy link
Author

Bea9619 commented May 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants