Skip to content

Commit

Permalink
Add script and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeschamps committed Jun 16, 2023
1 parent cce9b3c commit 40317fe
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ A self-supervised denoising algorithm now usable by all in napari.
Check out the [documentation](https://juglab.github.io/napari-n2v/installation.html) for more detailed installation
instructions.

You can then start the napari plugin by clicking on "Plugins > napari_n2v > Training",
or run the plugin directly from a [script](scripts/start_plugin.py).



## Quick demo

Expand Down
12 changes: 12 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ operating system.
pip install "napari[all]==0.4.15" napari-n2v
```

> Note: napari-n2v was tested with TensorFlow 2.7 and 2.10, cuda 11.2 and cudnn
> 8.1.
> **Important**: In order to access the GPU with Tensorflow, it is necessary to
> export the CUDA library path in your conda environment. Installation
> instructions on the TensorFlow website do just that.
> For TF 2.10, we recommand running the following in your environment:
> ```bash
> mkdir -p $CONDA_PREFIX/etc/conda/activate.d
> echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
> ```
## macOS
Expand Down
21 changes: 21 additions & 0 deletions scripts/start_plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pathlib import Path
import titfffile
import napari

from napari_n2v import TrainingWidgetWrapper

# create a Viewer
viewer = napari.Viewer()

# add napari-n2v plugin
viewer.window.add_dock_widget(TrainingWidgetWrapper(viewer))

# load yout image
path = Path('path/to/your/image.tif')
data = titfffile.imread(path)

# add image to napari
viewer.add_image(data[0][0], name=data[0][1]['name'])

# start UI
napari.run()

0 comments on commit 40317fe

Please sign in to comment.