Image Analyst MKIIProtocols
HomeWorkflowImage Processing BasicsFunctions GlossaryPipelines GlossaryProtocolsQuick How ToSearch

Analyze Time Lapse Recordings with Image Analyst MKII

Video Tutorials

Publications using Image Analyst MKII

Try Image Analyst MKII for free

Download

Fine Tuning Optical Flow calculation

Parameters of the Optical Flow algorithm

The parametering of the Optical Flow function strictly follows the equations and algorithms published by Gerencser & Nicholls1. The table below refers to the paper.

Name Default Description
Select dx kernel: [Savitzky-Golay first derivative] Row kernel for differentiation in x. Kernel defined in Preferences or set parameters of the  Savitzky-Golay kernel below. To be used in Eq.2.
Select dy kernel: [Savitzky-Golay first derivative] Column kernel for differentiation in y. Kernel defined in Preferences or set parameters of the  Savitzky-Golay kernel below. To be used in Eq.2.
Select dt kernel: [1,-1] Column kernel for differentiation in t. Kernel defined in Preferences. Use the [1,-1] preset or set parameters of the  Savitzky-Golay kernel below. To be used in Eq.2.
Average OF for dt width Yes Calculate OF using spatial derivatives of each frame, and then the average, to prevent biasing by leading and trailing edges. This is demonstrated by Fig.4.
Block mode No See block mode here.
SG kernel for dx,dy width 3 Width of spatial Savitzky-Golay 1st derivative kernel. Applied only if [Savitzky-Golay first derivative] is selected above. This was optimized in the paper (Fig.3).
SG kernel for dx,dy order 2 Order of spatial Savitzky-Golay 1st derivative kernel
SG kernel for smooth width 7 Width of smooth Savitzky-Golay 0th derivative kernel. Applied only if [Savitzky-Golay first derivative] is selected above. This was optimized in the paper (Fig.3).
SG kernel for smooth order 2 Order of smooth Savitzky-Golay 0th derivative kernel
SG kernel for dt width 3 Width of temporal Savitzky-Golay 1st derivative kernel. Applied only if [Savitzky-Golay first derivative] is selected above. The [1,-1] kernel was found to be ideal, so this parameter is not applied normally.
SG kernel for dt order 2 Order of temporal Savitzky-Golay 1st derivative kernel
Aperture kernel size 5 Aperture kernel is a matrix of ones. See Eq.3.
Aperture kernel shape Box Box or Disc. The paper used Box kernel.
Correct for bias by noise Yes Performs masking with Eq.6.
Correct low noisy gradients in time Yes Performs masking with Eq.5.
Enforce constraints on gradients in space Yes Performs masking with Eq.7 & 8.
Variance factor for time constraint 1.5 k-value defied in Eq.9. to be used in Eq.5.
Variance factor for bias 1.5 k-value defied in Eq.9. to be used in Eq.6.
Variance factor for constraint 1 4 k-value defied in Eq.9. to be used in Eq.7.
Variance factor for constraint 2 0.45 k-value defied in Eq.9. to be used in Eq.8.
Detector offset equipment specific Intensity measured in darkness, see "Sensor Noise Characteristics"
Detector variance vs. intensity Slope equipment specific Slope of noise diagram, see "Sensor Noise Characteristics"
Detector Read out Variance equipment specific Variance measured in darkness, see "Sensor Noise Characteristics"
Pixel size 1 Results are multiplied with this value (typically mm/pixel) .
Output as Absolute value of vectors Yes Pixel intensities in the output image mean absolute mm/s (or pixel/s if the above value is 1)
Output as X and Y components of vectors No Pixel intensities in the output image mean ±mm/s (or pixel/s if the above value is 1)
Output as Absolute value of Projected Vectors No Results Radial - anterograde/retrograde velocity image. Needs a projection point ROI below.'
Projection ROI 1 Center point ROI for radial projection.

Changing/optimizing parameters of the Optical Flow algorithm

The above default parameters have been optimized for detection of motion of small (couple of pixels wide) objects/edges, the size that mitochondria typically show up in ~0.2-0.3 mm/pixel images. Parameters other than the equipment specific noise parameters, Pixel size and Block mode should be altered only with the understanding of the algorithm.

Setting up Optical Flow calculation for a given microscope / detector setting

