Skip to content

Commit

Permalink
update documentation detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Henley13 committed Jul 13, 2021
1 parent 31af14c commit cfbc90e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 32 deletions.
3 changes: 2 additions & 1 deletion bigfish/detection/snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ def compute_snr_spots(image, spots, voxel_size_z=None, voxel_size_yx=100,
psf_yx : int or float
Theoretical size of the PSF emitted by a spot in the yx plan, in
nanometer.
Returns
-------
snr : float
Median Signal-to-Noise ratio computed for every spots.
Median signal-to-noise ratio computed for every spots.
"""
# check parameters
Expand Down
13 changes: 6 additions & 7 deletions bigfish/detection/spot_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ def local_maximum_detection(image, min_distance):
local maximum is not unique.
In order to make the detection robust, it should be applied to a
filtered image (using :func:`log_filter()<bigfish.stack.filter.log_filter>`
for example).
filtered image (using :func:`bigfish.stack.log_filter` for example).
Parameters
----------
Expand Down Expand Up @@ -321,7 +320,7 @@ def spots_thresholding(image, mask_local_max, threshold,
"""Filter detected spots and get coordinates of the remaining spots.
In order to make the thresholding robust, it should be applied to a
filtered image (using :func:`log_filter()<bigfish.stack.filter.log_filter>`
filtered image (using :func:`bigfish.stack.log_filter`
for example). If the local maximum is not unique (it can happen if connected
pixels have the same value), a connected component algorithm is applied to
keep only one coordinate per spot.
Expand Down Expand Up @@ -407,10 +406,10 @@ def automated_threshold_setting(image, mask_local_max):
"""Automatically set the optimal threshold to detect spots.
In order to make the thresholding robust, it should be applied to a
filtered image (using :func:`log_filter()<bigfish.stack.filter.log_filter>`
for example). The optimal threshold is selected based on the spots
distribution. The latter should have an elbow curve discriminating a fast
decreasing stage from a more stable one (a plateau).
filtered image (using :func:`bigfish.stack.log_filter` for example). The
optimal threshold is selected based on the spots distribution. The latter
should have an elbow curve discriminating a fast decreasing stage from a
more stable one (a plateau).
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/detection/cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Cluster detection
************************

.. currentmodule:: bigfish.detection.cluster_detection
.. currentmodule:: bigfish.detection

Function to cluster spots in point cloud and detect relevant aggregated
structures. A DBSCAN algorithm is performed.
Expand Down
24 changes: 11 additions & 13 deletions docs/source/detection/dense.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
Dense regions decomposition
***************************

.. currentmodule:: bigfish.detection

Functions to detect dense and bright regions (with potential clustered spots),
then use gaussian simulations to correct a misdetection in these regions.

Decompose and simulate dense regions
====================================

.. currentmodule:: bigfish.detection.dense_decomposition

The main function to decompose dense regions is:

* :func:`bigfish.detection.decompose_dense<decompose_dense>`
* :func:`bigfish.detection.decompose_dense`

It is also possible to perform the main steps of this decomposition separately:

* :func:`bigfish.detection.get_dense_region<get_dense_region>`
* :func:`bigfish.detection.simulate_gaussian_mixture<simulate_gaussian_mixture>`
* :func:`bigfish.detection.get_dense_region`
* :func:`bigfish.detection.simulate_gaussian_mixture`

See an example of application `here <https://github.com/fish-quant/big-fish-
examples/blob/master/notebooks/5%20-%20Detect%20spots.ipynb/>`_.
Expand All @@ -32,24 +32,22 @@ examples/blob/master/notebooks/5%20-%20Detect%20spots.ipynb/>`_.
Modelize a reference spot
=========================

.. currentmodule:: bigfish.detection.spot_modeling

To simulate additional spots in the dense regions it is necessary to:

#. Build a reference spot.

* :func:`bigfish.detection.build_reference_spot<build_reference_spot>`
* :func:`bigfish.detection.build_reference_spot`

#. Modelize this reference spot by fitting gaussian parameters.

* :func:`bigfish.detection.modelize_spot<modelize_spot>`
* :func:`bigfish.detection.modelize_spot`

#. Simulate gaussian signal.

* :func:`bigfish.detection.precompute_erf<precompute_erf>`
* :func:`bigfish.detection.initialize_grid<initialize_grid>`
* :func:`bigfish.detection.gaussian_2d<gaussian_2d>`
* :func:`bigfish.detection.gaussian_3d<gaussian_3d>`
* :func:`bigfish.detection.precompute_erf`
* :func:`bigfish.detection.initialize_grid`
* :func:`bigfish.detection.gaussian_2d`
* :func:`bigfish.detection.gaussian_3d`

.. autofunction:: build_reference_spot
.. autofunction:: modelize_spot
Expand Down
16 changes: 7 additions & 9 deletions docs/source/detection/spots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Automated spot detection
************************

.. currentmodule:: bigfish.detection.spot_detection
.. currentmodule:: bigfish.detection

Functions used to detect spots in a 2D or 3D image. Detection is performed in
three steps:
Expand All @@ -20,12 +20,12 @@ Detect spots

The main function for spot detection is:

* :func:`bigfish.detection.detect_spots<detect_spots>`
* :func:`bigfish.detection.detect_spots`

It is also possible to perform the main steps of the spot detection separately:

* :func:`bigfish.detection.local_maximum_detection<local_maximum_detection>`
* :func:`bigfish.detection.spots_thresholding<spots_thresholding>`
* :func:`bigfish.detection.local_maximum_detection`
* :func:`bigfish.detection.spots_thresholding`

See an example of application `here <https://github.com/fish-quant/big-fish-
examples/blob/master/notebooks/5%20-%20Detect%20spots.ipynb/>`_.
Expand All @@ -43,8 +43,8 @@ The need to set an appropriate threshold for each image is a real bottleneck
that limits the possibility to scale a spot detection. Our method includes a
heuristic function to to automatically set this threshold:

* :func:`bigfish.detection.automated_threshold_setting<automated_threshold_setting>`
* :func:`bigfish.detection.get_elbow_values<get_elbow_values>`
* :func:`bigfish.detection.automated_threshold_setting`
* :func:`bigfish.detection.get_elbow_values`

.. autofunction:: automated_threshold_setting
.. autofunction:: get_elbow_values
Expand All @@ -54,10 +54,8 @@ heuristic function to to automatically set this threshold:
Compute signal-to-noise ratio
=============================

.. currentmodule:: bigfish.detection.snr

Compute a signal-to-noise ratio (SNR) for the image:

* :func:`bigfish.detection.compute_snr_spots<compute_snr_spots>`
* :func:`bigfish.detection.compute_snr_spots`

.. autofunction:: compute_snr_spots
2 changes: 1 addition & 1 deletion docs/source/detection/subpixel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Subpixel fitting
****************

.. currentmodule:: bigfish.detection.spot_modeling
.. currentmodule:: bigfish.detection

Function to detect individual spot coordinate with a subpixel accuracy,
fitting a gaussian signal.
Expand Down

0 comments on commit cfbc90e

Please sign in to comment.