0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 clear all
0014
0015
0016 proj_root = [getenv('MATHOME') '/SBIdata-new'];
0017
0018 project_name = 'Template';
0019
0020 profile_on = 0;
0021 Test_ID = '-a';
0022
0023
0024 set_job_mode = [0 1 2 3 4];
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 vbmeg;
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 brain_parm = vb_set_brain_parm_test(Test_ID);
0050 fmri_parm = vb_set_fmri_parm_test(Test_ID);
0051
0052 meg_parm = vb_set_yokogawa_meg_parm_test;
0053 basis_parm = vb_set_basis_parm_test(Test_ID);
0054 bayes_parm = vb_set_bayes_parm_test(proj_root);
0055 current_parm = vb_set_current_parm_test;
0056
0057
0058 proj_file = [proj_root filesep project_name '.mat'];
0059 set_project_filename(proj_file);
0060
0061 if exist(proj_file) ~= 0
0062 btn = questdlg(sprintf(...
0063 'Project file ("%s") exists. Do you overwrite this file? ',...
0064 proj_file));
0065 switch(lower(btn))
0066 case 'no'
0067 return ;
0068 case 'cancel'
0069 return ;
0070 end
0071 end
0072
0073 fprintf('--- SAVE PROJECT FILE: %s\n', proj_file);
0074 project_file_mgr('make', proj_file, project_name, proj_root);
0075
0076
0077
0078 for job_mode = set_job_mode
0079
0080 if profile_on == 0,
0081 tic
0082 elseif profile_on > 0,
0083 profile on -detail builtin
0084 tic
0085 end;
0086
0087 switch job_mode
0088 case 0
0089 vb_job_brain(proj_root,brain_parm);
0090 case 1
0091 vb_job_inflate(proj_root,brain_parm);
0092 case 2
0093 vb_job_fmri(proj_root, fmri_parm);
0094 case 3
0095 vb_job_meg(proj_root, meg_parm);
0096 case 4
0097 vb_job_leadfield(proj_root,basis_parm);
0098 case 5
0099 vb_job_vb(proj_root,bayes_parm);
0100 case 6
0101 vb_job_current(proj_root,current_parm);
0102 case 7
0103 vb_job_current_tr(proj_root,current_parm);
0104 end
0105
0106 if profile_on==0,
0107 vb_ptime(toc)
0108 elseif profile_on==1,
0109 vb_ptime(toc)
0110 if vb_matlab_version >= 7
0111 profile off
0112 profsave(profile('info'),'profile_job')
0113 else
0114 profile report profile_job
0115 end
0116 elseif profile_on==2,
0117 vb_ptime(toc)
0118 profile viewer
0119 end
0120
0121 end
0122
0123 disp('done.');
0124