- Timestamp:
- Jun 26, 2012, 8:41:27 AM (12 years ago)
- Location:
- trunk/src/series
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/aver_stat.m
r474 r478 71 71 % RUN case: parameters introduced as the input structure Param 72 72 else 73 hseries=guidata(Param.hseries);%handles of the GUI series74 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series75 73 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 76 74 checkrun=1;% will only search interactive input parameters (preparation of BATCH mode) … … 78 76 checkrun=2; % indicate the RUN option is used 79 77 end 78 hseries=guidata(Param.hseries);%handles of the GUI series 80 79 end 81 80 ParamOut=Param; %default output … … 137 136 %% coordinate transform or other user defined transform 138 137 transform_fct='';%default 139 if isfield(Param,'FieldTransform') 138 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 140 139 addpath(Param.FieldTransform.TransformPath) 141 140 transform_fct=str2func(Param.FieldTransform.TransformName); … … 192 191 for index=index_slice 193 192 if checkrun 194 update_waitbar(hseries. waitbar_frame,WaitbarPos,index/(nbfield))193 update_waitbar(hseries.Waitbar,index/(nbfield)) 195 194 stopstate=get(hseries.RUN,'BusyAction'); 196 195 else … … 229 228 230 229 % field calculation (vort, div...) 231 if strcmp(FileType{1},'civx')||strcmp(FileType{1},'civ ')230 if strcmp(FileType{1},'civx')||strcmp(FileType{1},'civdata') 232 231 Data{1}=calc_field(InputFields{1}.FieldName,Data{1});%calculate field (vort..) 233 232 end -
trunk/src/series/check_data_files.m
r470 r478 49 49 end 50 50 51 %% get input parameters, file names and indices 51 %%%%%%%%%%%% STANDARD PART %%%%%%%%%%%% 52 %% select different modes, RUN, parameter input, BATCH 52 53 % BATCH case: read the xml file for batch case 54 if ischar(Param) 55 Param=xml2struct(Param); 56 checkrun=0; 57 % RUN case: parameters introduced as the input structure Param 58 else 59 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 60 checkrun=1;% will only search interactive input parameters (preparation of BATCH mode) 61 else 62 checkrun=2; % indicate the RUN option is used 63 end 64 hseries=guidata(Param.hseries);%handles of the GUI series 65 end 53 66 ParamOut=Param; %default output 54 if ischar(Param) && ~isempty(find(regexp('Param','.xml$'))) 55 Param=xml2struct(Param); 56 checkrun=0; 57 % RUN case: parameters introduced as the input structure Param 58 else 59 hseries=guidata(Param.hseries);%handles of the GUI series 60 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series 61 checkrun=1; % indicate the RUN option is used 62 end 63 % get the set of input file names (cell array filecell), and the lists of 64 % input file or frame indices i1_series,i2_series,j1_series,j2_series 65 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 66 % filecell{iview,fileindex}: cell array representing the list of file names 67 % iview: line in the table corresponding to a given file series 68 % fileindex: file index within the file series, 69 % 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 70 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 71 % set of frame indices used for movie or multimage input 72 if ~isempty(j1_series) 73 frame_index=j1_series; 74 else 75 frame_index=i1_series; 76 end 77 67 %OutputDir=[Param.OutputSubDir Param.OutputDirExt];NO OUTPUT FILE 68 78 69 %% root input file(s) and type 79 70 RootPath=Param.InputTable(:,1); … … 82 73 NomType=Param.InputTable(:,4); 83 74 FileExt=Param.InputTable(:,5); 84 85 % numbers of slices and file indices 75 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 76 %%%%%%%%%%%% 77 % The cell array filecell is the list of input file names, while 78 % filecell{iview,fileindex}: 79 % iview: line in the table corresponding to a given file series 80 % fileindex: file index within the file series, 81 % 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 82 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 83 %%%%%%%%%%%% 86 84 NbSlice=1;%default 87 if isfield(Param.IndexRange,'NbSlice') 85 if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice) 88 86 NbSlice=Param.IndexRange.NbSlice; 89 87 end 90 88 nbview=numel(i1_series);%number of input file series (lines in InputTable) 91 nbfield_j=size(i1_series{1},1); %nb of consecutive fields at each level(burst 92 nbfield=nbfield_j*size(i1_series{1},2); %total number of files or frames 93 nbfield_i=floor(nbfield/NbSlice);%total number of i indexes (adjusted to an integer number of slices) 94 nbfield=nbfield_i*nbfield_j; %total number of fields after adjustement 89 nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices) 90 nbfield_i=size(i1_series{1},2); %nb of fields for the i index 91 nbfield=nbfield_j*nbfield_i; %total number of fields 92 nbfield_i=floor(nbfield/NbSlice);%total number of indexes in a slice (adjusted to an integer number of slices) 93 nbfield=nbfield_i*NbSlice; %total number of fields after adjustement 95 94 96 95 %determine the file type on each line from the first input file … … 123 122 stopstate=get(hseries.RUN,'BusyAction'); 124 123 if isequal(stopstate,'queue')% enable STOP command 125 update_waitbar(hseries. waitbar_frame,WaitbarPos,ifile/nbfield_i)124 update_waitbar(hseries.Waitbar,ifile/nbfield_i) 126 125 file=filecell{iview,index_slice(ifile)}; 127 126 [Path,Name,ext]=fileparts(file); -
trunk/src/series/ima_levels.m
r457 r478 70 70 else 71 71 hseries=guidata(Param.hseries);%handles of the GUI series 72 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series73 72 checkrun=2; % indicate the RUN option is used 74 73 end … … 155 154 for ifile=1:nbfield 156 155 if checkrun 157 update_waitbar(hseries. waitbar_frame,WaitbarPos,ifile/nbfield)156 update_waitbar(hseries.Waitbar,ifile/nbfield) 158 157 stopstate=get(hseries.RUN,'BusyAction'); 159 158 else -
trunk/src/series/merge_proj.m
r474 r478 73 73 else 74 74 hseries=guidata(Param.hseries);%handles of the GUI series 75 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series76 75 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 77 76 checkrun=1;% will only search interactive input parameters (preparation of BATCH mode) … … 139 138 %% coordinate transform or other user defined transform 140 139 transform_fct='';%default 141 if isfield(Param,'FieldTransform') 140 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 142 141 addpath(Param.FieldTransform.TransformPath) 143 142 transform_fct=str2func(Param.FieldTransform.TransformName); … … 183 182 184 183 if checkrun 185 update_waitbar(hseries. waitbar_frame,WaitbarPos,index/(nbfield))184 update_waitbar(hseries.Waitbar,index/(nbfield)) 186 185 stopstate=get(hseries.RUN,'BusyAction'); 187 186 else … … 213 212 end 214 213 % field calculation (vort, div...) 215 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civ ')214 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 216 215 Data{iview}=calc_field(Param.InputFields.FieldName,Data{iview});%calculate field (vort..) 217 216 end -
trunk/src/series/relabel_i_j.m
r462 r478 73 73 else 74 74 hseries=guidata(Param.hseries);%handles of the GUI series 75 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series76 75 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 77 76 checkrun=1;% will only search interactive input parameters (preparation of BATCH mode) … … 322 321 for ifile=1:nbfield 323 322 if checkrun 324 update_waitbar(hseries. waitbar_frame,WaitbarPos,ifile/nbfield)323 update_waitbar(hseries.Waitbar,ifile/nbfield) 325 324 stopstate=get(hseries.RUN,'BusyAction'); 326 325 else -
trunk/src/series/sub_background.m
r474 r478 80 80 else 81 81 hseries=guidata(Param.hseries);%handles of the GUI series 82 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series83 82 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 84 83 checkrun=1;% will search input parameters (preparation of BATCH mode) … … 179 178 prompt = {'volume scan mode (Yes/No)';'Number of images for the sliding background (MUST FIT IN COMPUTER MEMORY)';... 180 179 'the luminosity rank chosen to define the background (0.1=for dense particle seeding, 0.5 (median) for sparse particles'}; 181 dlg_title = ['get (slice by slice) a sliding background and substract to each image, result in subdir ' Param.OutputDir];180 dlg_title = ['get (slice by slice) a sliding background and substract to each image, result in subdir ' OutputDir]; 182 181 num_lines= 3; 183 182 def = { 'No';num2str(nbaver_init);'0.1'}; … … 361 360 if checkrun 362 361 stopstate=get(hseries.RUN,'BusyAction'); 363 update_waitbar(hseries. waitbar_frame,WaitbarPos,(ifield+(islice-1)*nbfield_i)/(nbfield_i*NbSlice))362 update_waitbar(hseries.Waitbar,(ifield+(islice-1)*nbfield_i)/(nbfield_i*NbSlice)) 364 363 else 365 364 stopstate='queue'; … … 440 439 end 441 440 442 %finish the waitbar443 if checkrun444 update_waitbar(hseries.waitbar,WaitbarPos,1)445 end446 447 441 448 442 function C=levels(A) -
trunk/src/series/time_series.m
r474 r478 72 72 else 73 73 hseries=guidata(Param.hseries);%handles of the GUI series 74 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series75 74 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 76 75 checkrun=1;% will only search interactive input parameters (preparation of BATCH mode) … … 140 139 %% coordinate transform or other user defined transform 141 140 transform_fct='';%default 142 if isfield(Param,'FieldTransform') 141 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 143 142 addpath(Param.FieldTransform.TransformPath) 144 143 transform_fct=str2func(Param.FieldTransform.TransformName); … … 169 168 % end 170 169 % end 170 if checkrun==1 171 return % stop here for input checks 172 end 171 173 172 174 %% Set field names and velocity types … … 242 244 for i_slice=1:NbSlice 243 245 index_slice=i_slice:NbSlice:nbfield;% select file indices of the slice 244 nbfile s=0;246 nbfile=0; 245 247 nbmissing=0; 246 248 … … 248 250 for index=index_slice 249 251 if checkrun 250 update_waitbar(hseries. waitbar_frame,WaitbarPos,index/(nbfield))252 update_waitbar(hseries.Waitbar,index/(nbfield)) 251 253 stopstate=get(hseries.RUN,'BusyAction'); 252 254 else … … 255 257 256 258 %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%% 257 Data=cell(1,nbview);%initiate the set Data258 nbtime=0;259 dt=[];260 259 if isequal(stopstate,'queue')% enable STOP command 260 Data=cell(1,nbview);%initiate the set Data 261 nbtime=0; 262 dt=[]; 261 263 % loop on views (in case of multiple input series) 262 264 for iview=1:nbview … … 277 279 end 278 280 end 281 279 282 % coordinate transform (or other user defined transform) 280 283 if ~isempty(transform_fct) … … 288 291 end 289 292 end 293 294 % field calculation (vort, div...) 295 if strcmp(FileType{1},'civx')||strcmp(FileType{1},'civdata') 296 Data{1}=calc_field(InputFields{1}.FieldName,Data{1});%calculate field (vort..) 297 end 298 299 % field substration (for two input file series) 290 300 if length(Data)==2 291 301 [Field,errormsg]=sub_field(Data{1},Data{2}); %substract the two fields … … 296 306 [Field,errormsg]=proj_field(Field,Param.ProjObject); 297 307 end 298 nb time=nbtime+1;308 nbfile=nbfile+1; 299 309 300 310 % initiate the time series at the first iteration 301 if nb time==1311 if nbfile==1 302 312 % stop program if the first field reading is in error 303 313 if ~isempty(errormsg) … … 356 366 if isequal(Param.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode 357 367 if isempty(VarVal) 358 displ_uvmat('ERROR',['empty result at frame index ' num2str(i1_series{iview}(i file))],checkrun)368 displ_uvmat('ERROR',['empty result at frame index ' num2str(i1_series{iview}(index))],checkrun) 359 369 return 360 370 end … … 378 388 if isempty(time)% time read in ncfiles 379 389 if isfield(Field,'Time') 380 DataOut.Time( filecounter,1)=Field.Time;390 DataOut.Time(nbfile,1)=Field.Time; 381 391 else 382 DataOut.Time( filecounter,1)=ifile;%default392 DataOut.Time(nbfile,1)=index;%default 383 393 end 384 394 else % time from ImaDoc prevails TODO: correct 385 % DataOut.Time(filecounter,1)=time{1}(i1_series{1})(ifile),j1_series{1}(ifile))+time(end,i2_series{end}(ifile),j2_series{end}(ifile)))/2; 386 DataOut.Time(filecounter,1)=i1_series{1}(ifile);% TODO : generalise 395 DataOut.Time(nbtime,1)=i1_series{1}(index);% TODO : generalise 387 396 end 388 397 … … 390 399 if ~isempty(errormsg) 391 400 nbmissing=nbmissing+1; 392 display(['i file=' num2str(ifile) ':' errormsg])401 display(['index=' num2str(index) ':' errormsg]) 393 402 end 394 403 end … … 452 461 453 462 %% plot the time series (the last one in case of multislices) 454 figure455 haxes=axes;456 463 if checkrun 457 plot_field(DataOut,haxes) 458 end 459 460 %% display the result file using the GUI get_field 461 hget_field=findobj(allchild(0),'name','get_field'); 462 if ~isempty(hget_field) 463 delete(hget_field) 464 end 465 get_field(OutputFile,DataOut) 466 467 468 464 figure 465 haxes=axes; 466 plot_field(DataOut,haxes) 467 468 %% display the result file using the GUI get_field 469 hget_field=findobj(allchild(0),'name','get_field'); 470 if ~isempty(hget_field) 471 delete(hget_field) 472 end 473 get_field(OutputFile,DataOut) 474 end 475 476
Note: See TracChangeset
for help on using the changeset viewer.