Home > vbmeg > demo > sample_scripts > test_job_vb.m

test_job_vb

PURPOSE ^

Test job_vb.m, a sample program of VBMEG.

SYNOPSIS ^

function test_job_vb(proj_root,test_parm)

DESCRIPTION ^

 Test job_vb.m, a sample program of VBMEG. 

 [syntax]
 test_job_vb(proj_root,test_parm)

 [input]
 proj_root: <<string>> VBMEG project root directory. 
 test_parm: <<struct>> Test condition variables. 
 --- fields of test_parm
  cortex : <<string>> 'bv' for BrainVoyager, 'fs' for FreeSurfer. 
  data   : <<string>> 'meg' for MEG data, 'eeg' for EEG data. 
  method : <<string>> 'sarvas' for Sarvas, 'bem' for BEM. 
  prior  : <<string>> 'sparse' for sparse (noninformative), 'fmri' for
           fMRI prior. 
  tempwin: <<string>> 'single' for single time window, 'multiple' for
           multiple time windows. 
 ---

 [output]
 Bayes model parameter file (.bayes.mat). 

 [history]
 2010-06-28 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_job_vb(proj_root,test_parm)
0002 % Test job_vb.m, a sample program of VBMEG.
0003 %
0004 % [syntax]
0005 % test_job_vb(proj_root,test_parm)
0006 %
0007 % [input]
0008 % proj_root: <<string>> VBMEG project root directory.
0009 % test_parm: <<struct>> Test condition variables.
0010 % --- fields of test_parm
0011 %  cortex : <<string>> 'bv' for BrainVoyager, 'fs' for FreeSurfer.
0012 %  data   : <<string>> 'meg' for MEG data, 'eeg' for EEG data.
0013 %  method : <<string>> 'sarvas' for Sarvas, 'bem' for BEM.
0014 %  prior  : <<string>> 'sparse' for sparse (noninformative), 'fmri' for
0015 %           fMRI prior.
0016 %  tempwin: <<string>> 'single' for single time window, 'multiple' for
0017 %           multiple time windows.
0018 % ---
0019 %
0020 % [output]
0021 % Bayes model parameter file (.bayes.mat).
0022 %
0023 % [history]
0024 % 2010-06-28 Taku Yoshioka
0025 %
0026 % Copyright (C) 2011, ATR All Rights Reserved.
0027 % License : New BSD License(see VBMEG_LICENSE.txt)
0028 
0029 vb_disp('--- Start: test_job_vb');
0030 resultdir = './vbmeg_result/';
0031 
0032 %
0033 % Filename parameters
0034 %
0035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0036 bayes_parm = vb_set_bayes_default_parameters;
0037 bayes_parm.brainfile ...
0038     = [resultdir 'sbj_test_' test_parm.cortex '.brain.mat'];
0039 bayes_parm.areafile  ...
0040     = [resultdir 'sbj_test_' test_parm.cortex '.area.mat'];
0041 bayes_parm.actfile   ...
0042     = [resultdir 'sbj_test_' test_parm.cortex '.act.mat'];
0043 bayes_parm.basisfile ...
0044     = [resultdir 'sbj_test_UR_' test_parm.cortex '_' ...
0045        test_parm.data '_' test_parm.method '.basis.mat'];
0046 bayes_parm.megfile   ...
0047     = {[resultdir 'sbj_test_UR.' test_parm.data '.mat']};
0048 bayes_parm.basisfile_global ...
0049     = bayes_parm.basisfile;
0050 bayes_parm.megfile_baseline ...
0051     = bayes_parm.megfile;
0052 bayes_parm.bayesfile ...
0053     = [resultdir 'sbj_test_UR_' test_parm.cortex '_' ...
0054        test_parm.data '_' test_parm.method '_' ...
0055        test_parm.prior '_' test_parm.tempwin '.bayes.mat'];
0056 
0057 %
0058 % Noise model parameters
0059 %
0060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0061 bayes_parm.noise_model = 3;
0062 bayes_parm.noise_reg = 0.1;
0063 
0064 %
0065 % Prior parameters
0066 %
0067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0068 switch test_parm.prior
0069  case 'sparse',
0070   bayes_parm.act_key = 'Uniform';
0071   bayes_parm.a0 = 1;
0072   bayes_parm.a0_act = 100;
0073   bayes_parm.Ta0 = 10;
0074   bayes_parm.Ta0_act = 10;
0075   
0076  case 'fmri',
0077   bayes_parm.act_key = 'sbj_test_UR';
0078   bayes_parm.a0 = 1;
0079   bayes_parm.a0_act = 500;
0080   bayes_parm.Ta0 = 500;
0081   bayes_parm.Ta0_act = 500;
0082 end
0083 
0084 bayes_parm.v0 = 0.01;
0085 bayes_parm.Tv0 = 0;
0086 
0087 %
0088 % Time window parameters
0089 %
0090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0091 bayes_parm.twin_noise = [1 500]; 
0092 bayes_parm.twin_baseline = [1 500];
0093 bayes_parm.twin_meg = [1 1000];
0094 
0095 switch test_parm.tempwin, 
0096  case 'single', 
0097   bayes_parm.Tperiod = 1000;
0098   bayes_parm.Tnext = 1000;
0099   
0100  case 'multiple',
0101   bayes_parm.Tperiod = 100;
0102   bayes_parm.Tnext = 50;
0103 end
0104 
0105 %
0106 % Forward model parameters
0107 %
0108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0109 bayes_parm.forward_model = 'focal';
0110 bayes_parm.area_key = 'Cortex';
0111 bayes_parm.reduce = 0.2;
0112 bayes_parm.Rfilt = 0.5*8e-3/sqrt(log(2)); % FWHM=8mm
0113 bayes_parm.area_key_global = 'Cortex';
0114 bayes_parm.reduce_global = bayes_parm.reduce;
0115 bayes_parm.Rfilt_global = bayes_parm.Rfilt;
0116 bayes_parm.patch_norm = false;
0117 bayes_parm.expand_spatial_filter = true;
0118 bayes_parm.remove_crossed_area = false;
0119 
0120 %
0121 % Extra-dipole parameters
0122 %
0123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0124 bayes_parm.extra = [];
0125 
0126 %
0127 % Algorithm parameters
0128 %
0129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0130 bayes_parm.Ntrain = 1000;
0131 bayes_parm.Npre_train = 1000;
0132 bayes_parm.skip = 50;
0133 bayes_parm.update_sx = true;
0134 bayes_parm.update_v = true;
0135 bayes_parm.Fdmin = 1e-50;
0136 bayes_parm.a_min = 1e-6;
0137 bayes_parm.a_max = 1e6;
0138 bayes_parm.cont_pr = false;
0139 
0140 %
0141 % Soft normal constraint parameters (not publicly supported)
0142 %
0143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0144 bayes_parm.soft_mode = false;
0145 bayes_parm.variance_orientation = false;
0146 bayes_parm.var_max = 1/sqrt(2);
0147 bayes_parm.tan_var = 1.0;
0148 bayes_parm.cosval = cos(pi);
0149 
0150 %
0151 % Execute vb_job_vb
0152 %
0153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0154 vb_job_vb(proj_root,bayes_parm);
0155 vb_disp('--- End  : test_job_vb');

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