Skip to main content

Implementation of the Silver Mountain Operator (SMO) for the estimation of background distributions.

Project description


SMO 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.

We provide an easy to use Python package and plugins for some of the major image processing softwares: napari, CellProfiler, and ImageJ / FIJI. See Plugins section below.


To obtain a background-corrected image, it is as straightforward as:

from smo import SMO

image =
smo = SMO(sigma=0, size=7, shape=(1024, 1024))
background_corrected_image = smo.bg_corrected(image)

where we used a sample image from scikit-image.

A notebook explaining in more detail the meaning of the parameters and other possible uses for SMO is available here: smo/examples/usage.ipynb Open In Colab.


It can be installed with pip from PyPI:

pip install smo



A napari plugin is available.

To install:

  • Option 1: in napari, go to Plugins > Install/Uninstall Plugins... in the top menu, search for smo and click on the install button.

  • Option 2: just pip install this package in the napari environment.

It will appear in the Plugins menu.


A CellProfiler plugin in available in the smo/plugins/cellprofiler folder.

To install, save this file into your CellProfiler plugins folder. You can find (or change) the location of your plugins directory in File > Preferences > CellProfiler plugins directory.

ImageJ / FIJI

An ImageJ / FIJI plugin is available in the smo/plugins/imagej folder.

To install, download this file and:

  • 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.

  • Option 2: copy into your ImageJ plugins folder (File > Show Folder > Plugins).

To use the plugin, type smo on the bottom right search box:

select smo in the Quick Search window and click on the Run button.

Note: the ImageJ plugin does not check that saturated pixels are properly excluded.


Code 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:

git clone
cd SMO
conda create -n smo python pip numpy scipy
pip install -e .[dev]
pre-commit install

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smo-2.0.0.tar.gz (809.2 kB view hashes)

Uploaded Source

Built Distribution

smo-2.0.0-py2.py3-none-any.whl (701.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page