Skip to content
William Thielicke edited this page Apr 1, 2021 · 4 revisions

This document explains all files and functions that are part of PIVlab. The files are listed in alphabetical order.

accuracy.m

Test script for new users. Generates random artificial PIV images, analyzes them and compares the calculated velocity with the true velocity.

background_GUI.fig, .m

A GUI that can be used to calculate the average image from a series of images. This image is subtracted from each image, and the resulting image is stored.

dctn.m

From Damien Garcia: N-D discrete cosine transform. Used in smoothn.m.

ellipse.m

From D.G. Long: Adds ellipse to plot. Used in PIVlab to extract velocity data from an elliptic area.

exportfig.m

Exports figures. Used to export image formats from PIVlab.

f_readB16.m

From Carl Hall: Reads PCO b16 image format. Used to import b16 files in PIVlab.

fastLICFunction.m ,.c

From Nima Bigdely Shamlo, Matlab VFV Toolbox 1.0: Generates Line Integral Convolution visualization in PIVlab. The C-Code needs to be compiled for each Matlab installation (compilation runs automatically if a suitable compiler is installed in Matlab, e.g. the "MATLAB Support for MinGW-w64 C/C++ Compiler").

hsbmap.mat

Custom colormap data

icons.mat

Graphics for the zoom and pan icons

icons_quick.mat

Graphics for the Quick-Access toolbar

idctn.m

From Damien Garcia: N-D inverse discrete cosine transform. Used in smoothn.m.

inpaint_nans.m

From John D'Errico: Used to interpolate missing data. Better than nearest neighbor, linear or spline interpolation (see Williams Thesis).

mmstream2.m

From D.C. Hanselman: Draws 2D streamlines in PIVlab.

nanmax.m, namean.m, nanmin.m, nanstd.m

From Jan Gläscher (Hamburg meine Perle du wunderschöne Stadt): Maximum / minimum / mean / stdev of an array, ignoring nans. This was not possible in early Matlab releases, and at that time required the statistics toolbox.

parula.mat

Parula colormap, so users of early Matlab releases can also use this map.

piv_DCC.m

This funtion performs the direct cross correlation (DCC) PIV analysis. This was the first correlation algorithm implemented in PIVlab and it was based on Eize J. Stamhuis’ work on PIV software. Recent window-deformation methods perform better.

piv_FFTensemble.m

Modification of piv_FFTmulti. It allows ensemble correlation, but keeps the benefit of window deformation, repeated correlation etc. It is not written very efficiently, but it works ok.

piv_FFTmulti.m

Maybe the 2nd most important part of PIVlab: The window deformation cross-correlation. Also contains the peak-finding functions mentioned in the ensemble correlation modification. Result_conv is the correlation matrix for each sub-image. It is calculated for every interrogation area in every pass. Calculation is not running in a for loop, it has been vectorized by Sergey, a Junior Researcher at the ISSP RAS in 2016. The function also can do the repeated correlation, hinders auto-correlation and deforms images.

PIVlab_citing.m ,.fig

Displays a window with information on how to cite the software

PIVlab_commandline.m

Example script how to use PIVlab from the commandline. Settings in the variables "s" and "p" can be modified, and a mask and a region of interest can be specified. This script loads images, processes them, and saves the correlation result in a mat file.

PIVlab_GUI.m

The most important file in PIVlab. Contains the GUI and many functions for processing the data. It contains about 250 functions / callbacks, as PIVlab has a massive GUI. If I ever happen to acquire an extra life, I will document every single function – promised! Until then, you need to look at the code yourself. As always, I will help you understand the code if you have problems.

PIVlab_image_filter.m

Filters velocity vectors based on the local contrast and local brightness of the input images. This can help to exclude areas with low seeding, shadows or reflective objects automatically.

PIVlab_postproc.m

Post-processes vector map data that was generated in PIVlab. It contains a filter for velocity limits, a local median check and a stdev filter.

PIVlab_preproc.m

Preprocesses PIV images before analysis. It stretches the histogram (especially important with 16-bit images), performs intensity capping, performs contrast-limited adaptive histogram equalization (CLAHE), performs a spatial highpass, and a wiener2 denoise filter.

PIVlab_Quickview.m ,.fig

An additional GUI that is helpful when recording PIV images. It allows to quickly assess the suitability of camera and timing settings of the recorded images by displaying raw data, vectors, displacement histogram and correlation coefficients.

PIVlab_settings_default.m

Contains the default settings for all parameters in PIVlab. Will always be loaded at startup.

PIVlab_shortcuts.pdf

Contains a list of keyboard shortcuts for a faster workflow.

smoothn.m

From Damien Garcia: provides a fast, automatized and robust discretized smoothing spline for data of any dimension.

Testspeed.m

Performs cross-correlation, linear and spline interpolation, to test the processing speed of the current Matlab installation.

thirdparty.txt

Contains information on code that I used but did not program myself.

uipickfiles.m

From Douglas M. Schwarz: A modified version of the original code. Used to select data, display a preview and import it to PIVlab.

vid_import.m

An additional GUI that is used to import video files. Start / end frame and frame rate can be selected.