FDI - Fractal Dimension Index
Juan Ruiz de Miras. University of Granada - SPAIN. 2024.
FDI is a MATLAB tool for computing the Fractal Dimension Index of reconstructed sources obtained from EEG.
FDI has two operation modes: GUI and console.
GUI mode allows the user to interactively compute the FDI of reconstructed sources.
On the other hand, you can use the console mode to launch independent processes for processing several sources in batch or in parallel.
You can download the MATLAB source code of FDI by clicking here.
Once unzipped the file fdi.zip, the source code includes these folders and main files:
doc/: instructions for installing and running the program
examples/: folder where you can copy the example MATLAB files (download here) with sources, times, vertices and faces for two EEG epochs (one TMS-evoked EEG and one resting-state recording)
fdi/: source code of the program:
- fdi/FDIConsole.m: MATLAB program to run FDI in the MATLAB console
- fdi/FDIgui.m: MATLAB program to run FDI in a graphical user interface
help/: help with step by step instructions to compute the FDI from an EEG epoch
README.txt: information of the program
testFDIconsole.m: MATLAB script for computing the FDI of the two epochs stored in the folder examples/
testParallel.sh: shell script with an example of how running FDI in parallel
Use the script testFDIConsole.m to rapidly test the application.
INSTALLATION
FDI requires a computer equipped with a NVIDIA CUDA compatible GPU. The NVIDIA CUDA Runtime version 11.6 is required (download from NVIDIA web page here).
Only for Windows platform: Microsoft Visual Studio redistributable libraries are required (version 2019 or higher). You can download them directly from Microsoft web site here.
MEX files are already compiled for Linux 64bits (Debian Linux 5.10) and Windows 64bits.
To compile for other platforms, from the MATLAB prompt execute:
>> mexcuda bc3d.cu
>> mexcuda bc4d.cu
Files bc3d.cu and bc4d.cu are located at folders fdi/external/CUDA/CUDA_3DFD/ and fdi/external/CUDA/CUDA_4DFD/, respectively.
The mexcuda command requires the Parallel Computing toolbox of MATLAB.
USAGE
At the MATLAB prompt:
>> FDIgui
This opens the graphical user interface for FDI:

click help --> help to obtain step by step instructions to compute the FDI from an EEG epoch.
or you can use the console mode in MATLAB as follows:
>> FDIConsole sources times frequency vertices windowTime windowOverlapping iniTime [optional parameter-value pairs]
where the parameters are:
sources: .mat file containing a matrix with name "sources" and dimensions num_sources x time_samples. This matrix contains the current in each modeled source at each sample time, or the pre-binarized sources (1’s and 0’s)
times: .mat file containing a vector with name "times" and dimensions 1 x time_samples. This vector contains the time (in seconds) for each time sample
frequency: the frequency at which the signal was sampled (number of time samples per second)
vertices: .mat file containing a matrix with name "vertices" and dimensions num_sources x 3. This matrix contains the (X,Y,Z) position of each source
windowTime: length in seconds of the sliding window
windowOverlapping: value between 0 and 1 indicating the percentage of overlapping between consecutive windows
iniTime: time in seconds when the first window starts
and the possible optional parameter-value pairs are:
'maxWindows' max number of windows: default is 0 (number of windows is set to the maximum possible)
'boxSide' number of voxels in each side of the voxelization: possible values are 128 (default) or 256
'subjectId' string with an ID for the subject: default value is "FDIResults"
'nStd' number of standard deviations used to binarize the sources: by default (-1) no binarization is performed, assuming that the sources are previoulsy binarized
'silent' true/false: if true, no messages are displayed at the console. Default value is false
See the code in the file testFDIconsole.m where several examples are provided for using the console mode of FDI.
As an independent process for batch or parallel processing of several subjects:
See the code in the file testParallel.sh where several examples are provided for using the console mode of FDI in batch or parallel.
CITATION
If FDI has been useful for your research, please, cite as:
"FDI: a MATLAB tool for computing the fractal dimension index of reconstructed sources from EEG data"
Juan Ruiz de Miras, Adenauer G. Casali, Marcello Massimini, Antonio J. Ibáñez, María F. Soriano and Sergio Iglesias
Computers in Biology and Medicine, 2024
https://doi.org/10.1016/j.compbiomed.2024.108871
CONTACT AND SUGGESTIONS
For contact information click here