Matlab/SPM scripts and example data for distance correlation calculation for fMRI, based on Abdulrahman, H. & Henson, R.N. (2016). Effect of trial-to-trial variability on optimal event-related fMRI design: Implications for beta-series correlation and multi-voxel pattern analysis. Neuroimage, 125, 756–766.
Basic example using Matlab scripts