Changeset 526 for trunk/src/series/time_series.m
- Timestamp:
- Aug 20, 2012, 12:32:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/time_series.m
r524 r526 63 63 end 64 64 65 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT)%%%%%%%%%%%%65 %%%%%%%%%%%% STANDARD PART %%%%%%%%%%%% 66 66 %% select different modes, RUN, parameter input, BATCH 67 67 % BATCH case: read the xml file for batch case … … 87 87 NomType=Param.InputTable(:,4); 88 88 FileExt=Param.InputTable(:,5); 89 90 % get the set of input file names (cell array filecell), and the lists of91 % input file or frame indices i1_series,i2_series,j1_series,j2_series92 89 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 93 % filecell{iview,fileindex}: cell array representing the list of file names 90 %%%%%%%%%%%% 91 % The cell array filecell is the list of input file names, while 92 % filecell{iview,fileindex}: 94 93 % iview: line in the table corresponding to a given file series 95 94 % fileindex: file index within the file series, 96 95 % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j 97 96 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 98 % set of frame indices used for movie or multimage input 99 % numbers of slices and file indices 100 97 %%%%%%%%%%%% 101 98 NbSlice=1;%default 102 99 if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice) … … 138 135 139 136 %% coordinate transform or other user defined transform 140 transform_fct= '';%default137 transform_fct=[];%default 141 138 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 142 139 addpath(Param.FieldTransform.TransformPath) … … 148 145 % EDIT FROM HERE 149 146 150 %% check the validity of input file types147 %% check the validity of ctinput file types 151 148 if CheckImage{1} 152 149 FileExtOut='.png'; % write result as .png images for image inputs … … 162 159 end 163 160 NomTypeOut='_1-2_1';% output file index will indicate the first and last ref index in the series 164 % if NbSlice~=nbfield_j165 % answer=_uvmat('INPUT_Y-N',['will not average slice by slice: for so cancel and set NbSlice= ' num2str(nbfield_j)]);166 % if ~strcmp(answer,'Yes')167 % return168 % end169 % end170 161 if checkrun==1 171 162 return % stop here for input checks … … 189 180 end 190 181 end 191 %%% TO UPDATE192 if isequal(InputFields{1},'get_field...')193 hget_field=findobj(allchild(0),'name','get_field');%find the get_field... GUI194 if numel(hget_field)>1195 delete(hget_field(2:end)) % delete multiple occurerence of the GUI get_fioeld196 elseif isempty(hget_field)197 filename=filecell{1,1};198 % filename=name_generator(filebase{1},i1_series{1}(1),j1_series{1}(1),FileExt{1},NomType{1},1,i2_series{1}(1),num_j2{1}(1),SubDir{1});199 idetect(iview)=exist(filename,'file');200 hget_field=get_field(filename);201 return202 end203 SubField=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI204 if isempty(SubField)205 delete(hget_field)206 filename=filecell{1,1};207 %filename=name_generator(filebase{1},i1_series{1}(1),j1_series{1}(1),FileExt{1},NomType{1},1,i2_series{1}(1),j2_series{1}(1),SubDir{1});208 hget_field=get_field(filename);209 SubField=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI210 end211 end212 %%%%%%%213 182 214 183 %% Initiate output fields … … 255 224 stopstate='queue'; 256 225 end 257 258 %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%259 226 if isequal(stopstate,'queue')% enable STOP command 260 227 Data=cell(1,nbview);%initiate the set Data 261 228 nbtime=0; 262 229 dt=[]; 263 % loop on views (in case of multiple input series)230 %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%% 264 231 for iview=1:nbview 265 232 % reading input file(s) 266 [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview}, Param.InputFields,frame_index{iview}(index));233 [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},InputFields{iview},frame_index{iview}(index)); 267 234 if ~isempty(errormsg) 268 235 errormsg=['time_series/read_field/' errormsg]; … … 280 247 end 281 248 249 Field=Data{1}; % default input field structure 282 250 % coordinate transform (or other user defined transform) 283 251 if ~isempty(transform_fct) 284 if nbview==2 285 [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2}); 286 if isempty(Data{2}) 287 Data(2)=[]; 288 end 289 else 290 Data{1}=transform_fct(Data{1},XmlData{1}); 291 end 292 end 293 294 % field substration (for two input file series) 295 if length(Data)==2 296 [Field,errormsg]=sub_field(Data{1},Data{2}); %substract the two fields 297 else 298 Field=Data{1}; 299 end 252 switch nargin(transform_fct) 253 case 4 254 if length(Data)==2 255 Field=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2}); 256 else 257 Field=transform_fct(Data{1},XmlData{1}); 258 end 259 case 3 260 if length(Data)==2 261 Field=transform_fct(Data{1},XmlData{1},Data{2}); 262 else 263 Field=transform_fct(Data{1},XmlData{1}); 264 end 265 case 2 266 Field=transform_fct(Data{1},XmlData{1}); 267 case 1 268 Field=transform_fct(Data{1}); 269 end 270 end 271 272 % calculate tps coefficients if needed 273 if isfield(Param.ProjObject,'ProjMode')&& strcmp(Param.ProjObject.ProjMode,'filter') 274 Field=calc_tps(Field,check_proj_tps); 275 end 276 277 %field projection on an object 300 278 if Param.CheckObject 301 279 [Field,errormsg]=proj_field(Field,Param.ProjObject); 280 if ~isempty(errormsg) 281 msgbox_uvmat('ERROR',['error in aver_stat/proj_field:' errormsg]) 282 return 283 end 302 284 end 303 285 nbfile=nbfile+1;
Note: See TracChangeset
for help on using the changeset viewer.