Home > vbmeg > demo > sample_scripts > test_vbmeg.m

test_vbmeg

PURPOSE ^

Test VBMEG public interface functions.

SYNOPSIS ^

function test_vbmeg

DESCRIPTION ^

 Test VBMEG public interface functions. 

 [syntax]
 test_vbmeg

 [note]
 This function is for VBMEG0.82. 

 [history]
 2010-06-30 Taku Yoshioka

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function test_vbmeg
0002 % Test VBMEG public interface functions.
0003 %
0004 % [syntax]
0005 % test_vbmeg
0006 %
0007 % [note]
0008 % This function is for VBMEG0.82.
0009 %
0010 % [history]
0011 % 2010-06-30 Taku Yoshioka
0012 %
0013 % Copyright (C) 2011, ATR All Rights Reserved.
0014 % License : New BSD License(see VBMEG_LICENSE.txt)
0015 
0016 proj_root = './';
0017 
0018 test_parm.cortex  = 'bv';       % 'bv' or 'fs'
0019 test_parm.data    = 'meg';      % 'meg' or 'eeg'
0020 test_parm.method  = 'sarvas';   % 'sarvas' or 'bem'
0021 test_parm.prior   = 'fmri';     % 'uniform' or 'fmri'
0022 test_parm.tempwin = 'single'; % 'single' or 'multiple'
0023 %test_parm.tempwin = 'multiple'; % 'single' or 'multiple'
0024 
0025 V     = test_job_brain(proj_root,test_parm);
0026 Vinfl = test_job_inflate(proj_root,test_parm);
0027 xxP   = test_job_fmri(proj_root,test_parm);
0028         test_job_meg(proj_root,test_parm);
0029 G     = test_job_leadfield(proj_root,test_parm);
0030         test_job_vb(proj_root,test_parm);
0031         test_job_vbfilter(proj_root,test_parm);
0032 Z     = test_vb_calc_current(proj_root,test_parm);
0033 Z2    = test_job_current(proj_root,test_parm);
0034 
0035 %
0036 % Comparison: vb_calc_current.m and vb_job_current.m
0037 %
0038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0039 d = sqrt(sum(sum((Z-Z2).^2))/sum(sum(Z.^2)));
0040 disp(['Difference of vb_calc_current.m and job_current.m: ' ...
0041       sprintf('%1.3f\n',d)]);
0042 
0043 %
0044 % Following code makes data for checking VBMEG version compatibility.
0045 %
0046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0047 filename = ['./vbmeg_result/' test_parm.cortex '_' test_parm.data '_' ...
0048             test_parm.method '_' test_parm.prior '_' test_parm.tempwin ...
0049             '.vbresult.mat'];
0050 vb_fsave(filename,'V','Vinfl','xxP','G','Z','test_parm');
0051 
0052 return;

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005