Home > vbmeg > functions > gui > preAnalysis > fmri > pa_fmri_set_parm.m

pa_fmri_set_parm

PURPOSE ^

sets fmri parameters to fmri gui.

SYNOPSIS ^

function pa_fmri_set_parm(fig, fmri_parm)

DESCRIPTION ^

 sets fmri parameters to fmri gui.
 [USAGE]
    pa_fmri_set_parm(<fig> [,fmri_parm]);
 [IN]
          fig : figure handle of fmri gui.
    fmri_parm : to be set fmri_parm [default:vb_set_fmri_parm()]
 [OUT]
    none

 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 pa_fmri_set_parm(fig, fmri_parm)
0002 % sets fmri parameters to fmri gui.
0003 % [USAGE]
0004 %    pa_fmri_set_parm(<fig> [,fmri_parm]);
0005 % [IN]
0006 %          fig : figure handle of fmri gui.
0007 %    fmri_parm : to be set fmri_parm [default:vb_set_fmri_parm()]
0008 % [OUT]
0009 %    none
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0018     error('invalid figure handle.');
0019 end
0020 
0021 % default value
0022 if isempty(fmri_parm)
0023     fmri_parm = vb_set_fmri_parm;
0024 end
0025 
0026 %
0027 % --- Main Procedure
0028 %
0029 
0030 % load data(@see pa_fmri_create)
0031 data = guidata(fig);
0032 
0033 H = data.H; % component handles
0034 
0035 % BRAIN file
0036 set(H.brain_file_edit, 'String', fmri_parm.brain_file);
0037 
0038 % SPM result file
0039 if isfield(fmri_parm, 'SPMmat_file')
0040     set(H.spm_edit, 'String', fmri_parm.SPMmat_file);
0041     if exist(fmri_parm.SPMmat_file, 'file') == 2
0042         pa_fmri_util(fig, 'set_spm_result_file', fmri_parm.SPMmat_file);
0043     end
0044 end
0045 
0046 % SPM result type
0047 if isfield(fmri_parm, 'SPMmapmode')
0048     switch(lower(fmri_parm.SPMmapmode))
0049         case {'mni2subj'}
0050             pa_fmri_util(fig, 'set_spm_type', 'mni2subj');
0051         case {'mni2mni'}
0052             pa_fmri_util(fig, 'set_spm_type', 'mni2mni');
0053         case {'subj2subj'}
0054             pa_fmri_util(fig, 'set_spm_type', 'subj2subj');
0055         otherwise
0056             error('Unknown fmri_parm.SPMmapmode is specified : %s', fmri_parm.SPMmapmode);
0057     end
0058 end
0059 
0060 % SPM normalization file
0061 if isfield(fmri_parm, 'spm_normalization_file')
0062     set(H.spm_normalization_file_edit, 'String', fmri_parm.spm_normalization_file);
0063 end
0064 
0065 % Registration keys postfix
0066 data.keys_postfix = '';
0067 if isfield(fmri_parm, 'keys_postfix')
0068     data.keys_postfix = fmri_parm.keys_postfix;
0069 end
0070 
0071 % AREA file
0072 set(H.area_file_edit, 'String', fmri_parm.area_file);
0073 
0074 % ACT file
0075 set(H.act_file_edit, 'String', fmri_parm.act_file);
0076 
0077 % save data
0078 data.fmri_parm = fmri_parm;
0079 guidata(fig, data);
0080 
0081 % view update
0082 pa_fmri_util(fig, 'update_exec_push_status');

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