-
Notifications
You must be signed in to change notification settings - Fork 296
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
ENH: Add MP-PCA/NORDIC denoising through dwidenoise #3395
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3395 +/- ##
==========================================
- Coverage 72.32% 71.34% -0.99%
==========================================
Files 57 59 +2
Lines 4268 4502 +234
Branches 545 576 +31
==========================================
+ Hits 3087 3212 +125
- Misses 1065 1154 +89
- Partials 116 136 +20 ☔ View full report in Codecov by Sentry. |
It is intended to address this at some stage; for tracking see MRtrix3/mrtrix3#2274 and MRtrix3/mrtrix3#3035.
I've added a note to MRtrix3/mrtrix3#3035.
Agree 100%; we're invested locally in being able to modulate downstream applications appropriately based on this. It would be good to:
There's a few branches in parallel that have proposed changes to
That could be done. It would be reasonably easy to add an export option to
When I've done this myself, I've concatenated data across echoes into the fourth dimension, denoised, and then separated the volumes back out into echoes. That is I think more principled given that the noise level should be identical. It's not super difficult to do. You may however want to clamp the maximal patch size: once (# echoes x # volumes) exceeds 343 the default changes to a 9x9x9 patch and that runs very slowly. This behaviour should be better with MRtrix3/mrtrix3#2742 / MRtrix3/mrtrix3#3029, which won't have such step changes in patch size. Some other points to consider:
|
Thanks @Lestropie for looping me in this conversation.
|
Posted as MRtrix3/mrtrix3#3046. Would need implementation within the underlying denoising command; whether fMRIPrep would want to utilise that is beyond my control.
It might be possible to mitigate this if the full noise map profile is known a priori, and voxels can be normalised to unit variance upon insertion into the Casorati matrix? MRtrix3/mrtrix3#3041
Have more flexible patch size in this implementation with spherical kernels: MRtrix3/mrtrix3#2742
Cool; it would be useful for me to know from someone more familiar with the mathematics / simulations that it's sensible. |
Thanks @Lestropie and @jelleveraart!
Sure! I'll open an issue requesting a variance explained output map.
In NORDIC they divide by the min value in the first volume. Maybe that's why they do it? I now have a line-by-line Python translation of the MATLAB code that seems to work pretty well, so that might make it easier to translate to C++. There are a bunch of filtering steps that might not be in dwidenoise already.
I didn't realize that! That could be an issue for fMRIPrep. I think the devs avoid anything that doesn't allow for commercial or clinical uses, but I could be misremembering. Do you know if the optimal shrinkage approaches it looks like you're implementing in dwidenoise would fall under the same copyright? |
Even if that is indeed why they do it, it nevertheless seems to me an unusual choice of how to do it. You could get data from the scanner where the raw intensities are enormous, but you would only need one isolated voxel in one volume with a value that is close-to-but-not-quite-zero and that rescaling step will not serve the purported purpose. I had originally proposed an explicit demeaning step in MRtrix3/mrtrix3#2363. That is being superseded by MRtrix3/mrtrix3#3029, which for DWI does a demeaning per shell; for fMRI it should just regress out, for each voxel, the mean value across all volumes. There's a potential improvement to be had here for demeaning of multi-echo fMRI data using the same approach.
I believe no. It wasn't a part of the NYU work, and I think it's not included in their patent. However I'm not fully across these bureaucratic complications. There have previously been discussions / questions around the scope of what is protected. I've started a separate discussion thread for that: MRtrix3/mrtrix3#3059 |
Closes #3308.
Potential blockers
-rank
option to output a DOF map, but that feature hasn't been released yet. See ENH dwidenoise: Optionally output degrees of freedom map MRtrix3/mrtrix3#2312.Changes proposed in this pull request
init_bold_native_wf
.--thermal-denoise-method
to specify which approach to use, if any.