{"name":"napari-signal-selector","display_name":"Napari Signal Selector","visibility":"public","icon":"","categories":[],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-signal-selector.load_flashing_polygons_data","title":"Load sample data from Napari Signal Selector","python_name":"napari_signal_selector._sample_data:load_flashing_polygons_data","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-signal-selector.load_blinking_polygons_data","title":"Load sample data from Napari Signal Selector","python_name":"napari_signal_selector._sample_data:load_blinking_polygons_data","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-signal-selector.make_inter_features_line_widget","title":"Signal Selector","python_name":"napari_signal_selector._interactive:InteractiveFeaturesLineWidget","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"napari-signal-selector.make_inter_features_line_widget","display_name":"Signal Selector and Annotator","autogenerate":false}],"sample_data":[{"command":"napari-signal-selector.load_flashing_polygons_data","key":"flashing_polygons","display_name":"Flashing Polygons (2D+t)"},{"command":"napari-signal-selector.load_blinking_polygons_data","key":"blinking_polygons","display_name":"Blinking Polygons (2D+t)"}],"themes":null,"menus":{"napari/layers/visualize":[{"when":null,"group":null,"submenu":"signals_submenu"}],"napari/layers/annotate":[{"when":null,"group":null,"submenu":"signals_submenu"}],"signals_submenu":[{"command":"napari-signal-selector.make_inter_features_line_widget","when":null,"group":null,"alt":null}]},"submenus":[{"id":"signals_submenu","label":"Signals / Time-Series","icon":null}],"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"napari-signal-selector","version":"0.1.2","dynamic":["license-file"],"platform":null,"supported_platform":null,"summary":"An interactive signal selector for napari, based on matplotlib.","description":"# napari-signal-selector\n\n[![License BSD-3](https://img.shields.io/pypi/l/napari-signal-selector.svg?color=green)](https://github.com/zoccoler/napari-signal-selector/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-signal-selector.svg?color=green)](https://pypi.org/project/napari-signal-selector)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-signal-selector.svg?color=green)](https://python.org)\n[![tests](https://github.com/zoccoler/napari-signal-selector/workflows/tests/badge.svg)](https://github.com/zoccoler/napari-signal-selector/actions)\n[![codecov](https://codecov.io/gh/zoccoler/napari-signal-selector/branch/main/graph/badge.svg)](https://codecov.io/gh/zoccoler/napari-signal-selector)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-signal-selector)](https://napari-hub.org/plugins/napari-signal-selector)\n[![DOI](https://zenodo.org/badge/661588266.svg)](https://zenodo.org/doi/10.5281/zenodo.10041219)\n\nAn interactive signal selector and annotator for napari, based on [matplotlib](https://matplotlib.org/stable/).\n\n[Jump to Intallation](#installation)\n\n----------------------------------\n\n## Usage\n\nThis plugin opens an embedded plotter in napari capable of plotting and interacting (selecting/annotating) with individual object signals (typically temporal features).\n\n![plotting](https://github.com/zoccoler/napari-signal-selector/raw/main/images/plotting.gif)\n\n### Input Data\n\nnapari-signal-selector works with a [Labels layer](https://napari.org/stable/howtos/layers/labels.html) containing segmented objects and whose `features` attribute contains a table that follows the example structure shown below:\n\n| `label` | `frame` | `feature` | ...  |\n|-------|-------|---------|---|\n| 1     | 0     | 1.0     | ...  |\n| 2     | 0     | 1.0     | ...  |\n| 3     | 0     | 0.5     | ...  |\n| 4     | 0     | 0.5     | ...  |\n| 1     | 1     | 2.0     | ...  |\n| 2     | 1     | 1.0     | ...  |\n| 3     | 1     | 1.0     | ...  |\n| 4     | 1     | 1.0     | ...  |\n| 1     | 2     | 3.0     | ...  |\n| 2     | 2     | 1.0     | ...  |\n| 3     | 2     | 0.5     | ...  |\n| 4     | 2     | 1.5     | ...  |\n| ⋮     | ⋮     | ⋮     |   |\n\nBasically, it needs an object identifier (in this case, the `label` column) that matches the labels in the Labels layer, and other columns containing x- and y-axis numbers to plot. Typically, x-axis is some temporal-related property.\n\nHere is how one could add such a layer to a napari viewer via code (check [this example notebook](./examples/synthetic_example.ipynb) for more details):\n\n```python\nviewer.add_labels(labels_image, features = table)\n```\n\nIf a layer like this is selected, you can choose what to plot by means of dropdown fields in the bottom of the plotter.\n\nBelow is a basic example using the \"Flashing Polygons\" synthetic data:\n\n![intro](https://github.com/zoccoler/napari-signal-selector/raw/main/images/intro.gif)\n\n## Tools\n\n### Selection Tool\n\nThe selection tool (arrowhead icon) is a toggle button which enables you to select individual signals. Once activated, the icon gets highlighted and you can click over individual signals to select them. Right-clicking unselects everything.\n\n![select](https://github.com/zoccoler/napari-signal-selector/raw/main/images/select.gif)\n\nIf the region you want to click is too crowded, consider zooming in first and then selecting.\n\n![zoom-select](https://github.com/zoccoler/napari-signal-selector/raw/main/images/zoom_select.gif)\n\nAnd if you know which label you want to select, you can enable `'show selected'` from the Labels layer options to solely display one label at a time. The Lables layer picker tool may help you get the right label.\n\n![show-selected](https://github.com/zoccoler/napari-signal-selector/raw/main/images/show_selected.gif)\n\n### Annotation Tool\n\nOnce one or multiple signals are selected, you can annotate them with the annotation tool (brush with a 'plus' icon). You need to choose a signal class first.\n*Remember to right-click to remove previous selections when annotating different signal classes!*\n\n![annotation](https://github.com/zoccoler/napari-signal-selector/raw/main/images/annotation.gif)\n\nAnnotations are saved back in the table in a new column called 'Annotations'.\n*Currently multiple annotations is not possible, i.e., more than one class assigned to the same part of the signal.*\n\n### Span-Selection Tool\n\nYou can use the span-selection tool (bounded horizontal arrows icon) to sub-select one or multiple parts of signals. Right-click to unselect regions. Hold 'SHIFT' while dragging the mouse to select multiple sub-regions.\n\n![span-select](https://github.com/zoccoler/napari-signal-selector/raw/main/images/span_select.gif)\n\nYou can use this in conjunction with the annotation tool to have sub-regions from the same signal with different annotations.\n\n![](https://github.com/zoccoler/napari-signal-selector/raw/main/images/span_annotation.gif)\n\n### Deletion Tool\n\nIf you made a mistake, you can remove previous annotations by selecting signal(s) and clicking on the trash icon at the right of the toolbar (or just annotate them with class 0).\n\n![delete](https://github.com/zoccoler/napari-signal-selector/raw/main/images/delete.gif)\n\nAlso, with the selection tool enbaled, by holding 'SHIFT' and left-clicking, you can select all signals. This may be useful to delete all previous annotations.\n\n![select-delete-all](https://github.com/zoccoler/napari-signal-selector/raw/main/images/select_delete_all.gif)\n\n### Exporting Annotations\n\nThe table with annotations can be displayed in napari using the napati builtin FeaturesTableWidget via `Layers > Visualize > Features table widget`. \n\nBy the way, with `'show selected'` checked, you can click on a label row in the table and see the corresponding label in the image **...and** in the plotter!\n\nTo export the table, click on `'Save as csv...'`.\n\nAnother option is to run the following code in the napari console (replace `'Labels'` with the name of your Labels layer and `'annotations.csv'` with the desired file name or file path):\n\n```python\nimport pandas as pd\ndf = viewer.layers['Labels'].data.features\ndf.to_csv('annotations.csv')\n```\n\n## Installation\n\nYou can install `napari-signal-selector` via [pip]. Follow these steps from a terminal.\n\nWe recommend using `mamba-forge` whenever possible. Click [here](https://github.com/conda-forge/miniforge#mambaforge) to choose the right download option for your OS.\n**If you do not use `mamba-forge`, replace the `mamba` term whenever you see it below with `conda`.**\n\nCreate a conda environment :\n\n    mamba create -n nss-env napari pyqt python=3.11\n    \nActivate the environment :\n\n    mamba activate nss-env\n\nInstall `napari-signal-selector` via [pip] :\n\n    pip install napari-signal-selector\n\nAlternatively, install latest development version with :\n\n    pip install git+https://github.com/zoccoler/napari-signal-selector.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-signal-selector\" 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[Cookiecutter]: https://github.com/audreyr/cookiecutter\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[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin\n\n[file an issue]: https://github.com/zoccoler/napari-signal-selector/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":"https://github.com/zoccoler/napari-signal-selector","download_url":null,"author":"Marcelo Leomil Zoccoler","author_email":"Marcelo Leomil Zoccoler <marzoccoler@gmail.com>","maintainer":null,"maintainer_email":null,"license":"Copyright (c) 2023, Marcelo Leomil Zoccoler\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\nSome parts of this software are based on napari-matplotlib, which is licensed under the following terms:\n\nCopyright (c) 2022, David Stansby\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 napari-matplotlib 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","Programming Language :: Python :: 3.13","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["numpy","magicgui","qtpy","cmap","nap-plot-tools>=0.1.2","scipy","matplotlib","tox; extra == \"testing\"","pytest; extra == \"testing\"","pytest-cov; extra == \"testing\"","pytest-qt; extra == \"testing\"","napari>=0.4.19; extra == \"testing\"","pyqt5; extra == \"testing\""],"requires_python":">=3.10","requires_external":null,"project_url":["Homepage, https://github.com/zoccoler/napari-signal-selector","Bug Tracker, https://github.com/zoccoler/napari-signal-selector/issues","Documentation, https://github.com/zoccoler/napari-signal-selector#README.md","Source Code, https://github.com/zoccoler/napari-signal-selector","User Support, https://github.com/zoccoler/napari-signal-selector/issues"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}