AFMSlicer

A simple plugin to use AFMSlicer with napari

  • Neil Shephard

License GNU GPL v3.0 PyPI Python Version tests codecov napari hub npe2 Copier

A simple plugin to use AFMSlicer with napari


This napari plugin was generated with copier using the napari-plugin-template.

Installation

NB - For detailed instructions in installation of napari-afmslicer and AFMSlicer see the AFMSlicer Installation information.

Virtual Environments

napari-afmslicer is developed using the uv package manager and it is recommended as a fast and simple to use tool for creating and managing virtual environments.

cd ~/path/to/work
mkdir afmslicer-work
cd afmslicer-work
uv venv

Installation from PyPI

You can install napari-afmslicer via pip:

pip install napari-afmslicer

If napari is not already installed, you can install napari-afmslicer with napari and Qt via:

pip install "napari-afmslicer[all]"

To install latest development version :

pip install git+https://github.com/AFM-SPM/napari-afmslicer.git

Installation from Napari

You can install napari-afmslicer from the Napari Hub from within Napari itself. After having launched Napari

Git Clone

You can clone and install the napari-afmslicer within the virtual environment of your choice. First clone the repository

git clone git@github.com:AFM-SPM/napari-afmslicer.git   # If you have SSH keys configured on GitHub
git clone https://github.com/AFM-SPM/napari-afmslicer.git # If you don't have SSh keys configured on GitHub

Then install it within a virtual environment, the following creates a uv environment within the clone directory and installs all plugins and developer optiosn

cd napari-afmslicer
uv venv
uv sync
uv pip install -e .[extras,all] --group dev

Usage

Once installed you can launch napari from the command line.

napari

The resulting widgets implemented in this package can be found under the Plugins > AFMSlicer menu. Selecting each brings up a "widget" on the right hand side of the window (by default). There are the following widgets.

  • AFMSlicer 3D Viewer
  • AFMSlicer Filtering
  • AFMSlicer Slicing

From each of the widgets configuration options can be toggled that change the settings for running/processing the image. Clicking on the Run button at the bottom of any of these should result in a new Layer being displayed in Napari that show the effects of processing the selected image.

You can optionally start all napari AFMSlicer widgets with the following...

napari -w napari-afmslicer __all__

The screenshot below shows a 3D view of a scan. and the widget tabs for filtering and slicing are on the bottom right of the screen.

Napari AFMSlicer screenshot of 3D image of a scan.

Additional Plugins

Because AFMSlicer uses some of the functionality of TopoStats the napari-TopoStats and napari-AFMReader plugins are included as a dependency and installed when napari-AFMSlicer is installed.

There are a lot of [napari plugins] available though, some of which are particularly useful for the AFMSlicer workflow. These will be installed if you use the optional dependency group extras when installing napari-afmslicer with the following.

uv pip install -e ".[extras]"

After launching Napari you will find these plugins listed under the "Plugin" menu.

The additional plugins that will be installed are...

NB - If you encounter problems with these plugins please report them up-stream at the GitHub repository for the plugin rather than here.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the GNU GPL v3.0 license, "napari-afmslicer" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Version:

  • 0.0.1

Last updated:

  • 2026-10-26

First released:

  • 2026-10-26

License:

  • GNU GENERAL PUBLIC LICENSE ...

Supported data:

  • Information not submitted

Plugin type:

Open extension:

Save extension:

Python versions supported:

3.11

Operating system:

  • Information not submitted

Requirements:

  • afmslicer
  • magicgui
  • napari-afmreader
  • napari-topostats
  • numpy
  • qtpy
  • scikit-image
  • napari[all]; extra == 'all'
  • napari-crop; extra == 'extras'
  • napari-plot-profile; extra == 'extras'
  • napari-segment-blobs-and-things-with-membranes; extra == 'extras'
  • napari-skimage; extra == 'extras'
Website by the napari team, original design by CZI.