trackOptiGetErrorListDisk : creates a list of errors INPUT : dirname : seg folder eg. maindirectory/xy1/seg file_filter : regular expression of files default is '*err.mat'; OUTPUT : error_list : list of errors [fromFrame, toFrame, 1 if error] Copyright (C) 2016 Wiggins Lab Written by Paul Wiggins. University of Washington, 2016 This file is part of SuperSegger. SuperSegger is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SuperSegger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SuperSegger. If not, see <http://www.gnu.org/licenses/>.
0001 function error_list = trackOptiGetErrorListDisk(dirname,file_filter) 0002 % trackOptiGetErrorListDisk : creates a list of errors 0003 % 0004 % INPUT : 0005 % dirname : seg folder eg. maindirectory/xy1/seg 0006 % file_filter : regular expression of files default is '*err.mat'; 0007 % OUTPUT : 0008 % error_list : list of errors [fromFrame, toFrame, 1 if error] 0009 % 0010 % Copyright (C) 2016 Wiggins Lab 0011 % Written by Paul Wiggins. 0012 % University of Washington, 2016 0013 % This file is part of SuperSegger. 0014 % 0015 % SuperSegger is free software: you can redistribute it and/or modify 0016 % it under the terms of the GNU General Public License as published by 0017 % the Free Software Foundation, either version 3 of the License, or 0018 % (at your option) any later version. 0019 % 0020 % SuperSegger is distributed in the hope that it will be useful, 0021 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0022 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0023 % GNU General Public License for more details. 0024 % 0025 % You should have received a copy of the GNU General Public License 0026 % along with SuperSegger. If not, see <http://www.gnu.org/licenses/>. 0027 0028 0029 if ~exist('file_filter') || isempty(file_filter); 0030 file_filter = '*err.mat'; 0031 end 0032 0033 if(nargin<1 || isempty(dirname)) 0034 dirname=uigetdir() 0035 end 0036 dirname = fixDir(dirname); 0037 0038 contents=dir([dirname, file_filter]); 0039 num_im = length(contents); 0040 error_list = []; 0041 0042 for i = 1:num_im; 0043 data_c = loaderInternal([dirname,contents(i ).name]); 0044 for ii = 1: data_c.num_regs 0045 if data_c.errorr(ii) 0046 list = data_c.mr{ii}; 0047 try 0048 skip = data_c.errorf(ii) || data_c.errorr(ii); 0049 catch 0050 keyboard 0051 end 0052 error_list = [error_list; [i, ii, skip]]; 0053 0054 end 0055 end 0056 end 0057 error_list = error_list'; 0058 end 0059 0060 function data = loaderInternal( filename ) 0061 data = load( filename ); 0062 end