Skip to main content

Napari plugin for TopoStats a suite of tools for working with Atomic Force Microscopy Images.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari_topostats-0.0.1.tar.gz (32.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_topostats-0.0.1-py3-none-any.whl (14.8 MB view details)

Uploaded Python 3

File details

Details for the file napari_topostats-0.0.1.tar.gz.

File metadata

  • Download URL: napari_topostats-0.0.1.tar.gz
  • Upload date:
  • Size: 32.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for napari_topostats-0.0.1.tar.gz
Algorithm Hash digest
SHA256 738b8e98fad93e0edd673d34bd4713b9276664997471ac5bc5792818fbd4b157
MD5 99cbc3cf1a7fd1527cd18abf6580ed4e
BLAKE2b-256 00e45b582d09dc87e7a459a3b49393f41654db0bd8ba1c9753de22415240f263

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_topostats-0.0.1.tar.gz:

Publisher: pypi.yaml on AFM-SPM/napari-TopoStats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file napari_topostats-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_topostats-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e07946833e73455ecec73d65314b4d9f889526921049fc1e528ea801f0136dae
MD5 f1ff436525982e05aa5b0f63ca337b71
BLAKE2b-256 405ba39f4d37928d4d1a8be7142d6462f89e2ab36f56851820df36063d26bf84

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_topostats-0.0.1-py3-none-any.whl:

Publisher: pypi.yaml on AFM-SPM/napari-TopoStats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page