napari-isolate-cell


Namenapari-isolate-cell JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryIsolate soma‑specific arbors & export SWC.
upload_time2025-08-15 19:13:42
maintainerNone
docs_urlNone
authorSergio Bernal Garcia
requires_python>=3.10
license Copyright (c) 2025, Sergio Bernal Garcia All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords napari plugin neuron neuroscience segmentation morphology swc cell isolation image analysis 3d visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # napari-isolate-cell

[![License BSD-3](https://img.shields.io/pypi/l/napari-isolate-cell.svg?color=green)](https://github.com/serg-bg/napari-isolate-cell/raw/main/LICENSE)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-isolate-cell.svg?color=green)](https://python.org)
[![tests](https://github.com/serg-bg/napari-isolate-cell/workflows/tests/badge.svg)](https://github.com/serg-bg/napari-isolate-cell/actions)
[![codecov](https://codecov.io/gh/serg-bg/napari-isolate-cell/branch/main/graph/badge.svg)](https://codecov.io/gh/serg-bg/napari-isolate-cell)
[![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)

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.

![Demo of napari-cell-isolate plugin](images/napari-cell-isolate-demo.gif)

----------------------------------

## 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

![Workflow diagram](images/One-click_cell_isolation_RESPAN.png)

## Installation

### For Users (Recommended)
```bash
pip install napari-isolate-cell
```

Or using [uv](https://github.com/astral-sh/uv) (faster):
```bash
uv pip install napari-isolate-cell
```

### For Developers
```bash
git clone https://github.com/serg-bg/napari-isolate-cell.git
cd napari-isolate-cell
pip install -e .[testing]
```

## Usage

1. **Launch napari** and open your 3D segmentation (`.tif` file)
2. **Open plugin**: `Plugins` → `napari-isolate-cell` → `Isolate Cell Arbor`
3. **Select your labels layer** from the dropdown
4. **Click "Activate Click Isolation"**
5. **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.

[napari]: https://github.com/napari/napari
[napari hub]: https://napari-hub.org/
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[pytest]: https://docs.pytest.org/
[file an issue]: https://github.com/serg-bg/napari-isolate-cell/issues

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "napari-isolate-cell",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "napari, plugin, neuron, neuroscience, segmentation, morphology, swc, cell isolation, image analysis, 3D visualization",
    "author": "Sergio Bernal Garcia",
    "author_email": "smb2318@columbia.edu",
    "download_url": "https://files.pythonhosted.org/packages/dc/07/5b628e191a27f3fb3da4f8e94e0489b57e7d65b0f87f671b95f3bde079e4/napari_isolate_cell-0.1.2.tar.gz",
    "platform": null,
    "description": "# napari-isolate-cell\n\n[![License BSD-3](https://img.shields.io/pypi/l/napari-isolate-cell.svg?color=green)](https://github.com/serg-bg/napari-isolate-cell/raw/main/LICENSE)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-isolate-cell.svg?color=green)](https://python.org)\n[![tests](https://github.com/serg-bg/napari-isolate-cell/workflows/tests/badge.svg)](https://github.com/serg-bg/napari-isolate-cell/actions)\n[![codecov](https://codecov.io/gh/serg-bg/napari-isolate-cell/branch/main/graph/badge.svg)](https://codecov.io/gh/serg-bg/napari-isolate-cell)\n[![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)\n\nA [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.\n\n![Demo of napari-cell-isolate plugin](images/napari-cell-isolate-demo.gif)\n\n----------------------------------\n\n## Overview\n\nThis plugin helps streamline the process of extracting individual cell structures from dense segmentations, such as those produced by deep learning models like nnUNet.\n\n**Key Features:**\n\n*   **Click-Based Isolation:** Simply click on the soma (or any part) of the cell you want to isolate in a Napari Labels layer.\n*   **Automatic Scale Detection:** Reads ZYX scale information directly from TIFF metadata (standard tags or ImageJ metadata) and applies it to the loaded Napari layer.\n*   **Anisotropy Awareness:** Automatically populates the widget's Anisotropy fields based on the detected image scale.\n*   **Outputs:**\n    *   Adds the isolated cell as a new Labels layer in Napari, preserving the original scale.\n    *   Saves the isolated label volume as a TIFF file.\n    *   Saves the skeletonized structure as an SWC file with coordinates reflecting the original image's physical scale (micrometers).\n*   **Configurable Parameters:** Adjust morphological closing radius (defaults to 0 for dense segmentations) and skeleton dust threshold.\n\n## Workflow\n\n![Workflow diagram](images/One-click_cell_isolation_RESPAN.png)\n\n## Installation\n\n### For Users (Recommended)\n```bash\npip install napari-isolate-cell\n```\n\nOr using [uv](https://github.com/astral-sh/uv) (faster):\n```bash\nuv pip install napari-isolate-cell\n```\n\n### For Developers\n```bash\ngit clone https://github.com/serg-bg/napari-isolate-cell.git\ncd napari-isolate-cell\npip install -e .[testing]\n```\n\n## Usage\n\n1. **Launch napari** and open your 3D segmentation (`.tif` file)\n2. **Open plugin**: `Plugins` \u2192 `napari-isolate-cell` \u2192 `Isolate Cell Arbor`\n3. **Select your labels layer** from the dropdown\n4. **Click \"Activate Click Isolation\"**\n5. **Click any cell** in the viewer to isolate it\n\n**Outputs:**\n- New labels layer with isolated cell\n- `isolated_outputs/` folder containing:\n  - `.tif` - Isolated cell volume\n  - `.swc` - Skeleton with physical coordinates (\u00b5m)\n\n**Parameters:**\n- **Morphological Closing**: Default 0 (increase to bridge small gaps)\n- **Dust Threshold**: Default 100 (minimum skeleton branch size in voxels)\n- **Anisotropy**: Auto-detected from TIFF metadata\n\n## Requirements\n\n*   Python >= 3.10\n*   napari\n*   NumPy\n*   scikit-image\n*   SciPy\n*   tifffile\n*   magicgui\n*   qtpy\n\n(See `pyproject.toml` for specific version constraints)\n\n## Contributing\n\nContributions 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\nthe coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [BSD-3] license,\n\"napari-isolate-cell\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n[napari]: https://github.com/napari/napari\n[napari hub]: https://napari-hub.org/\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[pytest]: https://docs.pytest.org/\n[file an issue]: https://github.com/serg-bg/napari-isolate-cell/issues\n",
    "bugtrack_url": null,
    "license": "\n        Copyright (c) 2025, Sergio Bernal Garcia\n        All rights reserved.\n        \n        Redistribution and use in source and binary forms, with or without\n        modification, are permitted provided that the following conditions are met:\n        \n        * Redistributions of source code must retain the above copyright notice, this\n          list of conditions and the following disclaimer.\n        \n        * Redistributions in binary form must reproduce the above copyright notice,\n          this list of conditions and the following disclaimer in the documentation\n          and/or other materials provided with the distribution.\n        \n        * Neither the name of copyright holder nor the names of its\n          contributors may be used to endorse or promote products derived from\n          this software without specific prior written permission.\n        \n        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n        ",
    "summary": "Isolate soma\u2011specific arbors & export SWC.",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/serg-bg/napari-isolate-cell/issues",
        "Citation": "https://github.com/serg-bg/napari-isolate-cell/blob/main/CITATION.cff",
        "Documentation": "https://github.com/serg-bg/napari-isolate-cell#readme",
        "Homepage": "https://github.com/serg-bg/napari-isolate-cell",
        "Source Code": "https://github.com/serg-bg/napari-isolate-cell"
    },
    "split_keywords": [
        "napari",
        " plugin",
        " neuron",
        " neuroscience",
        " segmentation",
        " morphology",
        " swc",
        " cell isolation",
        " image analysis",
        " 3d visualization"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "14001fdab6ee1f7c48b3fefa6b4f124b62918a115de73ce184935463d53374c0",
                "md5": "18bfdebaee87f3f50257d9bff07e6adb",
                "sha256": "cb464813bff2dfdde1338fa5ad506fe2e84d08a334f0c2e3a839a588fe849fbb"
            },
            "downloads": -1,
            "filename": "napari_isolate_cell-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "18bfdebaee87f3f50257d9bff07e6adb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 20922,
            "upload_time": "2025-08-15T19:13:41",
            "upload_time_iso_8601": "2025-08-15T19:13:41.464920Z",
            "url": "https://files.pythonhosted.org/packages/14/00/1fdab6ee1f7c48b3fefa6b4f124b62918a115de73ce184935463d53374c0/napari_isolate_cell-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dc075b628e191a27f3fb3da4f8e94e0489b57e7d65b0f87f671b95f3bde079e4",
                "md5": "e3ae855b581694c9dae3fbc2643def9d",
                "sha256": "7cdcdc7b48f7e932e7a05bcae77430d000aed41e40f5613621849bd565eb6579"
            },
            "downloads": -1,
            "filename": "napari_isolate_cell-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e3ae855b581694c9dae3fbc2643def9d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 21650,
            "upload_time": "2025-08-15T19:13:42",
            "upload_time_iso_8601": "2025-08-15T19:13:42.304399Z",
            "url": "https://files.pythonhosted.org/packages/dc/07/5b628e191a27f3fb3da4f8e94e0489b57e7d65b0f87f671b95f3bde079e4/napari_isolate_cell-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-15 19:13:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "serg-bg",
    "github_project": "napari-isolate-cell",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "napari-isolate-cell"
}
        
Elapsed time: 0.94897s