Deep denoising pushes the limit of functional data acquisition by recovering high SNR calcium traces from low SNR videos acquired using low laser power or smaller exposure time. Thus deep denoising enables faster and longer volumetric recordings. For more details, please check our paper.
- Download using
git clone -b pytorch https://github.com/shiveshc/NIDDL.git
- Much easier to install and use (checkout
example.ipynb
). - Denoise in Napari by running
napari_niddl.py
If you find our work useful, please cite
Chaudhary, S., Moon, S. & Lu, H. Fast, efficient, and accurate neuro-imaging denoising via supervised deep learning. Nat Commun 13, 5165 (2022). https://doi.org/10.1038/s41467-022-32886-w
Denoise whole-brain videos
Denoise mechanosensory neurites
Recover high SNR calcium traces
- Installation
- Additional system requirements
- Train on new dataset
- Denoise calcium activity recordings
Installation steps tested for Linux and Python 3.9
Clone pytorch branch of repository using git clone -b pytorch https://github.com/shiveshc/NIDDL.git
.
Open command line terminal as administrator and navigate to cloned repository path using cd ~/NIDDL
.
Next run following commands -
conda env create -f environment.yml
conda activate niddl-env
Installation should take ~10 minutes.
environment.yml
has been tested on Linux. Installation on MacOS or Windows may throw errors. In this case you can try following -
- Try using
environment_macos.yml
for macos.
Or
cd ~/NIDDL
conda create -n niddl-env python=3.9
conda activate niddl-env
pip install ipykernel
jupyter notebook
- Run 1st cell in
example.ipynb
, manually install required libraries usingpip install <lib>
Try denoising in Napari
cd ~/NIDDL
conda activate niddl-env
python napari_niddl.py
- Denoise NIDDL widget should be visible in napari viewer
- Set
noisy_img_path
image and corresponding high SNRgt_image_path
(optional) in the widget. - Set
DataType
approprately (corresponding models will be used to denoise images) - Click
Denoise
- Create jupyter kernel in
niddl-env
usingjupyter notebook
- Follow instructions in
example.ipynb
Model training using GPUs is much faster and thus preferred. To be able to use GPUs, suitable NVIDIA drivers and CUDA libraries must be installed. Please make sure your CUDA versions are compatible with Pytorch 2.0.1.
-
Create jupyter kernel within
niddl-env
. -
Follow instructions in
example.ipynb
. -
Structure of training data folder should be organised as below -
data ├───gt_imgs │ ├───img_1 │ │ z_1.tif │ │ z_2.tif │ │ ... │ │ │ ├───img_2 │ │ z_1.tif │ │ z_2.tif │ │ ... │ │ │ └───img_3 │ z_1.tif │ z_2.tif │ ... │ └───noisy_imgs ├───img_1 │ z_1.tif │ z_2.tif │ ... │ ├───img_2 │ z_1.tif │ z_2.tif │ ... │ └───img_3 z_1.tif z_2.tif ...
-
Structure of functional recording video datasets should be organised as below -
vid1 └───noisy_imgs ├───img_1 │ z_1.tif │ z_2.tif │ ... │ ├───img_2 │ z_1.tif │ z_2.tif │ ... │ ├───img_3 │ z_1.tif │ z_2.tif │ ... ...
Here
img_1
,img_2
etc. can correspond to individual time-points in videos. -
Follow instruction in
example.ipynb
.