Skip to main content

napari-TopoStats

License MIT PyPI Python Version tests codecov napari hub


This napari plugin was generated with Cookiecutter using the cookiecutter-napari-plugin template.

Installation

Activate your Python environment (e.g. Conda) and make sure your Python version is >= 3.10 and < 3.12. An example conda enviroment command would be:

conda create -n napari-env python=3.11
conda activate napari-env

With Git installed on your machine, install the napari-TopoStats package from GitHub using pip.

pip install git+https://github.com/AFM-SPM/napari-TopoStats.git@main

This command will install other required modules from GitHub (AFMReader, napari-AFMReader, TopoStats)

You can then run napari with:

napari

Usage

To load an image into the napari viewer, drag and drop your image file into the window. A small window will open prompting you to input the input channel for the image you are loading. Enter the channel used by your image (e.g. Height). The loaded image will appear as a layer in the GUI. Note: this loading utility comes from napari-AFMReader.

Input channel window

Topostats tools can be accessed from the toolbar of napari (top left) as shown.

Toolbar

This will then open a window containing buttons with available functions. Select a layer, then click the button corresponding to the function you want to run on the layer.

Button Grid

Before running the function, you can choose to load a config file using the button and selecting the file. Both json and yaml file formats are supported. This config will be used for the functions you run until you close napari. There is also a button to save that file as the new default (instead of the topostats generated one). This default can be reset to the topostats default at anytime by clicking the Reset Default Config button in the bottom right of the main window.

Loading a config file

When you run a function which requires the config, if you haven't loaded a config file manually, a default configuration is used which will be the config you have set as default if you have set one. If you haven't, the topostats default will be used. Once a config is loaded, either manually or automatically, an edit config button will appear, which opens a window allowing the config file to be edited directly through the napari gui. Changes made are not automatically saved to the loaded config file, however, the updated config file can be saved as a file with the Save to file button at the bottom of the window. In this window, there is also a button to save the edited config file as the new default.

Edit config window

When you run a function for the first time, a window will open with options to adjust for that function (which are applied next time the function is run) if that function has options which can be adjusted. There is also a run button in that window. This runs the function on the selected layer (it does exactly the same thing as clicking the function button in the grid). Note this window will only appear if there are options which can be adjusted outside of those in the config file.

Function window

Batch Process is a special function that works the same as if running topostats process in the command line, using the config you currently have loaded or the default config (with adjusted options if you have updated your default) if you haven't loaded a config. If the default is used, a window will appear asking you to select a directory which contains the data to be processed as well as a directory to save the output files to (which you may want to create with the new folder button if the directory doesn't exist). Otherwise, the directories defined in the config file will be used. Once these have been defined topostats will process in the background (the output and progress can been seen in the command line). You can carry on using napari while this happens. Function window

Current functions:

  1. Load config button allows a config file to be selected from your hard disk.
  2. Run filters requires an image layer to be selected and creates an image layer with topostats filters run.
  3. Run grains requires an image layer to be selected and creates a labels layer with topostats grains detection run.
  4. Make 3D requires an image layer to be selected and creates a 3D image layer. Viewing mode (in the bottom left of the viewer) is automatically switched to 3D.
  5. Run Grainstats requires a labels layer created by the Run Grains function to be selected and creates an interactivate table in the dock on the right.
  6. Batch process uses the full topostats pipeline to process a directory of files. View above for details.

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 MIT license, "napari-topostats" is free and open source software

Issues

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

Metadata

Release files for napari-TopoStats 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-TopoStats 0.0.3
File Size Uploaded
napari_topostats-0.0.3.tar.gz 32.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-TopoStats 0.0.3
File Interpreter ABI Platform
napari_topostats-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 47.8 MB

Release files / napari_topostats-0.0.3.tar.gz

Download URL napari_topostats-0.0.3.tar.gz
Size 32.9 MB
Tags Source
SHA-256 checksum
How to use checksums
6bd163260992aecf26f85b131b15fac2ac2e1aa3f5bb99f66d1c974d8ef46bdc
BLAKE2b-256 checksum
How to use checksums
e8879d1e9abeb83d1da8e47ce2bdab258bcec5f4481e6f09b42b860f60b9d38a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.

Transparency log

Release files / napari_topostats-0.0.3-py3-none-any.whl

Download URL napari_topostats-0.0.3-py3-none-any.whl
Size 14.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
87a827028caab5f3ef7443b1d82f3a1e49eca29b52518534d00aff21a0bef9fb
BLAKE2b-256 checksum
How to use checksums
cc9abc46c4be5436d8b3b471ea451b8de19f6aea2edade0d72224aabc8bc487d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page