Home > marsbar > @mardo_99 > ui_get_event.m

ui_get_event

PURPOSE ^

method to select an event

SYNOPSIS ^

function [e_spec, e_name] = ui_get_event(D)

DESCRIPTION ^

 method to select an event 
 FORMAT [e_spec, e_name] = ui_get_event(D)
 D      - design
 
 Returns
 e_spec - 2 by 1 matrix with 
          e_epec(1) - session number
          e_spec(2) - event number in session
 e_name - name of event

 $Id$ 

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [e_spec, e_name] = ui_get_event(D)
0002 % method to select an event
0003 % FORMAT [e_spec, e_name] = ui_get_event(D)
0004 % D      - design
0005 %
0006 % Returns
0007 % e_spec - 2 by 1 matrix with
0008 %          e_epec(1) - session number
0009 %          e_spec(2) - event number in session
0010 % e_name - name of event
0011 %
0012 % $Id$
0013 
0014 if ~is_fmri(D)
0015   error('Need FMRI design');
0016 end
0017 SPM  = des_struct(D);
0018 Sess = SPM.Sess;
0019 
0020 % get session
0021 %--------------------------------------------------------------
0022 s     = length(Sess);
0023 if  s > 1
0024   s   = spm_input('which session','+1','n1',1,s);
0025 end
0026   
0027 u = length(Sess{s}.name);
0028 Uname = {};
0029 for i = 1:u
0030   Uname{i} = Sess{s}.name{i};
0031 end
0032 
0033 % get effect
0034 %--------------------------------------------------------------
0035 str   = sprintf('which effect');
0036 u     = spm_input(str,'+1','m',Uname);
0037 
0038 e_spec = [s u]';
0039 e_name = Uname{u};

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019