Save the 'fe' strucutre. fName = feConnectomeSave(fe,varargin) INPUTS: savedir - Directory where to save the connectome. Defualt feGet(fe,'savedir') name - Name of the connectome. Default feGet(fe,'name') OUTPUT: fName - path to the save file. See also, feConnectomeBuild.m, feConnectomeInit.m Copyright (2013-2014), Franco Pestilli, Stanford University, pestillifranco@gmail.com.
0001 function fName = feConnectomeSave(fe,varargin) 0002 % Save the 'fe' strucutre. 0003 % 0004 % fName = feConnectomeSave(fe,varargin) 0005 % 0006 % INPUTS: 0007 % savedir - Directory where to save the connectome. 0008 % Defualt feGet(fe,'savedir') 0009 % name - Name of the connectome. 0010 % Default feGet(fe,'name') 0011 % 0012 % OUTPUT: fName - path to the save file. 0013 % 0014 % See also, feConnectomeBuild.m, feConnectomeInit.m 0015 % 0016 % 0017 % Copyright (2013-2014), Franco Pestilli, Stanford University, pestillifranco@gmail.com. 0018 0019 if ~isempty(feGet(fe,'savedir')) && ~exist(feGet(fe,'savedir'),'dir'), 0020 mkdir(feGet(fe,'savedir')); 0021 end 0022 0023 % Get the full file name 0024 fName = feGet(fe,'name'); 0025 if ~isempty(varargin) % Add some info to the file name. 0026 fName = fullfile(feGet(fe,'savedir'),[fName,varargin{1}]); 0027 else 0028 fName = fullfile(feGet(fe,'savedir'),fName); 0029 end 0030 fprintf('[%s], Saving connectome: %s...\n',mfilename,fName) 0031 0032 % Add a chck here that if a file ith the smae name exists in the directory we append a time tag. 0033 % Otherwise appendign a time tag is not necessary and makes these files less clean. 0034 if (exist([fName,'.mat'],'file') || exist(fName,'file')) 0035 save(fName,'fe','-v7.3','-append'); 0036 else 0037 save(fName,'fe','-v7.3'); 0038 end 0039 0040 return