diff --git a/test/test_openmeeg_eeg.m b/test/test_openmeeg_eeg.m new file mode 100644 index 0000000000..731c5ecfd1 --- /dev/null +++ b/test/test_openmeeg_eeg.m @@ -0,0 +1,134 @@ +function test_openmeeg_eeg + +% TEST test_openmeeg_eeg +% (previously called testOpenMEEGeeg) +% Test the computation of an EEG leadfield with OpenMEEG + +% Copyright (C) 2010-2017, OpenMEEG developers + +addpath(pwd) % Make sure current folder is in the path + +%% Set the position of the probe dipole +dippos = [0 0 70]; + +%% Set the radius and conductivities of each of the compartments + +% 4 Layers, defined from outside to inside (i.e., [scalp skull CSF brain]) +r = [100 92 88 85]; +c = [1 1/80 1/20 1]; + +[rdms,mags] = run_bem_computation(r,c,dippos); + +% the following would require the installation of xunit toolbox +% assertElementsAlmostEqual(rdms, [0.019963 0.019962 0.10754], 'absolute', 1e-3) +% assertElementsAlmostEqual(mags, [0.84467 0.84469 0.83887], 'absolute', 1e-3) + +%use instead +thr = 2e-2; +assert(norm(rdms-[0.019963 0.019962 0.10754])