2D

Description

Maxima finding algorithm implemented in Python recreated from implementation in Fiji(ImageJ)

This is a re-implementation of the java plugin written by Michael Schmid and Wayne Rasband for ImageJ. The original java code source can be found in: https://imagej.nih.gov/ij/developer/source/ij/plugin/filter/MaximumFinder.java.html 

This implementation remains faithful to the original implementation but is not 100% optimised. The java version is faster but this could be alleviated by compiling c code for parts of the code. This script is simply to provide the functionality of the ImageJ find maxima algorithm to individuals writing pure python script.

The algorithm works as follows:

The first stage in the maxima finding algorithm is to find the local maxima. This involves processing the image with a 3x3 neighbourhood maximum filter. Once filtered this image is compared back to the original, where the pixels are the same value represents the locations of the local maxima. Typically there are far too many local maxima to be meaningful so the goal is then to merge and prune this maxima using some kind of measure of quality. In the case of algorithm a single parameter is used, the noise tolerance (Prominence). If a maxima is close to another then the maxima will be merged or removed based on the below criteria.

Starting with the brightest maxima and working down the intensities:

  • Expand out (‘flood fill’) from each maxima location. Neighbouring pixels within a noise tolerance (notl) of the maxima are scanned until the region within tolerance is exhausted.
    • If the pixels are equal to the maxima, mark this as equal.
    • If a greater maxima is met, ignore the active maxima.
    • If the pixels are less than maxima, but greater than maxima minus the noise tolerance, mark as listed.
    • Mark all ‘listed’ pixels 'processed' if they are included within a valid peak region, otherwise reset them.
    • From the regions containing a peak, calculate the best pixel to be considered as maxima based on minimum distance calculation with all those maxima considered equal.
       

For a video detailing how this algorithm works please see:

https://youtu.be/f9vXOMKOlaY

Or for examples of it being used in practise, please see:

https://youtu.be/9wvPsEzRWzI

 

find maxima comparison.
Description

This script includes a rough feature detection and then fine 2D Gaussian algorithm to fit Gaussians within detected regions. This macro is unique because the ImageJ/Fiji curve fitting API only supports 1-D curve. I get around this by linearising the equation. This implementation is for isotropic (spherical) or anistropic (longer in x/y) diagonally covariant Gaussians but not fully covariant Gaussians (anisotropic and rotated). 

Description

SIMPLETRACKER a simple particle tracking algorithm that can deal with gaps.

Tracking , or particle linking, consist in re-building the trajectories of one or several particles as they move along time. Their position is reported at each frame, but their identity is yet unknown: we do not know what particle in one frame corresponding to a particle in the previous frame. Tracking algorithms aim at providing a solution for this problem. 

simpletracker.m is - as the name says - a simple implementation of a tracking algorithm, that can deal with gaps. A gap happens when one particle that was detected in one frame is not detected in the subsequent one. If not dealt with, this generates a track break, or a gap, in the frame where the particle disappear, and a false new track in the frame where it re-appear. 

need a thumbnail
Description

Mean square displacement (MSD) analysis is a technique commonly used in colloidal studies and biophysics to determine what is the mode of displacement of particles followed over time. In particular, it can help determine whether the particle is:

  • freely diffusing;
  • transported;
  • bound and limited in its movement.

On top of this, it can also derive an estimate of the parameters of the movement, such as the diffusion coefficient.

@msdanalyzer is a MATLAB per-value class that helps performing this kind of analysis. The user provides several trajectories he measured, and the class can derive meaningful quantities for the determination of the movement modality, assuming that all particles follow the same movement model and sample the same environment.

has function
Examples of tracks to perform MSD analysis.