spatialGaussFilt - Spatial gaussian filter
Applies a spatial gaussian filter to image time series.
Description
This function applies a smoothing to the image using a Gaussian filter in order to blur the images and reduce high-frequency noise. This function uses Matlab's imgaussfilt function to perform the smoothing of the frames from the image time series data.
Input
This function accepts only image time series as input with dimensions Y, X and T.
The algorithm
This function uses a 2D Gaussian smoothing kernel with a user-defined standard deviation (i.e. sigma). In brief, the larger the value of the standard deviation of the filter, more blurred the image will be. Here is an example of five standard deviations values applied to an image measuring 256 by 256 pixels :
Example of five different standard deviation (sigma) on a image from the cortical activity of a mouse
As stated above, this function applies Matlab's function imgaussfilt to all frames of an image time series. The filter convolutes a square Gaussian kernel to the image. The filter is forced to be applied in the spatial domain to avoid unwanted results if the data contains infinite values or NaNs. The Kernel size is dependent on the sigma value (function's default) and is defined as:
kernel_size = 2*ceil(2*sigma)+1;
Output
The output of this function is a numerical matrix with dimensions Y,X and T containing the smoothed data.
Parameters
The parameter of this function is the following:
Standard deviation of the Gaussian filter.