Home > marsbar > @mardo_2 > private > pr_get_filter.m

pr_get_filter

PURPOSE ^

gets filter using spm_fmri_spm_ui routines

SYNOPSIS ^

function [K, str] = pr_get_filter(RT, row)

DESCRIPTION ^

 gets filter using spm_fmri_spm_ui routines
 FORMAT [K, str]= pr_get_filter(RT, row)
 or
 FORMAT [K, str]= pr_get_filter(RT, Sess)

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [K, str] = pr_get_filter(RT, row)
0002 % gets filter using spm_fmri_spm_ui routines
0003 % FORMAT [K, str]= pr_get_filter(RT, row)
0004 % or
0005 % FORMAT [K, str]= pr_get_filter(RT, Sess)
0006 %
0007 % $Id$
0008   
0009 if nargin < 2
0010   error('Need TR, row / Sess matrix');
0011 end
0012 
0013 % number of sessions
0014 nsess = length(row);
0015 
0016 % rows from Sess
0017 if isfield(row(1), 'row')
0018   Sess = row;
0019   row = {};
0020   for s = 1:nsess
0021     row{s} = Sess(s).row;
0022   end
0023 else
0024   Sess = [];
0025 end
0026 
0027 switch spm_input('High-pass filter?','+1','b','none|specify');
0028   
0029  case 'specify'  
0030   % default 128 seconds
0031   %-------------------------------------------------------
0032   HParam = 128*ones(1,nsess);
0033   p_str    = 'cutoff period (secs)';
0034   HParam = spm_input(p_str,'+1','e',HParam,[1 nsess]);
0035   str = sprintf('Cutoff: %d {s}', HParam);
0036   
0037  case 'none'     
0038   % Inf seconds (i.e. constant term only)
0039   %-------------------------------------------------------
0040   HParam = Inf*ones(1,nsess);
0041   str = 'none';
0042 end
0043 
0044 % create and set filter struct
0045 %---------------------------------------------------------------
0046 for  i = 1:nsess
0047   K(i) = struct(    'HParam',    HParam(i),...
0048             'row',        row{i},...
0049             'RT',        RT);
0050 end
0051 K = pr_spm_filter(K);

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