Home > functions > estimation > bayes > vb_set_multiple_prior.m

vb_set_multiple_prior

PURPOSE ^

Set (multiple) fMRI activity pattern(s) for Bayes Wiener estimate

SYNOPSIS ^

function vb_parm = vb_set_multiple_prior(bayes_parm,vb_parm,ix)

DESCRIPTION ^

 Set (multiple) fMRI activity pattern(s) for Bayes Wiener estimate
  vb_parm = vb_set_multiple_prior(bayes_parm,vb_parm,ix)


 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    vb_parm = vb_set_multiple_prior(bayes_parm,vb_parm,ix)
0002 % Set (multiple) fMRI activity pattern(s) for Bayes Wiener estimate
0003 %  vb_parm = vb_set_multiple_prior(bayes_parm,vb_parm,ix)
0004 %
0005 %
0006 % Copyright (C) 2011, ATR All Rights Reserved.
0007 % License : New BSD License(see VBMEG_LICENSE.txt)
0008 
0009 disp('Set fMRI activity pattern for Bayesian Wiener estimate'); 
0010 
0011 Nvact   = length(ix);
0012 Norient = vb_parm.Norient;
0013 
0014 % fMRI activity pattern
0015 brainfile = bayes_parm.brainfile;
0016 actfile   = bayes_parm.actfile;
0017 act_key   = bayes_parm.act_key;
0018 
0019 if iscell(act_key),
0020     Nact_key = length(act_key);
0021 else
0022     act_key  = {act_key};
0023     Nact_key = 1;
0024 end
0025 
0026 fprintf('Nact_key   = %d\n',Nact_key)
0027 
0028 % Set multiple fMRI activity pattern to act_ptn
0029 act_ptn  = zeros(Nvact*Norient, Nact_key );
0030 
0031 if ~isempty(ix)
0032     for n=1:Nact_key,
0033         act = vb_get_act(actfile, act_key{n});
0034         xxP = act.xxP/max(act.xxP);
0035         xxP = xxP(ix).^2;
0036         
0037         % Check current orientation
0038         if Norient==3 & vb_parm.soft_mode == 1,
0039             % Soft constraint on current orientation
0040             disp('Soft constraint on current orientation'); 
0041             xxdev = vb_cortex_normal_variance(brainfile,[],[],vb_parm);
0042             atmp  = repmat(xxP,[1 3]).*xxdev(ix,:);
0043         else
0044             atmp  = repmat(xxP,[1 Norient]);
0045         end
0046         
0047         act_ptn(:,n) = atmp(:);
0048     end
0049 end
0050 
0051 vb_parm.act = act_ptn;
0052 
0053 return

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