Home > functions > estimation > bayes > vb_parm_absolute_path.m

vb_parm_absolute_path

PURPOSE ^

vbmeg-0.30b

SYNOPSIS ^

function bayes_parm_absolute_path = vb_parm_absolute_path(proj_root, bayes_parm)

DESCRIPTION ^

 vbmeg-0.30b   
 vbmeg-0.31   by R.H
 2010-04-02 rhayashi bug fix(failed to make cell when char is given.)

 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 bayes_parm_absolute_path = vb_parm_absolute_path(proj_root, bayes_parm)
0002 % vbmeg-0.30b
0003 % vbmeg-0.31   by R.H
0004 % 2010-04-02 rhayashi bug fix(failed to make cell when char is given.)
0005 %
0006 % Copyright (C) 2011, ATR All Rights Reserved.
0007 % License : New BSD License(see VBMEG_LICENSE.txt)
0008 
0009 %%%
0010 %fprintf('New absolute_path program\n')
0011 
0012 bayes_parm_absolute_path = bayes_parm;
0013 
0014 %----------------> absolute path
0015 bayes_parm_absolute_path.brainfile = ...
0016     [proj_root filesep bayes_parm.brainfile];
0017 
0018 % --- (X_X) actually these are BAD CODINGS to combine proj_root and file here
0019 if isempty(bayes_parm.actfile)
0020   bayes_parm_absolute_path.actfile = '';
0021 else
0022   bayes_parm_absolute_path.actfile = ...
0023     [proj_root filesep bayes_parm.actfile];
0024 end
0025 
0026 if isempty(bayes_parm.areafile)
0027   bayes_parm_absolute_path.areafile = '';
0028 else
0029   bayes_parm_absolute_path.areafile = ...
0030     [proj_root filesep bayes_parm.areafile];
0031 end
0032 % --- (X_X) actually these are BAD CODINGS to combine proj_root and file here
0033 if ischar(bayes_parm.megfile)
0034     bayes_parm.megfile = {bayes_parm.megfile};
0035 end
0036 bayes_parm_absolute_path.megfile = ...
0037     cellstr(...
0038             [repmat(...
0039         [proj_root filesep], ...
0040         [length(bayes_parm.megfile) 1]),...
0041          char(bayes_parm.megfile)]);
0042 
0043 if ischar(bayes_parm.megfile_baseline)
0044     bayes_parm.megfile_baseline = {bayes_parm.megfile_baseline};
0045 end
0046 bayes_parm_absolute_path.megfile_baseline = ...
0047     cellstr(...
0048     [repmat(...
0049         [proj_root filesep], ...
0050         [length(bayes_parm.megfile_baseline) 1]),...
0051      char(bayes_parm.megfile_baseline)]);
0052 
0053 if ischar(bayes_parm.basisfile_global)
0054     bayes_parm.basisfile_global = {bayes_parm.basisfile_global};
0055 end
0056 bayes_parm_absolute_path.basisfile_global = ...
0057     cellstr(...
0058     [repmat(...
0059         [proj_root filesep], ...
0060         [length(bayes_parm.basisfile_global) 1]),...
0061      char(bayes_parm.basisfile_global)]);
0062 
0063 if ischar(bayes_parm.basisfile)
0064     bayes_parm.basisfile = {bayes_parm.basisfile};
0065 end
0066 bayes_parm_absolute_path.basisfile = ...
0067     cellstr(...
0068     [repmat(...
0069         [proj_root filesep], ...
0070         [length(bayes_parm.basisfile) 1]),...
0071      char(bayes_parm.basisfile)]);
0072 
0073 bayes_parm_absolute_path.bayesfile = ...
0074     [proj_root filesep bayes_parm.bayesfile];
0075 
0076 if isfield(bayes_parm,'extra') && isfield(bayes_parm.extra,'basisfile')
0077     if isempty(bayes_parm.extra.basisfile)
0078         bayes_parm_absolute_path.extra.basisfile = '';
0079     else
0080         if ischar(bayes_parm.extra.basisfile)
0081             bayes_parm.extra.basisfile = {bayes_parm.extra.basisfile};
0082         end
0083         bayes_parm_absolute_path.extra.basisfile = ...
0084             cellstr(...
0085             [repmat(...
0086                 [proj_root filesep], ...
0087                 [length(bayes_parm.extra.basisfile) 1]),...
0088              char(bayes_parm.extra.basisfile)]);
0089     end
0090 end

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