Skip to main content

Small Particle Detection, a shapes library-based object detector.

Project description

SPADE: Small PArticle DEtection

http://www-sop.inria.fr/morpheme/images/logo2.png

An algorithm primarily design to detect objects whose sizes aren’t larger a few pixels (particles) on fluorescence microscopy images.

It is an simplified version of marked point process.

Requirements

SPADE has only been tested with Python 3.5 but should work with older versions. The only strict requirement is the package numpy. In order to use SPADE to its full extent, we recommend installing the scikit-image package and the full scipy ecosystem.

Usage

In a python script

You can install the package using PIP. The main function, spade2d, is in the spade.detection_2d module. It takes an image, a shapes library and a threshold as input. A typical usage would look like like

from skimage.io import imread, imshow
from skimage.filters import threshold_otsu
from skimage.color import label2rgb
from numpy import percentile
import matplotlib.pyplot as plt

from spade.detection_2d import spade2d
from spade.shapes.library import potatoids_5x5__smallest_4_pix


# Load the example image.
image = imread("example_2d.png")

# Separate cell image from background, using by Otsu's thresholding method.
cell = image > threshold_otsu(image)

# Focus on brightest pixels only
potential_centers = image > percentile(image[cell], 99)

# Detect particles.
particles = spade2d(image=image,
                    shapes_library=potatoids_5x5__smallest_4_pix,
                    threshold=20,
                    potential_centers=potential_centers,
                    mask=cell)

# Show detected particles as overlay on our original image.
imshow(label2rgb(particles, image, bg_label=0))
plt.show()

See the examples in the example folder of the source dist for more information. Note that matplotlib and skimage are not required for SPADE to work.

From the command line

Also provided is a command line interface, that can be used as following:

python -m spade.cli INPUT_IMAGE THRESHOLD -o /path/to/output_image.png

Launch this command with -h for more information on its usage.

Authors & Acknowledgments

SPADE was developed by Nicolas Cedilnik, Éric Debreuve and Xavier Descombes at the MORPHEME team.

If you use SPADE for your scientific work, please include this bibtex (or equivalent) entry:

@misc{cedilnik2016spade,
  title={SPADE: Small particle detection}
  author={Cedilnik, Nicolas and Debreuve, Éric and Descombes, Xavier}
  url={https://pypi.python.org/pypi/small-particle-detection}
  year={2016}
}

License

SPADE is released under the CeCILL-2.1 licence.

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

small-particle-detection-0.0.1a11.tar.gz (90.1 kB view details)

Uploaded Source

File details

Details for the file small-particle-detection-0.0.1a11.tar.gz.

File metadata

File hashes

Hashes for small-particle-detection-0.0.1a11.tar.gz
Algorithm Hash digest
SHA256 e0cf4ceb54dc512bbaa38f2e6b85ed13e2c030fbfb111ebb27c1eb2faa9ad2b3
MD5 194a4ca31af73a7a74799092a7cb9b3c
BLAKE2b-256 bcec45fb65f376b7315cc1c357370c4f23f96e05bfba79c6fbf0403d609a5eef

See more details on using hashes here.

Supported by

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