Home > vbmeg > demo > test_scripts > vb_proj_run.m

vb_proj_run

PURPOSE ^

Sample script for job execution in batch mode

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Sample script for job execution in batch mode
   vb_proj_run

  You should copy this file & set_*_parm_test to your local directory 
     and modify according to your environment.
 
 
 2006/09/20 ver 0.5 by M. Sato

 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 % Sample script for job execution in batch mode
0002 %   vb_proj_run
0003 %
0004 %  You should copy this file & set_*_parm_test to your local directory
0005 %     and modify according to your environment.
0006 %
0007 %
0008 % 2006/09/20 ver 0.5 by M. Sato
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 clear all
0014 
0015 % Project root directory & project_file
0016 proj_root  = [getenv('MATHOME') '/SBIdata-new'];
0017 % project_file name
0018 project_name = 'Template'; 
0019 
0020 profile_on = 0;
0021 Test_ID    = '-a';
0022 
0023 % Set job execution list
0024 set_job_mode = [0 1 2 3 4];
0025 % case    0    vb_job_brain
0026 % case    1    vb_job_inflate
0027 % case    2    vb_job_fmri
0028 % case    3    vb_job_meg
0029 % case    4    vb_job_leadfield
0030 % case    5    vb_job_vb
0031 % case    6    vb_job_current
0032 % case    7    vb_job_current_tr
0033 
0034 % set path for vbmeg module
0035 vbmeg;
0036 
0037 %
0038 % --- Set parameter
0039 %
0040 
0041 %brain_parm = vb_set_brain_parm;
0042 %fmri_parm  = vb_set_fmri_parm;
0043 %meg_parm   = vb_set_sbi_meg_parm;      % use sbi meg data
0044 %meg_parm   = vb_set_yokogawa_meg_parm; % use yokogawa meg data
0045 %basis_parm = vb_set_basis_parm;
0046 %bayes_parm = vb_set_bayes_parm(proj_root); % ver 0.5
0047 %current_parm = vb_set_current_parm;% ver 0.5
0048 
0049 brain_parm = vb_set_brain_parm_test(Test_ID);
0050 fmri_parm  = vb_set_fmri_parm_test(Test_ID);
0051 %meg_parm   = vb_set_sbi_meg_parm_test(Test_ID);
0052 meg_parm   = vb_set_yokogawa_meg_parm_test; % use yokogawa meg data
0053 basis_parm = vb_set_basis_parm_test(Test_ID);
0054 bayes_parm = vb_set_bayes_parm_test(proj_root);% ver 0.5
0055 current_parm = vb_set_current_parm_test;% ver 0.5
0056 
0057 % Save project file (added by Kawawaki, Dai 2006.03.11)
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 % jobs
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 %% for job_mode = set_job_mode
0122 
0123 disp('done.');% Kawawaki, Dai (2006.03.11)
0124

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