Skip to content
Arnaud Delorme edited this page Oct 25, 2022 · 11 revisions

Download BINICA binaries: a Compiled C Version of runica()

This binary version of the runica() function of Makeig et al. contained in the EEG/ICA Toolbox originally ran ~12x faster than the MATLAB version (MATLAB speed has improved since) and may be ~4x more compact.

It uses the logistic infomax ICA algorithm of Bell and Sejnowski, with natural gradient and extended ICA extensions by Tewon Lee et al.. It was programmed in MATLAB as runica.m for unsupervised operation by Scott Makeig at CNL, Salk Institute, La Jolla CA. Sigurd Enghoff translated it into C++ code and compiled it for multiple platforms. J-R Duann improved the PCA dimension-reduction and compiled the linux and free_bsd versions.

Use: To use the function, call with a ".sc" file argument. For individual applications, copy and modify the sample script "ica.sc" Under UNIX or DOS command line

ica < myversion.sc

Be sure that the directory that you store the binary file in is in your search path. e.g., In Unix/Linux add this directory to your root .cshrc file "setenv path" line.

Outputs: Ica creates two files, "xxx.wts" and "xxx.sph" containing weights and sphere matrices such that (under Matlab)

>> ICA_activations = wts * sph * data;

The "xxx" stem in the output files may be specified within the input .sc parameter file. See the sample .sc file for arguments and the EEG/ICA toolbox tutorial for more details.

Older version of the ICA binary are available below (these versions are not compatible with the Matlab binica.m. The ica.sc text configuration file (sample here)in the archive must be edited manually). SGI Unix (older version) Sun Unix (older version)

SOURCE code

The Github repository (13Mb) contains the source code, and binica_full.zip (~180Mb) source code plus many binaries. This code is distributed under the GNU GPL license and may not be used for commercial applications. It is copyrighted by the Salk Institute for biological studies and the University of San Diego California. This code can usually compile under most Unix machines. The binary above for Mac OSX also contains a make file for Mac OSX. Some recommendation below:

  • if you uncompress using winzip, deactivate the "tar smart CR/LF" option in winzip in the menu Option → configuration tab Miscellaneous
  • recompile BLAS (folder CLABPACK\BLAS)
  • recompile LABPACK (CLABPACK folder) For 2 and 3 it is actually better if you find on the Internet the latest versions of these libraries
  • make the ICA binary file by using the makefile in the main directory

The README file embedded in the compressed archive also contains additional details. We would advise to use the GNU C compiler since the Makefiles should be compatible with it. Please when you have succeeded compiling it, send us a copy of the exe file (and a small report of how you did it) so we can put the new file on the Internet.

Use with EEGLAB

To use one of these programs from within Matlab (and EEGLAB)

  • download the file and place them in the functions/support_files of the EEGLAB directory (you may create a subfolder for them or uncompress them in the function subfolder).
  • edit the icadefs.m file to specify the file name of the executable you intend to use (search for variable ICABINARY).
  • From the command line, you may use the binica.m function that will call the binary executable. From the EEGLAB graphical interface, run ICA using the 'binica' option of the Tools → Run ICA graphic interface (see the tutorial for how to compute ICA components). As a test, try for example "banana(rand(10,1000))". This is how to use the algorithm on an EEGLAB dataset.
EEG = pop_runica(EEG,'icatype','binica', 'extended',1,'interupt','on');

Code provided for convenience: This code is not supported and this page is provided for convenience only.

Cuda version

This Github repo contains a CUDA version of the code above for use with NVIDIA GPU processors. A fork by Alejandro Ojeda contains functions to call the CUDA version from Matlab.

Cite

For credits, please quote "binary Infomax ICA by Sigurd Enghoff, based on the Matlab version of Scott Makeig and collaborators. Makeig S, Anthony J. Bell, Tzyy-Ping Jung and Terrence J. Sejnowski, Independent component analysis of electroencephalographic data In: D. Touretzky, M. Mozer and M. Hasselmo (Eds). Advances in Neural Information Processing Systems 8:145-151 (1996)."

Important: Infomax ICA is under a patent by the Salk Institute and any commercial product using this type of algorithm (or the recompiled binary files distributed here) should contact the Salk Institute patent office.