A simple plugin to help with analyzing cells in napari
Project description
MMV_H4Cells
A simple plugin to help with analyzing cells in napari
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
Installation
You can install mmv_h4cells
via pip:
pip install mmv_h4cells
To install latest development version :
pip install git+https://github.com/MMV-Lab/mmv_h4cells.git
Documentation
This plugin was developed for semi-automatic cell analysis to determine cell sizes of individual cells.
The core functionality includes the option to include or exclude individual (cell) instances in the evaluation via the include/exclude button. After a decision has been made, the plugin automatically centers on the next instance and a new decision can be made. In addition, you can include multiple cells at the same time using the "select multiple" function. It is also possible to analyze entire ROIs at once.
Get started
To get started, an instance segmentation must be loaded. This can be done simply via drag & drop. A raw image of the original data is optional, but certainly helps when deciding whether to include or exclude. Once the layers have been loaded into napari, the plugin can be started. If you have only interrupted the evaluation and exported the previous results, you can now import them again (the segmentation must be reloaded into napari).
Analysis
The analysis can be started by clicking on the "Start analysis" button. The next instance ID to be evaluated is shown next to "Start analysis at". To change the region of interest to be evaluated, a different ID can be entered there and the plugin will center on this within the next 2 decisions. Decisions are made by clicking the Include/Exclude button. If an instance is not completely recognized correctly, you can use the paint function of napari to correct this manually and then include the instance as usual using the button. The undo function can be used to undo the last decision and the "Draw own cell" button allows you to add unrecognized cells manually. This must be done cell by cell and confirmed each time using the button. The plugin does not allow other existing instances to be painted over. If this happens by mistake, a warning is displayed, oberlapping pixels are highlighted and users can either cancel via the cancel button within the warning or close the warning and correct this manually.
When an instance is included, the respective instance is written to a segmentation layer, which can be exported using the export function. In addition, the ID, the size and the centroid are exported as a .csv file. We also export a .zarr file, which makes it possible to re-import previously exported results, for example to pause the analysis. To enable a smooth re-import, the .csv and the .zarr file must have the same name stem, so please either do not rename the files or rename them in the same way.
For a better overview, the included/excluded/remaining instances can be viewed using the buttons at the bottom.
Select multiple cells
We also support the option of including several cells at once. To do so, the respective IDs must be entered at the bottom next to "Include" and then selected using the "Select multiple". This works by entering comma-separated IDs, so 1,5,100,17 would be a valid entry.
Select ROI
Entire ROIs can also be analyzed. To do this, simply enter the corner pixels in the "Range x" and "Range y" fields. All cells > the threshold are included; if, for example, cells that lie exactly at the edge of the ROI and are partially cut off are to be excluded, a corresponding threshold must be set.
Note: Exported ROIs cannot be re-imported.
Hotkeys
k
- Includeg
- Excludej
- Change visibility of all label layers for better inspectionh
- Undo
Don'ts
This is a tool for analyzing cells. However, we do not catch every possible error and in order for the tool to run stable, it is important to avoid some operations:
- Do not create new layers during the analysis.
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 BSD-3 license, "mmv_h4cells" is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mmv_h4cells-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4067526d61c1e65e680091444ff149dd7c00efc1ba3c69f7dfe834982572b46f |
|
MD5 | 47563b6de7055963aff00bee49a905d7 |
|
BLAKE2b-256 | e0d3fcd0e180c0a078f0e7cfcf0f974aaf815c7aa4881dd39cf9a0ee96e6ae1c |