Skip to content

guiwitz/napari_demo

Repository files navigation

Binder

Repository for napari demos

In this repository you can find two examples of the possibilities offered by the visualisation tool napari. Both examples are really meant to be demos and not full fledged tools or scientific studies.

Running the examples

On mybinder

Both examples can be run via mybinder by clicking the button on top of this Readme. As napari is not integrated into Jupyter, the workaround solution provided here is used. In both notebooks, you have to click on a link provided at the top of the notebook which opens a new window where napari is visible (within a remote desktop). Mybinder is not meant to process large datasets, so the data used in the 3D image processing example have to be reduced. Just follow the instructions at the data import step.

Local installation

It's really easy to install the necessary pieces on your own machine using conda. Copy the following lines into a file typically called environment.yml:

name: python3d
channels:
  - conda-forge
dependencies:
  - pip
  - scipy
  - numpy
  - matplotlib
  - pandas
  - scikit-image
  - scikit-learn
  - jupyter
  - ipywidgets
  - pip:
    - napari
    - trackpy
    - requests

And create the conda environment by calling:

conda env create -f environment.yml

When you want to use the environment, just type:

conda activate python3d

and then start Jupyter to open the notebooks:

jupyter notebook

This notebook allows to use a Pixel classifier to segment images based on a manual selection of categories. It follows in a very simplified way the principle of ilastik. ilastik is a great software, so what's the purpose of this demo? Here's a few ideas:

  • It can be used for teaching purposes as all the steps are directly accesible within the notebook, e.g. the paramters of the classifier can be changed.
  • This approach can also be customized very easily, e.g. with specific filters.
  • ilastik is sometimes constraining in terms of file formats. Here this issue can be handled directly in the notebook with numpy and e.g. bioformats.
  • Other useful packages could be mixed in. For example one can use dask on a cluster to run sciki-learn on large dataset, typcially 3D images.

This notebook shows how napari can be used in a typical 3D image processing pipeline. This is a thing which was notoriously difficult to do in Python/Jupyter (see e.g. the interesting post on this topic of one of the napari developers). I'm using here a public dataset deposited on zenodo. Detection and tracking of cells is done with scikit-image and trackpy. This example is not meant to be "scientifically meaningful" but an demo of how different type of information can be shown in napari.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published