{"name":"napari-3d-counter","display_name":"3D Counter","visibility":"public","icon":"","categories":["Measurement","Utilities"],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-3d-counter.read_cells","title":"Read \".csv\" files","python_name":"napari_3d_counter._reader:get_reader","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.make_count3d","title":"Make widget for counting in 3d","python_name":"napari_3d_counter._widget:Count3D","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.make_reconstruct_selected","title":"Make widget for reconstructing labels based on points","python_name":"napari_3d_counter._widget:ReconstructSelected","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.make_ingress_points","title":"Make widget for moving a points layer into Count 3D","python_name":"napari_3d_counter._widget:IngressPoints","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.make_split_on_shapes","title":"Make widget for splitting points by shape","python_name":"napari_3d_counter._widget:SplitOnShapes","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.save","title":"Save cell counts","python_name":"napari_3d_counter.commands:save","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.load","title":"Load cell counts","python_name":"napari_3d_counter.commands:load","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.next_cell_type","title":"Switch to counting the next cell type","python_name":"napari_3d_counter.commands:next_cell_type","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-3d-counter.prev_cell_type","title":"Switch to counting the previous cell type","python_name":"napari_3d_counter.commands:prev_cell_type","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":[{"command":"napari-3d-counter.read_cells","filename_patterns":["*.csv"],"accepts_directories":false}],"writers":null,"widgets":[{"command":"napari-3d-counter.make_count3d","display_name":"Count 3D","autogenerate":false},{"command":"napari-3d-counter.make_reconstruct_selected","display_name":"Reconstruct Selected","autogenerate":false},{"command":"napari-3d-counter.make_ingress_points","display_name":"Ingress Points","autogenerate":false},{"command":"napari-3d-counter.make_split_on_shapes","display_name":"Split on Shapes","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"napari-3d-counter","version":"0.5.10","dynamic":["license-file"],"platform":null,"supported_platform":null,"summary":"A simple plugin for counting objects in 3D images","description":"# Napari-3D-Counter\n\n[![License GNU GPL v3.0](https://img.shields.io/pypi/l/napari-3d-counter.svg?color=green)](https://github.com/pnewstein/napari-3d-counter/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-3d-counter.svg?color=green)](https://pypi.org/project/napari-3d-counter)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-3d-counter.svg?color=green)](https://python.org)\n[![tests](https://github.com/pnewstein/napari-3d-counter/workflows/tests/badge.svg)](https://github.com/pnewstein/napari-3d-counter/actions)\n[![codecov](https://codecov.io/gh/pnewstein/napari-3d-counter/branch/main/graph/badge.svg)](https://codecov.io/gh/pnewstein/napari-3d-counter)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-3d-counter)](https://napari-hub.org/plugins/napari-3d-counter)\n\nA plugin for manually counting objects in 3D images\n\n![small](https://github.com/pnewstein/napari-3d-counter/assets/30813691/9d524c31-f23b-4b34-bcb6-ec3bb415cdae)\n\nDocumentation can be found below and at the [this site](https://pnewstein.github.io/napari-3d-counter.html)\n\n----------------------------------\n\nThis [napari](https://github.com/napari/napari) plugin was generated with [Cookiecutter](https://github.com/audreyr/cookiecutter) using @napari's [cookiecutter-napari-plugin](https://github.com/napari/cookiecutter-napari-plugin) template.\n\n## Prerequisites\n\nIt is recommended to use conda to install Napari-3D-Counter and napari.\nInstallation instructions for the miniconda distribution of conda can be found here:\n\n[https://www.anaconda.com/docs/getting-started/miniconda/install](https://www.anaconda.com/docs/getting-started/miniconda/install)\n\n\n\n## Installation\n\n\nYou can install `napari-3d-counter` via conda\n\n    conda create -n n3dc-env -c conda-forge -y napari napari-3d-counter pyqt python=3.12\n    conda activate n3dc-env\n\n\npip\n\n    pip install napari-3d-counter\n\n<details>\n\n<summary>Troubleshooting</summary>\n\nIf above conda and pip installs do not work. follow [the\ninstructions](https://napari.org/stable/tutorials/fundamentals/installation.html)\nto get a working napari installation. Then install napari-3d counter into that\nenvironment:\n\n    conda activate napari-env\n    pip install napari-3d-counter\n\n</details>\n\n##  Count3D Usage\n\n1. First launch napari with the `napari` command.\n1. Count3D can be launched from the plugin menu of napari, or through the\n   command palette (Ctrl+Shift+P). Select Count3D.\n\n> [!TIP]\n> Count can also be launched with `examples/launch_count_3d.py`\n\nThis will spawn several [Points Layers](https://napari.org/stable/howtos/layers/points.html):\n\n##### Point adder\n\nThis layer acts as the interface for napari-3d-counter. Any points added to\nthis layer are dispatched into the appropriate data layer labeled by the GUI.\n*Any other actions to this layer has no effects*\n\n##### Cell Type N\n\nThese are the data layers. The points actually live in these layers,\nand you can edit the style or delete individual points here.\n\n##### out of slice\n\nThis contains the x and y of all points in all layers. This may be\nuseful to keep track of what regions of the data have been annotated.\n\n### Adding a cell\n\nYou can add a cell of the currently selected cell type by clicking on the\nviewer. The counter on the current cell type's button (on the right side of the\nscreen) will be incremented.\n\n<details>\n\n<summary>Troubleshooting</summary>\n\n#### No cell was added\n\n- Ensure that `Point adder` layer is selected\n- Ensure that `Add points` tool is selected\n- Ensure that there are no image layers obscuring the layers spawned by napari\n- Click on the viewer where you would like the point to be added\n\n\n#### The cell marker is the wrong size\n\n- See [Change appearance of a cell type](https://github.com/pnewstein/napari-3d-counter#change-appearance-of-a-cell-type)\n- Use the `point size` slider\n\n</details>\n\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/745d495e-1d18-43dd-aa5e-e9ecd835cdae\n\n\n### Changing cell type\n\nYou can change the currently selected cell type by clicking on that cell type's\nbutton. This change will be reflected in the the color and text of the first box in the GUI. \nNow any clicks to the canvas will be added to that type.\n\nAdditionally, the keyboard\nshortcut for that cell type can be used. Keyboard shortcuts are listed on the\nbutton, and are \"q\", \"w\", \"e\", \"r\", \"t\", \"y\" by default\n\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/844d04ce-2795-4226-a98b-d5fe5a0b131e\n\n\n### Undo last added cell\n\nThe undo button (shortcut u) will remove last added cell, regardless of\ncell type. This will change both remove the cell from the canvas and decrease the count in the appropriate type.\n\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/c04ca5e3-9f48-4dd5-89e5-a9866b353e03\n\n\n### Remove a particular cell\n\nTo remove a particular cell, change to the layer containing the cell you would\nlike to remove. Then select the `select points` tool (arrow) to select the points to\ndelete, then use `Delete selected points` (x) to delete those points\n\nThis change will be reflected in the counts.\n\n> [!TIP]\n> Ensure that the corect napari cell type layer is selected\n\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/d0787cba-9b23-46d5-9cd3-21a4ad73460a\n\n\n\n### Change appearance of a cell type\n\nChanges to the name or edge color of a points layer will be reflected in the\npreviously added points, as well as the GUI. Features that are editable in this way include:\n\n- face color\n- edge color\n- symbol\n- point size\n\n> [!TIP]\n> Ensure that the corect napari cell type layer is selected\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/6c495270-d4c4-473e-9091-8d2e0f8e2764\n\n\n### Save configuration\n\nUse the `Make launch_cell_count.py` button to create a python script that will\nlaunch napari with 3DCounter added to the dock and with all cell type\nappearances. This functions to save any manual changes you made to the\nappearance of a cell type between sessions.\n\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/3448652d-3064-4900-8bbe-e88d75667108\n\n\n### Save cells\n\nUse the \"Save cells\" button to save the cell coordinates for all layers into a\ncsv file. This saves the coordinates and the names of each of the cells.\n\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/38b30f2a-cc83-46c2-8b19-4d44715c07c5\n\n\n### Load cells\n\nUse the \"Load cells\" button to load the cells from a csv file into new layers\n\n\nhttps://github.com/pnewstein/napari-3d-counter/assets/30813691/7df74688-85b1-4b61-aa51-dab179763832\n\n> [!TIP]\n> A csv file can be dragged into the viewer to load the cells\n\n\n\n### Launch with saved configuration\n\nTo run Count3D with custom configuration, paste the following code into your napari ipython console\n\n```python\nfrom napari_3d_counter import Count3D, CellTypeConfig\n\ncell_type_config = [\n    # The first cell type is called \"cq+eve+\" and should be green\n    CellTypeConfig(\n        name=\"cq+eve+\",\n        color=\"g\"\n    ),\n    # The first cell type is called \"cq+eve-\" and should be cyan\n    CellTypeConfig(\n        name=\"cq+eve-\",\n        color=\"c\"\n    ),\n    # The first cell type is called \"cq-eve+\" and should be red\n    CellTypeConfig(\n        name=\"cq-eve+\",\n        color=\"r\"\n    ),\n]\n# Launch the plugin with configuration\nviewer.window.add_dock_widget(Count3D(viewer, cell_type_config=cell_type_config))\n```\n\n*Usage example can be found in /example/launch_count_3d.py*\n\n##  Auxiliary plugins\n\n\n### Ingress Points\n\n![Ingress Points](https://github.com/user-attachments/assets/2b0dc92b-ae14-40e0-8670-0d99f36b3468)\n\nThis plugin takes a points layer and adds the points to the selected cell type\nlayer. This can be useful if you want to manually count cells after cell identification.\n\n*Usage example can be found in /example/launch_ingress_points.py*\n\n### Split on Shapes\n\n![Split on Shapes](https://github.com/user-attachments/assets/0d3c12fc-1347-4226-a9b9-9e34dd50577a)\n\nThis plugin can be used to subset a cell type into several groups based on\ntheir x-y location. Simply draw a shape that surrounds your cells (perhaps in a\nsegment of segmentaly repeating tissue) and run this plugin to get a list of\ncells of each type in each shape.\n\n*Usage example can be found in /example/launch_split_on_shapes.py*\n\n### Reconstruct Selected\n\n![Reconstruct Selected](https://github.com/user-attachments/assets/2f629b5a-d976-4add-8c5b-af4fc7e45729)\n\nOne use case of Napari 3D Counter is to visualize a subset of labeled cells.\nFor example, automated process label your cells of interest as well as a set of\noff-target cells, and you would like to visualize only your cells of interest.\nThis can be accomplished by using Napari 3D Counter to count your cells of\ninterest, and some other process to create labels (perhaps\n[nsbatwm](https://github.com/haesleinhuepf/napari-segment-blobs-and-things-with-membranes))\nand using Reconstruct Selected to create a new image layer of those labels\nwhich have been counted as a particular cell type.\n\n*Usage example can be found in /example/launch_reconstruct_selected.py*\n\n## Contributing\n\nContributions are very welcome. However, code written by LLMs is not welcome.\nTests can be run with [tox](https://tox.wiki/en/latest/), please ensure the coverage at least stays the same before you submit a pull request.\n\nTo contribute, first fork and clone the repository on GitHub: \n(GitHub docs)[https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo]\n\n\nThen install localy:\n\n    cd napari-3d-counter\n    pip install -e '.[testing]'\n\nRun unit tests:\n\n    pytest\n\nRun full test suite, ensuring it installs properly:\n\n    tox\n\n\n## License\n\nDistributed under the terms of the [GNU GPL v3.0](http://www.gnu.org/licenses/gpl-3.0.txt) license,\n\"napari-3d-counter\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue](https://github.com/pnewstein/napari-3d-counter/issues) along with a detailed description.\n","description_content_type":"text/markdown","keywords":null,"home_page":"https://github.com/pnewstein/napari-3d-counter","download_url":null,"author":"Peter Newstein","author_email":"peternewstein@gmail.com","maintainer":null,"maintainer_email":null,"license":"GPL-3.0-or-later","classifier":["Development Status :: 4 - Beta","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: GNU General Public License v3 (GPLv3)","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":["numpy","qtpy","pandas","scikit-image","napari==0.7.*","tox; extra == \"testing\"","pytest; extra == \"testing\"","pytest-cov; extra == \"testing\"","pytest-qt; extra == \"testing\"","pyqt5; extra == \"testing\""],"requires_python":">=3.10","requires_external":null,"project_url":["Bug Tracker, https://github.com/pnewstein/napari-3d-counter/issues","Documentation, http://localhost:8001/napari-3d-counter.html","Source Code, https://github.com/pnewstein/napari-3d-counter","User Support, https://github.com/pnewstein/napari-3d-counter/issues"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}