Home > functions > gui > brain_file_maker > brain_file_maker_make_brainfiles_from_standard_model.m

brain_file_maker_make_brainfiles_from_standard_model

PURPOSE ^

make brain files from standard model

SYNOPSIS ^

function [result, cancelled] = brain_file_maker_make_brainfiles_from_standard_model(obj, parm, comment)

DESCRIPTION ^

 make brain files from standard model
 [USAGE]
    [result, cancelled] = brain_file_maker_make_brainfiles_from_standard_model(...
                               <obj>, <parm> [,comment])
 [IN]
           obj : brain_file_maker object
          parm : parameter for making brain files.
       comment : comment
 [OUT]
       result : <<out>> SUCCESS or FAILURE
                        (FAILURE is returned when error occurs.)
    cancelled : <<out>> true or false
                        (true is returned when select 'Yes' at overwrite confirmation.)

 Author: rhayashi
 Created: 2007-07-23

 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 [result, cancelled] = brain_file_maker_make_brainfiles_from_standard_model(...
0002                                     obj, parm, comment)
0003 % make brain files from standard model
0004 % [USAGE]
0005 %    [result, cancelled] = brain_file_maker_make_brainfiles_from_standard_model(...
0006 %                               <obj>, <parm> [,comment])
0007 % [IN]
0008 %           obj : brain_file_maker object
0009 %          parm : parameter for making brain files.
0010 %       comment : comment
0011 % [OUT]
0012 %       result : <<out>> SUCCESS or FAILURE
0013 %                        (FAILURE is returned when error occurs.)
0014 %    cancelled : <<out>> true or false
0015 %                        (true is returned when select 'Yes' at overwrite confirmation.)
0016 %
0017 % Author: rhayashi
0018 % Created: 2007-07-23
0019 %
0020 % Copyright (C) 2011, ATR All Rights Reserved.
0021 % License : New BSD License(see VBMEG_LICENSE.txt)
0022 
0023 %
0024 % --- Previous check
0025 %
0026 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0027 if ~exist('parm', 'var'), error('parm is a required parameter.'); end
0028 if ~exist('comment', 'var'),
0029     comment = '';
0030 end
0031 
0032 %
0033 % --- Main Procedure
0034 %
0035 global vbmeg_inst;
0036 result = FAILURE;
0037 cancelled = true;
0038 
0039 % try
0040 %
0041 proj_root = obj.proj_root;
0042 parm.comment = comment;
0043 parm.std_brain = vbmeg_inst.const.STD_BRAIN_CORTEX_FILE;
0044 parm.spm_normalization_file = obj.spm_norm_file;
0045 parm.analyze_file = ...
0046     [vb_analyze_info_get_file_prefix(obj.analyze_info), '.hdr'];
0047 
0048 parm.brain_file = obj.output_brain_file;
0049 parm.area_file  = obj.output_area_file;
0050 parm.act_file   = obj.output_act_file;
0051 
0052 % File overwrite check
0053 if exist([proj_root, filesep, parm.brain_file], 'file') == 2
0054     res = questdlg('Cortical model file already exists. overwrite?',...
0055                     'confirm', 'Yes', 'No', 'Yes');
0056     if strcmp(res, 'No')
0057         cancelled = true;
0058         return;
0059     end
0060 end
0061 
0062 h = brain_file_maker_show_wait_dialog;
0063 vb_job_brain_model_std2sbj(proj_root, parm);
0064 brain_file_maker_delete_wait_dialog(h);
0065 
0066 result = SUCCESS;
0067 cancelled = false;
0068 
0069 % catch
0070 %     result = FAILURE;
0071 % end

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005