autocorrmat = imageautocorr(im_stack)
autocorrmat = imageautocorr(mat_data)
autocorrmat = imageautocorr('im_stack.tif')
autocorrmat = imageautocorr('im_stack.tif','load')
autocorrmat = imageautocorr('directory_path')
autocorrmat = imageautocorr('directory_path','load')
This script calculates the image autocorrelation for a (presumed) ordered time series of images. The input data also need not be images, per se, it could also be any type of ordered, correlated data.
'autocorrmat' is an autocorrelation matrix giving the normalized correlation coefficients (-1 <= c <= 1) between any two time points of the data.
'im_stack' is assumed to be a an image stack, that is, images of size M x N with Z such images, such that size(im_stack) = M x N x Z. These would already be loaded into memory.
'mat_data' is a matrix of data M x N where each column is a time point with data of length M.
'im_stack.tif' is stacked TIFF, like 'im_stack', but not loaded into memory. In this mode, the script will 'imread' each image from the stack and perform the autocorrelation without loading in the full stack. This can be useful if the image data is very large. Using the option 'load', will load the stack into memory, and proceed as if it were a stack in memory. In this mode the input is treated as a full path and file name, and as such, you can enter a full path and file name here, e.g. using fullfile(path1,file1). NOTE: Reading images into memory one-by-one will be a much slower computation than loading ('load') into memory.
'directory_path' is a directory containing *only* image files. The script will examine all files in the current directory and read them in as images, thus if you have a folder with (e.g. TIFFs, BMPs, PNGs, JPEGs, etc) that have sequential file names like:
this is the option you want. The option 'load', will load those files into memory for processing. NOTE: Reading images into memory one-by-one will be a much slower computation than loading ('load') into memory.
%first create a set of correlated data
autocorrmat = imageautocorr(im_stack);
axis equal tight
axis equal tight
title(['Frame ' num2str(i)])