The parameters below are calculated from the intensity-variance diagram calculated from evenly illuminated fields. Calculation and image acquisition with different image acquisition softwares are given in the following protocol pages: Elements, Metamorph, Zeiss LSM.
Noise parameters:

  • Detector offset
  • Detector variance vs. intensity
  • Slope Detector Read out Variance

The Pixel size is typically stored by the image acquisition software in the image file, and can be viewed by Image Analyst MKII by using the context menu Show Image Info of an Image Window, or the Tools/Setup DFT filter (this latter shows a default value if it was not recorded into the image file). Alternatively, for CCD cameras calculate the pixel size by dividing the physical pixel size by the lens magnification and by any other additional magnification (zoom or optovar, if present), and multiply by the binning.

The Block mode is always set to No, when calculating Optical Flow in the Multi-Dimensional Open dialog (When using LSM files in block mode, the Multi-Dimensionaldialog splits the blocks, so the Optical Flow calculation is not performed in block mode). When a complete time lapse is loaded first as non-processed, normal  Image Window, Optical Flow is calculated by the main menu Special/Optical Flow function, and the Block mode is set according to the organization of the data.

Using more than 2 frames for Optical Flow calculation

Recording of two frames is sufficient to determine velocity vectors. If Optical Flow is calculated more than 3, e.g  5 or 7 (considering only odd numbers) of images, the temporal derivatives can be more accurately determined. However due to increased phototoxicity this is not advised. The dynamic range of the Optical Flow is calculated for the time span of the acquisition of all frames. Thus to keep the same dynamic range, when the number of frames is increased the acquisition interval has to be reciprocally decreased.

To calculate Optical Flow from larger number of frames set:

  • Select dt kernel: [Savitzky-Golay first derivative]
  • SG kernel for dt width: the number of frames
  • Average OF for dt width: No if the number of frames is odd (should be odd)

During continuous acquisition of Optical Flow this is a viable option to set the dynamic range of the Optical Flow calculation to lower velocities. In block mode or Multi-Dimensionalacquisition increasing number of frames leads to unecessarily phototoxicity. However recording more frames enables to adjust the dynamic range during data analysis.

The number of frames recorded in each short time lapse has to match the value of Select dt kernel (when using [1,-1] kernel, it is automatically 2). If more frames were recorded, the frames to be passed for Optical Flow can be selected in the  Multi-Dimensional Open  depending on the actual way of short time lapse generation:

  • Specifying frames separated by commas in Settings/Load Specified frames only of each stack (for short time lapses recorded as zero-step z-stacks, see Metamorph)
  • Splitting blocks in block mode (see Zeiss LSM)
  • Selecting only the proper channels (see Elements ND2)

Working with different resolution or gradient/object size

Using larger spatial differentiation and smooth kernels when working in large, dull objects or less sharp edges increases the dynamic range. However it will lead to inaccurate velocity determination over sharp edges. See Fig.3. of the paper1.

Tuning masking

The default variance factors were determined on modeled data, not on a specific microscopy system, therefore are assumed to be universal. Larger variance factors provide stronger masking (the Optical Flow algorithm is more conservative, and only edges most distinguishable from noise are passed)

  • Variance factor for time constraint (k-value defied in Eq.9. to be used in Eq.5; to enable set Correct low noisy gradients in time: Yes ): Increase this value if measuring velocity over stationary objects e.g. fixed cells or beads (that do not perform Brownian motion). Decrease this value is the algorithm clips low velocities to zero
  •  Variance factor for bias (k-value defied in Eq.9. to be used in Eq.6; to enable set Correct for bias by noise: Yes ): This value shouldn't be changed. Tuning this value requires a calibration image sequence showing moving objects with a range known velocities.
  •  Variance factor for constraint (k-value defied in Eq.9. to be used in Eq.7; to enable set Enforce constraints on gradients in space: Yes  ): Set this value larger to suppress background, or smaller to allow processing of dimmer details.
  • Variance factor for constraint 2 (k-value defied in Eq.9. to be used in Eq.8; to enable set Enforce constraints on gradients in space: Yes ): Increase this value if objects like rods or spheres show smaller Optical Flow in their middle than at their edges. Decrease this value if middle of spheres or rods are overly masked.

References


1. Gerencser A. A. and Nicholls D. G. (2008) Measurement of Instantaneous Velocity Vectors of Organelle Transport: Mitochondrial Transport and Bioenergetics in Hippocampal Neurons. Biophys J. 2008 Sep 15;95(6):3079-99.