{"name":"cellpose-counter","display_name":"CellPose Counter","visibility":"public","icon":"","categories":["Annotation","Segmentation"],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"cellpose-counter.make_counter_widget","title":"Make Counter widget","python_name":"cellpose_counter:Counter","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"cellpose-counter.make_counter_widget","display_name":"Counter","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"cellpose-counter","version":"0.1.8","dynamic":null,"platform":null,"supported_platform":null,"summary":"Cell/nuclei counter using cellpose models","description":"# cellpose-counter\n\n[![License BSD-3](https://img.shields.io/pypi/l/cellpose-counter.svg?color=green)](https://github.com/szablowskilab/cellpose-counter/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/cellpose-counter.svg?color=green)](https://pypi.org/project/cellpose-counter)\n[![Python Version](https://img.shields.io/pypi/pyversions/cellpose-counter.svg?color=green)](https://python.org)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/cellpose-counter)](https://napari-hub.org/plugins/cellpose-counter)\n\nA Napari plugin for cell/nuclei counting from a region or interest using\ncellpose models.\n\n----------------------------------\n\n## Installation\n\nOption 1: via [pip](https://pip.pypa.io/en/stable/) (or pip alternatives like\n[uv](https://docs.astral.sh/uv/)):\n\nBelow is a minimally working example of setting up a new virtual environment and\ninstalling the counter module with uv on Unix based systems.\n\n```bash\nuv venv # create virtual environment in .venv\nsource .venv/bin/activate\n\nuv pip install \"napari[all]\" cellpose-counter\n```\n\nOption 2: via Docker/Podman. The provide [Dockerfile](./Dockerfile) can be used\nto install Napari and the counter plugin along with a preconfigured Xpra server\nusing the napari-xpra image. Below is an example of building the image and\nrunning the application with GPU support.\n\n```bash\npodman build -t cellpose-counter .\npodman run -it -d \\\n    -p 9876:9876 \\\n    -e XPRA_START=\"python3 -m napari -w cellpose-counter\" \\\n    --device nvidia.com/gpu=all\n```\n\nThen, navigate to `http://localhost:9876` to view the application in a virtual\nmachine.\n\nNote: There is a known issue installing the plugin directly from Napari. Please\nsee [this issue](https://github.com/szablowskilab/cellpose-counter/issues/12)\nfor more updates.\n\n## GPU Acceleration\n\nTo enable GPU acceleration, you will need a CUDA capable GPU along with the\n[CUDA toolkit](https://developer.nvidia.com/cuda-toolkit) and [cudNN library](https://developer.nvidia.com/cudnn).\n\nFor instructions on installing cuda toolkit and cudNN, see:\n\n1. [cuda toolkit installation for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#fedora)\n1. [cudNN installation for Linux](https://docs.nvidia.com/deeplearning/cudnn/latest/installation/linux.html)\n\nOnce these are installed, update the pytorch package by first uninstalling torch\n(if already instsalled).\n\n```bash\nuv pip uninstall torch\n```\n\nThen install a torch version that is compatible with your CUDA version. For example,\n\n```bash\nuv pip install torch --index-url https://download.pytorch.org/whl/cu118\n```\n\nAfter installation, you can verify in an interactive python console with:\n\n```python3\nimport torch\ntorch.cuda.is_available()\n```\n\n## Usage\n\nTo open Napari with the cellpose counter loaded, run `napari -w cellpose-counter`.\n\nA dock widget will be open on the right side of the Napari interface. There\nyou can view options for restoring images (using the cellpose denoise module),\nand counting cells/nuclei in a region of interest (ROI).\n\nA few important notes:\n\n1. Images in TIFF or CZI file formats may be used.\n1. Images must be grayscale or single channel. RGB images may be loaded, but\nshould be split. You can do this by right clicking on the image and select\n`split rgb` or `split stack`.\n1. ROIs can be drawn using the shape layer tools. Only a single ROI can be drawn\nper shape layer (otherwise only the first draw ROI will be used).\n1. ROIs should be square or rectangular. You can draw ROIs as polygons or other\nshapes, but a bounding box will be made from these shapes anyway.\n1. For long running processes such as image restoration or counting, it may seem\nlike Napari is not doing anything. Notifications are shown in the viewer to\ndisplay import information and a small activity indicator can be seen in the\nbottom right hand corner. If this indicator is spinning, then work is being done\neven if it doesn't look like it.\n1. In case of a large number of uncounted nuclei, consider modifying the\nsegmentation parameters, or use the `Continue Counting` option to re-run the\nsegmentation on uncounted nuclei.\n\n## Updating\n\n1. via Napari plugin manager. Select cellpose-counter plugin and update button.\n\n1. via pip (or uv, ..., etc.)\n\n```bash\nuv pip install cellpose-counter --upgrade\n```\n\n## Contributing\n\nAll contributions are welcome. Please submit an issue for feedback or bugs.\n\n## Citations\n\nThis plugin is built on top of the Cellpose segmentation and denoising models.\nIf you use this plugin, please cite the following paper:\n\n```bitex\n@article{stringer2021cellpose,\ntitle={Cellpose: a generalist algorithm for cellular segmentation},\nauthor={Stringer, Carsen and Wang, Tim and Michaelos, Michalis and Pachitariu, Marius},\njournal={Nature Methods},\nvolume={18},\nnumber={1},\npages={100--106},\nyear={2021},\npublisher={Nature Publishing Group}\n}\n```\n\n## License\n\n[BSD-3](./LICENSE)\n","description_content_type":"text/markdown","keywords":null,"home_page":null,"download_url":null,"author":"Nicolas Buitrago","author_email":"nsb5@rice.edu","maintainer":null,"maintainer_email":null,"license":"Copyright (c) 2024, Szablowski Lab\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 :: 4 - Beta","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":["numpy","magicgui","qtpy","scikit-image","napari[all]>=0.5.4","cellpose>=3.1.0","accelerate>=1.1.1","napari-czifile2>=0.2.7","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":null,"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}