0001 function vb_parm = vb_set_multiple_prior(bayes_parm,vb_parm,ix)
0002
0003
0004
0005
0006
0007
0008
0009 disp('Set fMRI activity pattern for Bayesian Wiener estimate');
0010
0011 Nvact = length(ix);
0012 Norient = vb_parm.Norient;
0013
0014
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
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
0038 if Norient==3 & vb_parm.soft_mode == 1,
0039
0040 disp('Soft constraint on current orientation');
0041 xxdev = vb_cortex_normal_variance(brainfile,[],[],vb_parm,'subj');
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