{"name":"spots-in-yeasts","display_name":"spots in yeasts","visibility":"public","icon":"","categories":[],"schema_version":"0.2.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"spots-in-yeasts.get_reader","title":"Open data with \"Spots in yeasts\"","python_name":"spots_in_yeasts._reader:napari_get_reader","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"spots-in-yeasts.spots_in_yeasts","title":"Spots In Yeasts","python_name":"spots_in_yeasts._widget:SpotsInYeastsDock","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":[{"command":"spots-in-yeasts.get_reader","filename_patterns":["*.ysc"],"accepts_directories":true}],"writers":null,"widgets":[{"command":"spots-in-yeasts.spots_in_yeasts","display_name":"Spots In Yeasts","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"spots-in-yeasts","version":"1.2.0","dynamic":null,"platform":null,"supported_platform":null,"summary":"A Napari plugin segmenting yeast cells and fluo spots to extract statistics.","description":"# spots-in-yeasts\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts/raw/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/spots-in-yeasts.svg?color=green)](https://pypi.org/project/spots-in-yeasts)\n[![Python Version](https://img.shields.io/pypi/pyversions/spots-in-yeasts.svg?color=green)](https://python.org)\n[![tests](https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts/workflows/tests/badge.svg)](https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts/actions)\n[![codecov](https://codecov.io/gh/MontpellierRessourcesImagerie/spots-in-yeasts/branch/master/graph/badge.svg)](https://codecov.io/gh/MontpellierRessourcesImagerie/spots-in-yeasts)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/spots-in-yeasts)](https://napari-hub.org/plugins/spots-in-yeasts)\n\nA Napari plugin segmenting yeast cells and fluo spots to extract statistics.\n\n----------------------------------\n\nThe skeleton on this [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.\n\n\n## Introduction\n\n> This Napari plugin's purpose is to extract statistics about fluo spots in yeast cells. We produce a segmentation of cells (based on the brightfield) and a segmentation of spots (based on the fluo channel). Then, we associate the measures to each cells.\n\nUnless you use the `NapariJ` plugin to open images, or the `cast_extension.ijm` script to cast files, you can only launch this plugin on `.tif` images.\n\nFor now, the code produces JSON files compiling the metrics such as:\n- The number of spots per cell.\n- The average intensity of a spot.\n- The area of each spot.\n- The location of each spot.\n\nWe provide `cast_extension.ijm` which is another script meant to be used in Fiji/ImageJ. It is able to convert `.nd` and `.czi` images into basic `.tif` images so you can open them in Napari.\n\nYou can process your images either in __one-shot__ _(image per image)_ or in __batch mode__ _(by providing the path to a folder)_. In case you used batch mode, a control image is created so you can quickly check whether your segmentation was correctly performed.\n\nRequired packages in your environment:\n- `napari`\n- `cellpose`\n- `numpy`\n- `skimage`\n- `termcolor`\n- `matplotlib`\n- `cv2`\n\n\n## Installation\n\nYou can install `spots-in-yeasts` via [pip]:\n\n pip install spots-in-yeasts\n\n\n\nTo install latest development version :\n\n pip install git+https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts.git\n\n\n## Example\n\n- Your images must have exactly two channels. The number of slices in each channel is totally up to you.\n- __First channel__: fluo spots, __second channel__: brightfield.\n- If you want to use the batch mode, you must use `.tif` images.\n\nThe two following images are the __brightfield__ and __fluo spots__ channels of the same image:\n\n![Brightfield](https://dev.mri.cnrs.fr/attachments/download/3017/bf.png)\n![Spots](https://dev.mri.cnrs.fr/attachments/download/3018/fluo.png)\n\nThe following images are the __cells labels__ and the __spots positions__:\n\n![Labeled cells](https://dev.mri.cnrs.fr/attachments/download/3016/cells.png)\n![Detected spots](https://dev.mri.cnrs.fr/attachments/download/3019/spots.png)\n\n## Usage\n\n### One-shot\n\n- Open Napari. Keep the terminal opened, it provides lots of information.\n- Before starting, make sure that no layer is currently open. You can clear your viewer with the `Clear layers` button.\n- Drag'n'drop your image into the Napari viewer. It should show up in the left column.\n- Click the `Split channels` button to separate the brightfield and the fluo on two different layers. Now, you should have two layers named \"brightfield\" and \"fluo-spots\".\n- To segment yeast cells, click the `Segment cells` button. The interface will certainly freeze during a few seconds (~10/30s). A new layer should appear, containing a value of intensity for each individual cell.\n- Click on the `Segment spots` button. This is a pretty fast operation. A new layer containing spots just appeared. Spots are represented as small white dots. You can change that in the layer's settings you struggle controling the result.\n- Finally, you can use the `Extract stats` button to create a JSON file. This file will automatically be opened in your default text editor, but it is a __temporary file__, which means that it is not saved anywhere and will get lost if you don't save it yourself.\n- Once you are done, you can press the `Clear layers` button again and pass to your next image, repeating the previous steps.\n\n### Batch mode\n\n- Before starting, you need a folder containing correctly formated `.tif` files.\n- Open Napari, and keep the terminal opened to see provided information.\n- Set the `input folder` field to your folder containing `.tif` images.\n- Set the `output folder` field to the path of a folder (preferably empty) that will receive the control images and the JSON files generated by the script.\n- You can click the `Run batch` button to launch the process.\n\n__Note:__ In batch mode, your viewer won't show anything. You must rely on the terminal's content and the progress bar to know what is going on. To open the progress bar in Napari, click on `activity` in the lower-right corner.\n\n## Messages:\n\n- `Export directory set to: /some/path/to/output`: Folder provided by the user to receive produced files (JSON, controls)\n- `===== Working on: d1-230421-11S_2 (1/32)====`: Name of the image currently processed and its rank. For example here, \"d1-230421-11S_2\" is being processed and it is the first image processed from a folder containing 32 images.\n- `Selected slices: (4, 8). (11 slices available)`: The script doesn't use all the slices in the image. Instead, it detects the most is-focus slice and takes N slices before and after it. In this example, 11 slices were available in the image. We are using the slices 4, 5, 6, 7, 8 for processing, so the most in-focus one is the 6th.\n- `Segmenting cells...`: Notification that the script started segmenting yeasts cells.\n- `Cells segmentation done. 219 cells found.`: End of cells segmentation. This message also provides you with the number of indiviual detected. This number is displayed before labels touching the borders are removed.\n- `Segmented cells from d1-230421-11S_2 in 10.0s.`: Operations are timed. This is just the time report of cells segmentation.\n- `Starting spots segmentation...`: Notification that the script started segmenting spots in the fluo channel.\n- `102 spots found .`: Number of spots detected during the segmentation.\n- `Segmented spots from d1-230421-11S_2 in 1.0s.`: Duration elapsed during spots segmentation.\n- `Spots exported to: /some/path/to/output/d1-230421-11S_2.json`: Path to the exported metrics.\n- `Focused slice too far from center!`: We don't use all the slices available. We detect the most in-focus one and take N slices before and after. This message means that there isn't N slices available after (or before) the most in-focus one. The process won't get interupted, but you want to be more careful about the segmentation of this image.\n- `The image d1-230421 BG- failed to be processed.`: A basic sanity check is applied to the results before they get exported to reduce the amount of manual checking to perform. This message simply means that either the cells segmentation, or the spots segmentation is so bad that this image will be skipped.\n- `========= DONE. (288.0s) =========`: Indicates that all the images contained in your folder were processed, the batch is over. The total amount of time if also displayed.\n\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 [MIT] license,\n\"spots-in-yeasts\" 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\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/MontpellierRessourcesImagerie/spots-in-yeasts/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/MontpellierRessourcesImagerie/spots-in-yeasts","download_url":null,"author":"Clément H. Benedetti","author_email":"clement.benedetti@mri.cnrs.fr","maintainer":null,"maintainer_email":null,"license":"MIT","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: MIT License","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.8","Programming Language :: Python :: 3.9","Programming Language :: Python :: 3.10","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["numpy","magicgui","magic-class","qtpy","opencv-python","matplotlib","termcolor","scikit-image","tifffile","cellpose","napari","tox ; extra == 'testing'","pytest ; extra == 'testing'","pytest-cov ; extra == 'testing'","pytest-qt ; extra == 'testing'","napari ; extra == 'testing'","pyqt5 ; extra == 'testing'"],"requires_python":">=3.8","requires_external":null,"project_url":["Bug Tracker, https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts/issues","Documentation, https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts#README.md","Source Code, https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts","User Support, https://github.com/MontpellierRessourcesImagerie/spots-in-yeasts/issues"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}