{"name":"napari-isolate-cell","display_name":"Isolate Cell from Segmentation","visibility":"public","icon":"","categories":["Segmentation","Annotation","Visualization"],"schema_version":"0.2.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-isolate-cell.isolate_widget","title":"Isolate Cell Arbor","python_name":"napari_isolate_cell._widget:make_isolate_widget","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-isolate-cell.read_tiff","title":"TIFF with Scale Detection (Isolate Cell)","python_name":"napari_isolate_cell.io:napari_get_reader","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":[{"command":"napari-isolate-cell.read_tiff","filename_patterns":["*.tif","*.tiff","*.TIF","*.TIFF"],"accepts_directories":false}],"writers":null,"widgets":[{"command":"napari-isolate-cell.isolate_widget","display_name":"Isolate Cell Arbor","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"napari-isolate-cell","version":"0.1.2","dynamic":["license-file"],"platform":null,"supported_platform":null,"summary":"Isolate soma‑specific arbors & export SWC.","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` → `napari-isolate-cell` → `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 (µm)\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","description_content_type":"text/markdown","keywords":"napari,plugin,neuron,neuroscience,segmentation,morphology,swc,cell isolation,image analysis,3D visualization","home_page":null,"download_url":null,"author":"Sergio Bernal Garcia","author_email":"smb2318@columbia.edu","maintainer":null,"maintainer_email":null,"license":"Copyright (c) 2025, Sergio Bernal Garcia\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, 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\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: BSD License","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["napari[all]","numpy","magicgui","qtpy","scikit-image","scipy","kimimaro","tifffile","tox; extra == \"testing\"","pytest; extra == \"testing\"","pytest-cov; extra == \"testing\"","pytest-qt; extra == \"testing\"","napari; extra == \"testing\"","pyqt5; extra == \"testing\""],"requires_python":">=3.10","requires_external":null,"project_url":["Homepage, https://github.com/serg-bg/napari-isolate-cell","Bug Tracker, https://github.com/serg-bg/napari-isolate-cell/issues","Documentation, https://github.com/serg-bg/napari-isolate-cell#readme","Source Code, https://github.com/serg-bg/napari-isolate-cell","Citation, https://github.com/serg-bg/napari-isolate-cell/blob/main/CITATION.cff"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}