Deriving spatial parameters / modifying data
Beyond raw velocity vectors, PIVlab can compute and display a range of derived flow quantities, smooth your data, and subtract a background flow — all without re-running the PIV analysis.
Open via Plot → Spatial: Derive parameters / modify data (Ctrl+D).
Choosing what to display
The Display Parameter dropdown selects what's shown as a colour-coded overlay on the vector plot:
| Parameter | Notes |
|---|---|
| Vectors | Raw velocity vectors (the default). |
| Vorticity | Local rotation of the flow. |
| Magnitude | Speed, regardless of direction. |
| u component / v component | Horizontal / vertical velocity only. |
| Divergence | Net outflow/inflow at each point. |
| Q criterion | A common vortex-identification measure. |
| Shear rate | Magnitude of the rate-of-strain tensor. |
| Simple strain rate | A simpler strain-rate estimate. |
| Line integral convolution (LIC) | A texture-based visualization of flow direction. Reveals streak-like structure; see the resolution slider below. |
| Vector direction | Angle in degrees. |
| Correlation coefficient | Quality of the underlying correlation. |
| Uncertainty | Only available if you enabled uncertainty estimation in PIV settings. |
Units shown in the dropdown adapt automatically: pixels/frame if uncalibrated, meters/frame if calibrated with a zero time step (displacements only), or meters/second once fully calibrated.
When Line integral convolution (LIC) is selected, a LIC resolution slider appears — higher values look more detailed but take longer to compute.
How each parameter is computed
This section gives the exact definition behind every entry in the dropdown, so you can check, cite or reproduce the numbers PIVlab reports.
Throughout, u and v are the velocity components along x and y, and u0 / v0 are the constant offsets you can enter under Subtract flow. The notation ∂u/∂y means “the rate at which u changes as you move in the y direction”.
Velocity-based quantities
These need no derivatives — they are computed point by point from the vectors themselves, and they are the only ones affected by Subtract flow.
Magnitude — the speed, i.e. the length of the velocity vector:
u component and v component are simply u − u0 and v − v0.
Vector direction — the angle of each vector, via
atan2d,
reported between −180° and +180°:
With PIVlab's default axis settings (x increases towards the right, y increases towards the bottom — the usual image convention) the angles line up like this:
| Angle | Direction on screen |
|---|---|
| 0° | → to the right |
| +90° | ↓ downwards |
| +180° / −180° | ← to the left |
| −90° | ↑ upwards |
So 0° points right, and angles increase clockwise as you see them on screen. If you set y increases towards the top in the calibration panel, the sign of v flips and angles then increase counter-clockwise instead, with +90° pointing up.
Gradient-based quantities
These are all built from the four spatial derivatives of the velocity field
(∂u/∂x, ∂u/∂y, ∂v/∂x,
∂v/∂y), evaluated with MATLAB's
gradient
(central differences inside the field, one-sided at the edges).
Vorticity — the local rate of rotation of the fluid, computed with
MATLAB's
curl:
PIVlab negates MATLAB's result, which sounds odd but is exactly what you want: image coordinates run with y pointing down, and the sign flip cancels that out. The result is the conventional definition above, so positive vorticity means counter-clockwise rotation as it appears on your screen.
Divergence — the net rate at which fluid flows out of each point, via
MATLAB's
divergence:
For an incompressible flow measured in-plane this should be near zero, so a divergence map doubles as a rough sanity check on your data (or a sign of out-of-plane motion).
Shear rate — the magnitude of the rate-of-strain tensor. Writing its three independent components as
Dyy = ∂v/∂y
Dxy = ½ ( ∂u/∂y + ∂v/∂x )
the reported value is
Simple strain rate — the difference between the two normal strain rates:
Q criterion — a standard vortex-identification measure that compares rotation against strain. It is defined from the rotation tensor Ω and the strain-rate tensor S as ½(‖Ω‖² − ‖S‖²), where ‖·‖² means “the sum of the squares of all components”. Written out for a 2D field:
Positive Q marks regions where rotation dominates over strain — the usual criterion for identifying a vortex core. This calculation assumes an evenly spaced measurement grid, which is what a standard PIV analysis produces.
Quantities carried over from the analysis
The last three are not calculated on this panel at all — they are produced during the PIV analysis itself and simply displayed here.
Correlation coefficient — for each interrogation window, the Pearson correlation between the two image patches:
where a and b are the two interrogation windows with their mean brightness subtracted.
Crucially, this is evaluated on the final pass, after the windows have been deformed by the displacement measured up to that point. So it does not tell you how similar the two raw images were — it tells you how well the two windows match once they have been shifted and deformed by the vector PIVlab found. A value near 1 means the measured displacement really does explain the particle pattern; a low value flags a suspect vector. Masked windows are reported as 0. You can filter on exactly this quantity in image-based validation.
Uncertainty — an estimate of the error on each vector, in the same units as the velocity. PIVlab uses the particle-image disparity method: after both images are fully deformed by the measured displacement, any residual mismatch between individual particle pairs is measured, and the RMS spread of those mismatches within each interrogation window becomes the uncertainty (the x and y parts are combined as √(ex² + ey²)). The implementation follows:
Sciacchitano A, Wieneke B and Scarano F (2013), PIV uncertainty quantification by image matching, Meas. Sci. Technol. 24 045302, doi:10.1088/0957-0233/24/4/045302 — adapted from the MATLAB package by Dr. A. Sciacchitano (TU Delft).
This map only exists if Compute uncertainty was enabled in PIV settings before the analysis ran; otherwise PIVlab tells you there is no uncertainty data for the frame.
Line integral convolution (LIC) has no closed-form equation. It smears a random noise image along the local flow direction, which makes streak-like patterns emerge that follow the vector field — a texture, not a measured quantity, so it carries no units and is always drawn with a gray colormap. PIVlab runs the process twice, feeding each result back in as the noise input for the next round. The technique was introduced by Cabral & Leedom (Imaging vector fields using line integral convolution, SIGGRAPH '93); PIVlab's implementation comes from the Matlab VFV Toolbox 1.0, by courtesy of Nima Bigdely Shamlo, Computational Science Research Center, San Diego State University.
Data smoothing
| Mode | Effect |
|---|---|
| None | No smoothing (default). |
| 2D | Spatial smoothing within each frame, using Damien Garcia's smoothn. Controlled by Smoothing parameter (default 0.2; larger = smoother, typical range 0.1–1). |
| time (moving average) | A moving average across neighbouring frames. Temporal window (± frames) sets how many frames on each side to include, combined with more weight given to closer frames. |
| 2D + time | Both, spatial smoothing first, then temporal. |
Subtracting a background flow
To reveal flow structure relative to a moving reference frame (e.g. removing a convection velocity), subtract a constant velocity from every vector:
- Type a value directly into u: or v: to subtract a fixed velocity.
- Or click mean u / mean v to subtract the field's own average automatically.
Colormap and display
| Control | Effect |
|---|---|
| autoscale | Stretches the colour map to each frame's own min/max. Turn this off when rendering a video, so the color scale stays consistent across frames. |
| min / max | Manual colour-map bounds, editable once autoscale is off. |
| Extrapolate border | Fills the border region using spring inpainting instead of the mean value — slower, but smoother-looking. |
Applying
Click Apply to current frame to preview on the current frame, or Apply to all frames to compute the selected parameter and settings across the whole session.