Home > functions > gui > brain_file_maker > brain_file_maker_set_parm.m

brain_file_maker_set_parm

PURPOSE ^

SYNOPSIS ^

function [obj] = brain_file_maker_set_parm(obj, parm)

DESCRIPTION ^

 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 [obj] = brain_file_maker_set_parm(obj, parm)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 
0007 %
0008 % --- Previous check
0009 %
0010 if ~exist('obj', 'var')
0011     error('obj is a required parameter.');
0012 end
0013 if ~exist('parm', 'var')
0014     error('parm is a required parameter.');
0015 end
0016 
0017 %
0018 % --- Main procedure
0019 %
0020 if isfield(parm, 'analyze_file')
0021     obj.analyze_file = parm.analyze_file;
0022     obj.analyze_info = vb_analyze_info_new(parm.analyze_file);
0023 end
0024 
0025 % Product type
0026 if isfield(parm, 'std_brain')
0027     obj.product_type = 1;
0028 elseif isfield(parm, 'subj_mask')
0029     obj.product_type = 2;
0030 else
0031     error('invalid parameter was specified.');
0032 end
0033 
0034 % Comment
0035 if isfield(parm, 'comment')
0036     obj.comment = parm.comment;
0037 end
0038 
0039 % SPM normalization file
0040 if isfield(parm, 'spm_normalization_file')
0041     obj.spm_norm_file = parm.spm_normalization_file;
0042 end
0043 
0044 % Cortical files
0045 if isfield(parm, 'brain_file')
0046     obj.output_brain_file = parm.brain_file;
0047 
0048     % make output setting from parameter
0049     global vbmeg_inst;
0050     [p_, f_, e_] = vb_get_file_parts(obj.output_brain_file);
0051     obj.brain_file_output_dir = p_;
0052     obj.brain_file_output_filename = ...
0053         strrep([f_, e_], vbmeg_inst.const.BRAIN_EXTENSION, '');
0054 end
0055 if isfield(parm, 'area_file')
0056     obj.output_area_file = parm.area_file;
0057 end
0058 if isfield(parm, 'act_file')
0059     obj.output_act_file = parm.act_file;
0060 end
0061 
0062 % Mask file
0063 if isfield(parm, 'subj_mask')
0064     obj.output_mask_file = parm.subj_mask;
0065 end
0066 
0067 
0068 % save application instance to figure
0069 guidata(obj.H.figure, obj);
0070 
0071 [obj] = brain_file_maker_update_display(obj);
0072 
0073 %
0074 % --- After check
0075 %
0076 if nargout ~= 1
0077     error('function caller should received obj.');
0078 end

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