paquiteau / patch-denoising

Patch based denoising method, targeting fMRI thermal noise removal.
https://paquiteau.github.io/patch-denoising/
MIT License
21 stars 4 forks source link

Documentation on using empirical noise scans with NORDIC #4

Open tsalo opened 1 month ago

tsalo commented 1 month ago

The actual math goes way over my head, but it doesn't seem like patch-denoising includes a way to use noise scans with the NORDIC denoiser. The documentation mentions "pre processing the image and dividing it by an externally available g-map". Does that mean that calculating the g-map is outside the scope of this package?

paquiteau commented 1 month ago

Hi again,

If you look closely at the NORDIC MATLAB code, they have routines to estimate the noise level per patch in the absence of g-map (I tried to reproduce this in Nordic_Raw in patch-denoise).

G-map estimation goes beyond the scope of this package indeed, but our team is tackling this challenge in another repository with https://github.com/mbertrait/ggrappa (cc @mbertrait)

paquiteau commented 1 month ago

Actually, the maths are not that hard. I will soon write my thesis, and patch-denoise will be a chapter of it, I will take this opportunity to detail the maths more (and add it here in the documentation)

tsalo commented 1 month ago

That would be amazing. For context, I would really like to get NORDIC added to fMRIPrep, but using the MATLAB version would dramatically increase the size of the container per @bpinsard, and there are also license and code quality issues. Being able to use the noise scans within patch-denoise or having solid documentation so we could write an interface to do that on fMRIPrep's side would be awesome.

paquiteau commented 1 month ago

Turns out, I have some code in place to estimate the noise statistics from noisy scans :partying_face: !

https://github.com/paquiteau/patch-denoising/blob/master/src/patch_denoise/space_time/utils.py#L206

And even better, I have nipype bindings (which fMRIprep uses IIRC) for it

https://github.com/paquiteau/patch-denoising/blob/master/src/patch_denoise/bindings/nipype.py

For the documentation, I have no ETA yet, but contributions are welcome to improve it ;)

https://paquiteau.github.io/patch-denoising/denoisers.html

bpinsard commented 1 month ago

Amazing, thanks for the nice package! I am glad that this interesting MRI filtering technique won't die as an old, barely-readable MATLAB code with restrictive license.