Edit video

Edit video is the second panel of module Video processing. Access the panel content by pressing Bottom arrow. The panel closes automatically after other panels open or after pressing Top arrow.

Use this panel to apply image filters or correct the single molecule video and to export the video to various file formats.

Panel components

  1. Image filters
  2. Export video

Image filters

Use this interface to apply one or several image filters to the loaded video or image.

Image filters treat video channels separately and uses zero to two parameters. To configure a filter, select first the channel in list (c), then the image filter in list (a) and set filter parameters in (d) and (e).

A detailed description of each filter is given in Filters and references to the scientific literature are given in References.

Filters can be applied to the current video frame only or to all video frames by deactivating or activating the option in (b).

After configuration, the filter can be applied to the loaded video or image by pressing Add.

All filters used on the video or image are listed in the Filter list (f) and can be removed by pressing Remove filter.

Filters

filter description default p1 default p2
Gaussian filter Pixels are convolved with a Gaussian function with p1 the size of the kernel and p2 the Gaussian standard deviation. 3 none
mean filter Pixels are convolved with a rectangle function with p1 the size of the kernel. 3 none
median filter Pixels are replaced by the median value of the p1 neighbouring pixels. 3 none
Crocker-Grier filter1 Mean-filtered pixels are subtracted to Gaussian filtered-pixels, using p1 as the kernel size and p2 as the Gaussian standard deviation 3 1
local Wiener filter The estimated noise intensity per pixel p2 is subtracted to the p1-by-p1 neighbouring pixel area. If p2=0, the noise intensity is calculated as 10% of the maximum intensity in the p1-by-p1 neighbouring pixel area 3 200
global Wiener filter The estimated noise intensity per pixel p2 is subtracted to all pixels in the image. If p2=0, the noise intensity is calculated as 10% of the maximum intensity in the image 200 none
outlier filter Identifies bright spots from the mean and standard deviation of the intensity distribution in the p1-by-p1 neighbouring pixels, with a confidence level p2. Pixels that does not belong to the p1-by-p1 area are set to 0. 3 0.99
histothresh filter Pixels that have an intensity lower than p1% of the pixels in the image are set to 0 0.5 none
simplethresh filter Pixels that have an intensity lower than p1 are set to 0 1500 none
mean value Background correction: the estimated background intensity IBG is subtracted to all pixels with IBG=Ihigh+p1xHWHMhigh.
Ihigh and HWHMhigh are the mean and the half-width at half-maximum of the distribution of high intensities.
High intensities are intensities higher than Imean+p1xσI, with Imean and σI being the mean value and standard deviation of the intensity distribution in the image.
0 none
most frequent Background correction: the estimated background intensity IBG is subtracted to all pixels with IBG=Imost+p1xHWHMmost.
Imost is the most frequent value in the image considering a binning interval (Imax-Imin)/p2, and HWHM*most is the half-width at half maximum of the intensity distribution in the image.
0 50
histothresh Background correction: the estimated background intensity IBG is subtracted to all pixels with IBG=I2+p1xHWHM2.
I2 is the intensity corresponding to a probability p2 in the cumulative distribution of intensities in the image.
none 0.5
Ha average 2 Background correction: the video is averaged into one image which is then resized to square-rooted dimensions by averaging pixel values. The background image is then resized to original video dimensions and is subtracted to each video frame. none none
Ha framewise 2 Background correction: each video frame is resized to square-rooted dimensions by averaging pixel values. The background image is then resized to original video dimensions and is subtracted to the original video frame. none none
Twotone 3 Mean-filtered pixels are subtracted to Gaussian-filtered pixels, using p1 as the kernel size and a Gaussian standard deviation of 1 pixel. 3 1
subtract image Background correction: a background image is loaded from an external file and is subtracted to each video frame. none none
multiplication Pixel values are multiplied by a factor p1. 1 none
addition An constant intensity p2 is added to each pixel value. 0 none

Filters Gaussian filter, mean filter, median filter, Crocker-Grier filter, local Wiener filter, global Wiener filter, outlier filter, histothresh filter and simmplethresh filter were written and generously shared by Dr Mario Heidernätsch from the Institute of Physics, Chemnitz University of Technology. These filters were written in C and were compiled to .mex files via the mex function of MATLAB. The .mex files may work with certain MATLAB versions and lead to errors with others.

If the use of one of these filters gives an error, please recompile the .mex files by following the instructions from file:

MASH-FRET/source/extern/README-MEX-FILES.txt

If the error persists, please inform us via the issue tracker on Github.

Filter list

Use this list to visualize or cancel filters applied to the current frame, with the top-filter being applied first.

To cancel a filter, select the corresponding name in the list and press Remove filter.

References

  1. J.C. Crocker, D.G. Grier, Methods of Digital Video Microscopy for Colloidal Studies, J. Colloid Interface Sci. 1996, DOI: 10.1006/jcis.1996.0217
  2. P.R. Selvin, T. Ha, Single molecule Techniques: A Laboratory Manual, Cold Spring Harbor laboratory Press 2008, ISBN: 978-087969775-4.
  3. A.N. Kapanidis, N.K. Lee, T.A. Laurence, S. Doose, E.Margeat, S. Weiss, Defining the Limits of Single-Molecule FRET Resolution in TIRF Microscopy, Proc. Nat. Acad. Sci. 2004, DOI: 10.1016/j.bpj.2010.09.005

Export video

Use this area to export a particular frame range of the filtered video to a file.

Even though background correction is more accurate when performed in module Trace processing, some image filters can be used as background correction in Video processing; see Filters for more information. To do so, the background-corrected video must be exported to a file and the current project abadonned. A new video-based project must be created using the new video file in order to generate background-corrected intensity-time traces. In this specific case, background correction must be deactivated later in module Trace processing; see Background correction for more information.

In any case, it is recommended to export the videos (filtered or not) in the MASH video format prior analysis as processes and calculations will eventually be quickened.

Moreover, sometimes, the frame range of a video needs to be re-adjusted, because of partial failure in recording, or simply to export light animated GIF files for illustration. To do so, set the starting frame index in (a) , the ending frame index in (b) and the frame interval in (c) and press Export... to export the video or image to a file.

The exported image/video will be truncated according to the frame range and modified according to the filters in the Filter list.

Supported file formats are:

  • MASH video format (.sira)
  • Tagged Image File format (.tif)
  • Graphics Interchange Format (.gif)
  • MATLAB binary file (.mat)
  • Audio Video Interleave (.avi)
  • Portable Network Graphics (.png)

File formats .avi and .gif can be used to export animated illustration but not for further analysis as the data accuracy and coherence between frames are lost during the writing process.

To programmatically add new video formats, update the following function in the source code:

MASH-FRET/source/mod_video_processing/graphic_files/exportMovie.m