{"name":"smo","display_name":"smo","visibility":"public","icon":"","categories":[],"schema_version":"0.2.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"smo.napari_experimental_provide_function","title":"smo_image","python_name":"smo.plugins.napari:napari_experimental_provide_function","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"smo.napari_experimental_provide_function","title":"smo_probability","python_name":"smo.plugins.napari:napari_experimental_provide_function","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"smo.napari_experimental_provide_function","title":"background_correction","python_name":"smo.plugins.napari:napari_experimental_provide_function","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"smo.napari_experimental_provide_function","title":"background_probability","python_name":"smo.plugins.napari:napari_experimental_provide_function","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"smo.napari_experimental_provide_function","display_name":"smo_image","autogenerate":true},{"command":"smo.napari_experimental_provide_function","display_name":"smo_probability","autogenerate":true},{"command":"smo.napari_experimental_provide_function","display_name":"background_correction","autogenerate":true},{"command":"smo.napari_experimental_provide_function","display_name":"background_probability","autogenerate":true}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"smo","version":"2.0.2","dynamic":null,"platform":null,"supported_platform":null,"summary":"Implementation of the Silver Mountain Operator (SMO) for the estimation of background distributions.","description":"![PyPi](https://img.shields.io/pypi/pyversions/smo.svg)\n[![License](https://img.shields.io/github/license/maurosilber/smo)](https://opensource.org/licenses/MIT)\n[![PyPi](https://img.shields.io/pypi/v/smo.svg)](https://pypi.python.org/pypi/smo)\n[![Conda](https://img.shields.io/conda/pn/conda-forge/smo)](https://anaconda.org/conda-forge/smo)\n\n# SMO\n\nSMO is a Python package that implements the Silver Mountain Operator (SMO), which allows to recover an unbiased estimation of the background intensity distribution in a robust way.\n\nWe provide an easy to use Python package and plugins for some of the major image processing softwares: [napari](https://napari.org), [CellProfiler](https://cellprofiler.org), and [ImageJ](https://imagej.net) / [FIJI](https://fiji.sc). See Plugins section below.\n\n## Citation\n\nTo learn more about the theory behind SMO, you can read the [pre-print in BioRxiv](https://doi.org/10.1101/2021.11.09.467975).\n\nIf you use this software, please cite that pre-print.\n\n## Usage\n\nTo obtain a background-corrected image, it is as straightforward as:\n\n```python\nimport skimage.data\nfrom smo import SMO\n\nimage = skimage.data.human_mitosis()\nsmo = SMO(sigma=0, size=7, shape=(1024, 1024))\nbackground_corrected_image = smo.bg_corrected(image)\n```\n\nwhere we used a sample image from `scikit-image`.\nBy default,\nthe background correction subtracts the median value of the background distribution.\nNote that the background regions will end up with negative values,\nbut with a median value of 0.\n\nA notebook explaining in more detail the meaning of the parameters and other possible uses for SMO is available here: [smo/examples/usage.ipynb](https://github.com/maurosilber/SMO/blob/main/smo/examples/usage.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/maurosilber/SMO/blob/main/smo/examples/usage.ipynb).\n\n## Installation\n\nIt can be installed with `pip` from PyPI:\n\n```\npip install smo\n```\n\nor with `conda` from the conda-forge channel:\n\n```\nconda install -c conda-forge smo\n```\n\n## Plugins\n### Napari\n\nA [napari](https://napari.org) plugin is available.\n\nTo install:\n\n- Option 1: in napari, go to `Plugins > Install/Uninstall Plugins...` in the top menu, search for `smo` and click on the install button.\n\n- Option 2: just `pip` install this package in the napari environment.\n\nIt will appear in the `Plugins` menu.\n\n### CellProfiler\n\nA [CellProfiler](https://cellprofiler.org) plugin in available in the [smo/plugins/cellprofiler](smo/plugins/cellprofiler) folder.\n\n![](images/CellProfiler_SMO.png)\n\nTo install, save [this file](https://raw.githubusercontent.com/maurosilber/SMO/main/smo/plugins/cellprofiler/smo.py) into your CellProfiler plugins folder. You can find (or change) the location of your plugins directory in `File > Preferences > CellProfiler plugins directory`.\n\n### ImageJ / FIJI\n\nAn [ImageJ](https://imagej.net) / [FIJI](https://fiji.sc) plugin is available in the [smo/plugins/imagej](smo/plugins/imagej) folder.\n\n![](images/ImageJ_SMO.png)\n\nTo install, download [this file](https://raw.githubusercontent.com/maurosilber/SMO/main/smo/plugins/imagej/smo.py) and:\n\n- Option 1: in the ImageJ main window, click on `Plugins > Install... (Ctrl+Shift+M)`, which opens a file chooser dialog. Browse and select the downloaded file. It will prompt to restart ImageJ for changes to take effect.\n\n- Option 2: copy into your ImageJ plugins folder (`File > Show Folder > Plugins`).\n\nTo use the plugin, type `smo` on the bottom right search box:\n\n![](images/ImageJ_MainWindow.png)\n\nselect `smo` in the `Quick Search` window and click on the `Run` button.\n\n![](images/ImageJ_QuickSearch.png)\n\nNote: the ImageJ plugin does not check that saturated pixels are properly excluded.\n\n## Development\n\nCode style is enforced via pre-commit hooks. To set up a development environment, clone the repository, optionally create a virtual environment, install the [dev] extras and the pre-commit hooks:\n\n```\ngit clone https://github.com/maurosilber/SMO\ncd SMO\nconda create -n smo python pip numpy scipy\npip install -e .[dev]\npre-commit install\n```\n","description_content_type":"text/markdown; charset=UTF-8; variant=GFM","keywords":"background,fluorescence,microscopy,imaging","home_page":"https://github.com/maurosilber/smo","download_url":null,"author":"Mauro Silberberg","author_email":"maurosilber@gmail.com","maintainer":null,"maintainer_email":null,"license":"MIT","classifier":["Intended Audience :: Science/Research","License :: OSI Approved :: MIT License","Operating System :: MacOS :: MacOS X","Operating System :: Microsoft :: Windows","Operating System :: POSIX","Programming Language :: Python","Programming Language :: Python :: 3.7","Programming Language :: Python :: 3.8","Programming Language :: Python :: 3.9","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Topic :: Scientific/Engineering","Framework :: napari"],"requires_dist":["numpy","scipy","typing-extensions ; python_version < \"3.9\"","pre-commit ; extra == 'dev'","pytest ; extra == 'dev'","tox ; extra == 'dev'"],"requires_python":null,"requires_external":null,"project_url":null,"provides_extra":["dev"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":true}