napari-isolate-cell
A napari plugin to isolate single cell morphologies (e.g., neurons) from label volumes based on a user click, automatically read image scale, and export the isolated structure as TIFF and correctly scaled SWC files.
Overview
This plugin helps streamline the process of extracting individual cell structures from dense segmentations, such as those produced by deep learning models like nnUNet.
Key Features:
- Click-Based Isolation: Simply click on the soma (or any part) of the cell you want to isolate in a Napari Labels layer.
- Automatic Scale Detection: Reads ZYX scale information directly from TIFF metadata (standard tags or ImageJ metadata) and applies it to the loaded Napari layer.
- Anisotropy Awareness: Automatically populates the widget's Anisotropy fields based on the detected image scale.
- Outputs:
- Adds the isolated cell as a new Labels layer in Napari, preserving the original scale.
- Saves the isolated label volume as a TIFF file.
- Saves the skeletonized structure as an SWC file with coordinates reflecting the original image's physical scale (micrometers).
- Configurable Parameters: Adjust morphological closing radius (defaults to 0 for dense segmentations) and skeleton dust threshold.
Workflow
Installation
For Users (Recommended)
pip install napari-isolate-cell
Or using uv (faster):
uv pip install napari-isolate-cell
For Developers
git clone https://github.com/serg-bg/napari-isolate-cell.git
cd napari-isolate-cell
pip install -e .[testing]
Usage
- Launch napari and open your 3D segmentation (
.tiffile) - Open plugin:
Plugins→napari-isolate-cell→Isolate Cell Arbor - Select your labels layer from the dropdown
- Click "Activate Click Isolation"
- Click any cell in the viewer to isolate it
Outputs:
- New labels layer with isolated cell
isolated_outputs/folder containing:.tif- Isolated cell volume.swc- Skeleton with physical coordinates (µm)
Parameters:
- Morphological Closing: Default 0 (increase to bridge small gaps)
- Dust Threshold: Default 100 (minimum skeleton branch size in voxels)
- Anisotropy: Auto-detected from TIFF metadata
Requirements
- Python >= 3.10
- napari
- NumPy
- scikit-image
- SciPy
- tifffile
- magicgui
- qtpy
(See pyproject.toml for specific version constraints)
Contributing
Contributions are very welcome. Please file an issue to discuss potential changes or features first. Tests can be run with pytest (pip install -e .[testing] then pytest). 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, "napari-isolate-cell" 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-isolate-cell 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| napari_isolate_cell-0.1.2.tar.gz | 21.6 kB | Without provenance | Details for napari_isolate_cell-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| napari_isolate_cell-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for napari_isolate_cell-0.1.2-py3-none-any.whl |
Total release size: 42.6 kB
Release files / napari_isolate_cell-0.1.2.tar.gz
| Download URL | napari_isolate_cell-0.1.2.tar.gz |
|---|---|
| Size | 21.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cdcdc7b48f7e932e7a05bcae77430d000aed41e40f5613621849bd565eb6579
|
|
BLAKE2b-256 checksum How to use checksums |
dc075b628e191a27f3fb3da4f8e94e0489b57e7d65b0f87f671b95f3bde079e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / napari_isolate_cell-0.1.2-py3-none-any.whl
| Download URL | napari_isolate_cell-0.1.2-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb464813bff2dfdde1338fa5ad506fe2e84d08a334f0c2e3a839a588fe849fbb
|
|
BLAKE2b-256 checksum How to use checksums |
14001fdab6ee1f7c48b3fefa6b4f124b62918a115de73ce184935463d53374c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Security for napari-isolate-cell 0.1.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.