Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


WaverBasisOption.m

Go to the documentation of this file.
00001 function [err, Bstrct] = WaverBasisOption (BasisFunc, N_Basis, BasisOpt)
00002 %
00003 %   [err,] = WaverBasisOption ()
00004 %
00005 %Purpose:
00006 %   
00007 %   
00008 %   
00009 %Input Parameters:
00010 %   
00011 %   
00012 %   
00013 %Output Parameters:
00014 %   err : 0 No Problem
00015 %       : 1  Problems
00016 %   
00017 %   
00018 %      
00019 %Key Terms:
00020 %   
00021 %More Info :
00022 %   
00023 %   
00024 %   
00025 %
00026 %     Author : Ziad Saad
00027 %     Date : Fri Jul 18 14:35:24 EDT 2003
00028 %     SSCC/NIMH/ National Institutes of Health, Bethesda Maryland
00029 
00030 
00031 %Define the function name for easy referencing
00032 FuncName = 'WaverBasisOption';
00033 
00034 %Debug Flag
00035 DBG = 1;
00036 
00037 %initailize return variables
00038 err = 1;
00039 Bstrct = [];
00040 
00041 if (strcmp (lower(BasisFunc),'tent')), 
00042    if (~isfield(BasisOpt,'tSpan') | isempty(BasisOpt.tSpan)),
00043       fprintf (2,'Error %s: tSpan must be set with tent option.\n',...
00044          FuncName);
00045       return;
00046    end
00047 
00048    for (i=1:1:N_Basis),
00049       Bstrct(i).BareOpt = sprintf ('tent((t-%g)/%g)',... 
00050          (i-1).*BasisOpt.tSpan./N_Basis, BasisOpt.tSpan./N_Basis); 
00051       Bstrct(i).opt = sprintf ('-EXPR ''%s''',... 
00052          Bstrct(i).BareOpt); 
00053       Bstrct(i).minlag = 0;
00054       Bstrct(i).maxlag = 0;
00055    end
00056    err = 0;
00057    return;
00058 elseif (strcmp (lower(BasisFunc),'gam') | strcmp (lower(BasisFunc),'mgh')), 
00059    if (N_Basis ~= 1),
00060      fprintf (2,'Error %s: Only 1 basis for GAM or MGH\n', FuncName);
00061      return;
00062    end 
00063    Bstrct(1).BareOpt = '';
00064    Bstrct(1).opt = '-GAM';
00065         Bstrct(1).power = BasisOpt.gamb;
00066         Bstrct(1).scale = BasisOpt.gamc;
00067         Bstrct(1).delay = BasisOpt.gamd;
00068    if (~isfield(BasisOpt,'minlag') | isempty(BasisOpt.minlag)) BasisOpt.minlag = 0; end
00069    if (~isfield(BasisOpt,'maxlag') | isempty(BasisOpt.maxlag)) BasisOpt.maxlag = 0; end
00070    Bstrct(1).minlag = BasisOpt.minlag;
00071    Bstrct(1).maxlag = BasisOpt.maxlag;
00072    err = 0;
00073    return;
00074 else 
00075    if (strcmp (lower(BasisFunc),'spm1') | strcmp (lower(BasisFunc),'spm2')),
00076            for (i=1:1:N_Basis),
00077          Bstrct(i).BareOpt = '';
00078          Bstrct(i).minlag = 0;
00079          Bstrct(i).maxlag = 0;
00080                 end
00081                 err = 0;
00082                 return;
00083    else
00084    fprintf (2,'Error %s: Bad Basis %s\n', FuncName, BasisFunc);
00085    return;
00086         end
00087 end
00088 
00089 err = 0;
00090 return;
 

Powered by Plone

This site conforms to the following standards: