SPADE: Small PArticle DEtection
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.examples import potatoids5x5_smallest4px
# 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=potatoids5x5_smallest4px,
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.
License
SPADE is released under the CeCILL-2.1 licence.
Metadata
Release files for small-particle-detection 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| small-particle-detection-0.0.3.tar.gz | 91.2 kB | Without provenance | Details for small-particle-detection-0.0.3.tar.gz |
Release files / small-particle-detection-0.0.3.tar.gz
| Download URL | small-particle-detection-0.0.3.tar.gz |
|---|---|
| Size | 91.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71bb0b02a8c545a670bb38771d42e3c733279c11436146568d14f56cc8fe8de6
|
|
BLAKE2b-256 checksum How to use checksums |
21f75009872af3e7214686abdbf7b9676331c65d0a4d632543bb4a108d268cc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for small-particle-detection 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.