{"name":"napari-swc-editor","display_name":"napari-swc-editor","visibility":"public","icon":"","categories":["Annotation","Segmentation","Acquisition"],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-swc-editor.write_multiple","title":"Save multi-layer data with napari-swc-editor","python_name":"napari_swc_editor._writer:write_multiple","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-swc-editor.write_single_image","title":"Save image data with napari-swc-editor","python_name":"napari_swc_editor._writer:write_single_image","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-swc-editor.make_sample_data","title":"Load sample data from napari-swc-editor","python_name":"napari_swc_editor._sample_data:make_sample_data","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-swc-editor.make_empty_sample","title":"Create empty swc from napari-swc-editor","python_name":"napari_swc_editor._sample_data:make_empty_sample","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-swc-editor.swc_editor_widget","title":"SWC Editor Widget","python_name":"napari_swc_editor:SWCEditorWidget","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-swc-editor.get_reader","title":"Open data with napari-swc-reader","python_name":"napari_swc_editor._reader:napari_get_reader","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":[{"command":"napari-swc-editor.get_reader","filename_patterns":["*.swc"],"accepts_directories":false}],"writers":[{"command":"napari-swc-editor.write_multiple","layer_types":["image*","labels*"],"filename_extensions":[],"display_name":""},{"command":"napari-swc-editor.write_single_image","layer_types":["points"],"filename_extensions":[".swc"],"display_name":""}],"widgets":[{"command":"napari-swc-editor.swc_editor_widget","display_name":"SWC Editor Widget","autogenerate":false}],"sample_data":[{"command":"napari-swc-editor.make_sample_data","key":"unique_id.1","display_name":"sample-napari-swc-editor"},{"command":"napari-swc-editor.make_empty_sample","key":"unique_id.2","display_name":"empty-napari-swc-editor"}],"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"napari-swc-editor","version":"0.0.5","dynamic":null,"platform":null,"supported_platform":null,"summary":"Use point and shape layer to edit swc format in napari","description":"# napari-swc-editor\n\n[![License BSD-3](https://img.shields.io/pypi/l/napari-swc-editor.svg?color=green)](https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-swc-editor.svg?color=green)](https://pypi.org/project/napari-swc-editor)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-swc-editor.svg?color=green)](https://python.org)\n[![tests](https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor/workflows/tests/badge.svg)](https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor/actions)\n[![codecov](https://codecov.io/gh/LaboratoryOpticsBiosciences/napari-swc-editor/branch/main/graph/badge.svg)](https://codecov.io/gh/LaboratoryOpticsBiosciences/napari-swc-editor)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-swc-editor)](https://napari-hub.org/plugins/napari-swc-editor)\n\nUse point and shape layer to edit swc format in napari.\n\n----------------------------------\n\nThis [napari] plugin was generated with [copier] using the [napari-plugin-template].\n\n<!--\nDon't miss the full getting started guide to set up your new package:\nhttps://github.com/napari/napari-plugin-template#getting-started\n\nand review the napari docs for plugin developers:\nhttps://napari.org/stable/plugins/index.html\n-->\n\n## Features\n\n\nhttps://github.com/user-attachments/assets/cba1820f-d0b5-436c-a981-62bae0e1a6ba\n\n\n\n\n### IO\n#### READER\n- Your .swc should follow the following specs: http://www.neuronland.org/NLMorphologyConverter/MorphologyFormats/SWC/Spec.html\n- the reader will create 2 napari layer: `point_layer` and `shape_layer`. Only `point_layer` is interactive, `shape_layer` is used to render path between swc points.\n- The raw swc can be accessed in the point layer metadata. Such as `point_layer.metadata[\"raw_swc\"]`\n- A `pd.DataFrame` object is also saved in the metadata: `point_layer.metadata[\"swc_data\"]`\n#### WRITER\n- With the `point_layer` selected, you can use napari interface to save with `.swc` extension name.\n- You can also do it in command line: `napari.save_layers('test.swc', [point_layer])`\n### Napari Interface\n#### Structure ID and point symbol\nIn swc, structure id allow to label the type of neuron structure the point belongs to. In this plugin by default, the points will follow this symbol mapping:\n```python\nSWC_SYMBOL = {\n    0: \"clobber\",  # undefined\n    1: \"star\",  # soma\n    2: \"disc\",  # axon\n    3: \"triangle_down\",  # basal dendrite\n    4: \"triangle_up\",  # apical dendrite\n}\n```\n![image](https://github.com/user-attachments/assets/618aa000-370d-43f9-8645-8a3b7e9b9739)\n\nYou can also visualize the swc data in a table using the widget under `Plugin > SWC Editor Widget`\n\n![image](https://github.com/user-attachments/assets/ed43f4c2-582b-4bc1-bbb1-54e8d9487f1d)\n\nWhen using the \"Show swc table\" you will have an interactive table widget:\n- left-click on table: highlight + center on the corresponding point\n- **double**-left-click on table: highlight + center on the correspongind point **+ zoom**\n- selection on the point layer: highlight the corresponding row on the table\n\n#### SWC Edition\n**ALL INTERACTIONS ARE ONLY BOUND TO THE `point_layer`**\n**THERE IS NO CTRL-Z (please save your progress)**\n- **Add point**: You can edit the \"r\" and the \"structure_id\" using the `point_size` and `symbol` ![image](https://github.com/user-attachments/assets/44255691-ffa0-4f63-8368-499b0c8ff6a4)\n- **Remove point**: (Select the point and press `1` or `suppr` or `delete`) All the link pointing to this point will be removed\n- **Add edge**: Select 2 or more point(s) and press on your keyboard `l` (aka: link).\n- **Remove edge**: Select 1 or more point(s) and press on your keyboard `u` (aka: unlink).\n\nIf you want to link point as you are adding them you have two solutions:\n- press \"CTRL\" while you add points, this will create a link with the previously selected point\n- use the `Plugin > SWC Editor Widget` Checkbox (\"link previous node with new node (same as using CTRL+Click)\"): when selected, all new points will be selected with the previously selected point\n\nhttps://github.com/user-attachments/assets/273f1221-2882-4a7c-ab7f-6d3ecb7f3fa6\n\n## Installation\n\nYou can install `napari-swc-editor` via [pip]:\n\n    pip install napari-swc-editor\n\n\n\n\n\n\n\nTo install latest development version :\n\n    pip install git+https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor.git\n\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox], 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-swc-editor\" 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[copier]: https://copier.readthedocs.io/en/stable/\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[napari-plugin-template]: https://github.com/napari/napari-plugin-template\n\n[file an issue]: https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor/issues\n\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n","description_content_type":"text/markdown","keywords":null,"home_page":null,"download_url":null,"author":"Clément Caporal","author_email":"caporal.clement@gmail.com","maintainer":null,"maintainer_email":null,"license":"Copyright (c) 2024, Clément Caporal\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.9","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["numpy","magicgui","qtpy","scikit-image","pandas","tox; extra == \"testing\"","pytest; extra == \"testing\"","pytest-cov; extra == \"testing\"","pytest-qt; extra == \"testing\"","napari; extra == \"testing\"","pyqt5; extra == \"testing\""],"requires_python":">=3.9","requires_external":null,"project_url":["Bug Tracker, https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor/issues","Documentation, https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor#README.md","Source Code, https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor","User Support, https://github.com/LaboratoryOpticsBiosciences/napari-swc-editor/issues"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}