This repository implements patch-denoising methods, with a particular focus on local-low rank methods.
The target application is functional MRI thermal noise removal, but this methods can be applied to a wide range of image modalities.
It includes several local-low-rank based denoising methods (see the documentation for more details):
- MP-PCA
- Hybrid-PCA
- NORDIC
- Optimal Thresholding
- Raw Singular Value Thresholding
A mathematical description of these methods is available in the documentation.
$ pip install patch-denoise
patch-denoise requires Python>=3.12
A container recipe with the GPU extras (PyTorch, Triton) is provided in patch-denoise.def.
Build it once, from a checkout of this repository (no root needed with --fakeroot):
$ apptainer build --fakeroot --build-arg VERSION=$(git describe --tags | sed s/^v//) \
patch-denoise.sif patch-denoise.def
and run it like the regular command-line. Use --nv to expose the host GPU, and --bind for
data that lives outside your home directory:
$ apptainer run --nv --bind /path/to/data patch-denoise.sif input.nii output.nii --mask="auto"
The image bundles CUDA 13 user-space libraries, so the host NVIDIA driver must support CUDA 13
(nvidia-smi reporting driver >= 580). Without --nv the CPU implementation is used.
On a Slurm cluster:
$ srun --gres=gpu:1 --cpus-per-task=8 --mem=32G --time=01:00:00 \
apptainer run --nv --bind /path/to/data patch-denoise.sif input.nii output.nii --mask="auto"
After installing you can use the patch-denoise command-line.
$ patch-denoise input_file.nii output_file.nii --mask="auto"
See patch-denoise --help for detailed options.
Documentation and examples are available at https://paquiteau.github.io/patch-denoising/
$ git clone https://github.com/paquiteau/patch-denoising $ pip install -e patch-denoising[optional] --group dev
If you use this package for academic work, please cite the associated publication, available on HAL
@inproceedings{comby2023,
TITLE = {{Denoising of fMRI volumes using local low rank methods}},
AUTHOR = {Pierre-Antoine, Comby and Zaineb, Amor and Alexandre, Vignaud and Philippe, Ciuciu},
URL = {https://hal.science/hal-03895194},
BOOKTITLE = {{ISBI 2023 - International Symposium on Biomedical Imaging 2023}},
ADDRESS = {Carthagena de India, Colombia},
YEAR = {2023},
MONTH = Apr,
KEYWORDS = {functional MRI ; patch denoising ; singular value thresholding ; functional MRI patch denoising singular value thresholding},
PDF = {https://hal.science/hal-03895194/file/isbi2023_denoise.pdf},
HAL_ID = {hal-03895194},
HAL_VERSION = {v1},
}
https://github.com/paquiteau/retino-pypeline
For the application of the denoising in an fMRI pipeline using Nipype