Changeset 41 for trunk/src/series
- Timestamp:
- Mar 10, 2010, 11:03:36 AM (15 years ago)
- Location:
- trunk/src/series
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/aver_stat.m
r38 r41 32 32 WaitbarPos=get(hseries.waitbar_frame,'Position'); 33 33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 35 %projection object 36 test_object=get(hseries.GetObject,'Value'); 37 if test_object%isfield(Series,'sethandles') 38 hset_object=findobj(allchild(0),'Name','set_object'); 39 ProjObject=read_set_object(guidata(hset_object)); 40 %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]}); 41 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style ' before averaging']); 42 if ~isequal(answeryes,'Yes') 43 return 44 end 45 end 46 34 47 %root input file and type 35 48 if ~iscell(Series.RootPath)% case of a single input field series … … 145 158 end 146 159 if ~isequal(FieldName,{'get_field...'}) 160 if isequal(FieldName,{''}) && ~testima 161 msgbox_uvmat('ERROR','an input field needs to be selected') 162 return 163 end 147 164 testcivx=testnc; 148 165 end … … 235 252 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 236 253 subdir_result='aver_stat'; 237 % filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1});238 % if isempty(SubDir{1}) % create a subdirectory '/aver_stat'239 % subdir_result='aver_stat';240 % filebasemean=fullfile(RootPath{1},subdir_result);241 254 if ~exist(fullfile(RootPath{1},subdir_result),'dir') 242 255 dircur=pwd; %record current working directory … … 249 262 end 250 263 filebase_out=filebase{1}; 251 % else252 % subdir_result=SubDir{1};253 % filebase_out=[filebase{1} '_mean'];% output root name obtained by adding the suffix _mean to the input254 % end255 %output nomtype (to generalise)256 264 NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1)); 257 258 % if NbSlice==1259 % filebase_out=[filebasesub '_mean'];260 % else261 % filebase_out=[filebasesub '_' NbSlice_name 'mean'];262 % answeryes=questdlg({['will make average in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});263 % if ~isequal(answeryes,'Yes')264 % return265 % end266 % end267 265 268 266 % coordinate transform or other user defined transform 269 Coord_menu=get(hseries.CoordType,'String'); 270 menu_val=get(hseries.CoordType,'Value'); 271 usrfct=Coord_menu{menu_val};272 testfct=~isequal(usrfct,''); 267 transform_fct=[];%default 268 if isfield(Series,'transform_fct') 269 transform_fct=Series.transform_fct; 270 end 273 271 274 272 %slice loop … … 312 310 end 313 311 % coordinate transform (or other user defined transform) 314 if ~ise qual(Series.CoordType,'')312 if ~isempty(transform_fct) 315 313 % z index 316 314 if ~isempty(NbSlice_calib) … … 318 316 end 319 317 if nbview==2 320 [Data{1},Data{2}]= feval(Series.CoordType,Data{1},XmlData{1},Data{2},XmlData{2});318 [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2}); 321 319 if isempty(Data{2}) 322 320 Data(2)=[]; 323 321 end 324 322 else 325 Data{1}= feval(Series.CoordType,Data{1},XmlData);323 Data{1}=transform_fct(Data{1},XmlData); 326 324 end 327 325 end … … 338 336 Field=Data{1}; 339 337 end 340 if isfield(Series,'ProjObject')341 [Field,errormsg]=proj_field(Field, Series.ProjObject);338 if test_object 339 [Field,errormsg]=proj_field(Field,ProjObject); 342 340 if ~isempty(errormsg) 343 341 msgbox_uvmat('ERROR',['error in aver_stat/proj_field:' errormsg]) -
trunk/src/series/merge_proj.m
r29 r41 23 23 WaitbarPos=get(hseries.waitbar_frame,'Position'); %positiopn of waitbar frame 24 24 %------------------------------------------------- 25 26 %projection object 27 test_object=get(hseries.GetObject,'Value'); 28 if test_object 29 hset_object=findobj(allchild(0),'Name','set_object'); 30 ProjObject=read_set_object(guidata(hset_object)); 31 if ~isfield(ProjObject,'Style') 32 msgbox_uvmat('ERROR','Undefined projection object style') 33 return 34 end 35 if ~isequal(ProjObject.Style,'plane') 36 msgbox_uvmat('ERROR','The projection object must be a plane') 37 return 38 end 39 %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]}); 40 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style]); 41 if ~isequal(answeryes,'Yes') 42 return 43 end 44 end 25 45 26 46 %numbers of view fields (nbre of inputs in RootPath) … … 125 145 end 126 146 147 % coordinate transform or other user defined transform 148 transform_fct=[];%default 149 if isfield(Series,'transform_fct') 150 transform_fct=Series.transform_fct; 151 end 152 127 153 % Field and velocity type (the same for all views) 128 154 Field_str=get(hseries.FieldMenu,'String'); … … 170 196 testcivx=testnc; 171 197 end 198 172 199 %name of output files and directory: 173 200 % res_subdir=fullfile(Series.RootPath{1},[Series.SubDir{1} '_STAT']); … … 178 205 if isequal(length(RootPath),1) 179 206 fulldir=RootPath{1}; 180 subdir=' GRID';207 subdir='merge_proj'; 181 208 res_subdir=fullfile(fulldir,subdir); 182 209 else … … 209 236 filebasesub=fullfile(res_subdir,Series.RootFile{1}); 210 237 filebase_merge=fullfile(res_subdir,'merged');%root name for the merged files 211 212 %projection object213 if isfield(Series,'sethandles')214 if ishandle(Series.sethandles.set_object)215 Series.ProjObject=read_set_object(Series.sethandles);216 if ~isfield(Series.ProjObject,'Style')217 msgbox_uvmat('ERROR','Undefined projection object style')218 return219 end220 if ~isequal(Series.ProjObject.Style,'plane')221 msgbox_uvmat('ERROR','The projection object must be a plane')222 return223 end224 end225 end226 238 227 239 %MAIN LOOP … … 271 283 Field{iview}.ZIndex=mod(num_i1{iview}(ifile)-1,NbSlice_calib{1})+1; 272 284 end 273 if ~ise qual(transform,'')274 Field{iview}= feval(Series.CoordType,Field{iview},XmlData{iview});%transform to phys if requested285 if ~isempty(transform_fct) 286 Field{iview}=transform_fct(Field{iview},XmlData{iview});%transform to phys if requested 275 287 end 276 288 if testcivx … … 279 291 280 292 %projection on object (gridded plane) 281 if isfield(Series,'ProjObject')282 Field{iview}=proj_field(Field{iview}, Series.ProjObject);293 if test_object 294 Field{iview}=proj_field(Field{iview},ProjObject); 283 295 end 284 296 end -
trunk/src/series/relabel_i_j.m
r40 r41 29 29 nbfield2=size(XmlData.Time,2) 30 30 31 answer=msgbox_uvmat(' CONFIRMATION','apply image rescaling function levels.m')31 answer=msgbox_uvmat('INPUT_Y-N','apply image rescaling function levels.m') 32 32 test_level=isequal(answer,'Yes') 33 33 -
trunk/src/series/time_series.m
r38 r41 34 34 %projection object 35 35 test_object=get(hseries.GetObject,'Value'); 36 if test_object%isfield(Series,'sethandles') 37 Series.ProjObject=read_set_object(Series.sethandles); 36 if test_object 37 hset_object=findobj(allchild(0),'Name','set_object'); 38 ProjObject=read_set_object(guidata(hset_object)); 38 39 %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]}); 39 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' Series.ProjObject.Style]);40 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style]); 40 41 if ~isequal(answeryes,'Yes') 41 42 return … … 170 171 171 172 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 172 filebasesub=fullfile(RootPath{1},RootFile{1});173 if NbSlice==1174 filebase_out=[filebasesub '_time'];175 else176 filebase_out=[filebasesub '_' NbSlice_name 'mtim'];177 increment=num_i1{1}(2)-num_i1{1}(1);178 if ~isequal(increment,1) % if an increment is set179 answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']);180 else181 answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});182 end183 if ~isequal(answeryes,'Yes')184 return185 end186 end173 % filebasesub=fullfile(RootPath{1},RootFile{1}); 174 % if NbSlice==1 175 % filebase_out=[filebasesub '_time']; 176 % else 177 % filebase_out=[filebasesub '_' NbSlice_name 'mtim']; 178 % increment=num_i1{1}(2)-num_i1{1}(1); 179 % if ~isequal(increment,1) % if an increment is set 180 % answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']); 181 % else 182 % answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']}); 183 % end 184 % if ~isequal(answeryes,'Yes') 185 % return 186 % end 187 % end 187 188 VelType_str=get(hseries.VelTypeMenu,'String'); 188 189 VelType_val=get(hseries.VelTypeMenu,'Value'); … … 269 270 end 270 271 271 % image or scalar processing programme set by user 272 Coord_menu=get(hseries.CoordType,'String'); 273 menu_val=get(hseries.CoordType,'Value'); 274 usrfct=Coord_menu{menu_val}; 275 testfct=~isequal(usrfct,''); 272 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 273 subdir_result='time_series'; 274 % filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1}); 275 % if isempty(SubDir{1}) % create a subdirectory '/aver_stat' 276 % subdir_result='aver_stat'; 277 % filebasemean=fullfile(RootPath{1},subdir_result); 278 if ~exist(fullfile(RootPath{1},subdir_result),'dir') 279 dircur=pwd; %record current working directory 280 cd(RootPath{1})% goes to the iamge directory 281 [m1,m2,m3]=mkdir(subdir_result); 282 if ~isequal(m2,'') 283 msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation 284 end 285 cd(dircur) %back to the initial working directory 286 end 287 filebase_out=filebase{1}; 288 NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1)); 289 290 % coordinate transform or other user defined transform 291 transform_fct=[];%default 292 if isfield(Series,'transform_fct') 293 transform_fct=Series.transform_fct; 294 end 276 295 277 296 % to update: … … 331 350 end 332 351 end 333 % geometry transform or other user defined transform 334 if ~isequal(Series.CoordType,'') 352 353 % coordinate transform (or other user defined transform) 354 if ~isempty(transform_fct) 355 % z index 356 if ~isempty(NbSlice_calib) 357 Data{iview}.ZIndex=mod(num_i1{iview}(ifile)-1,NbSlice_calib{1})+1;%Zindex for phys transform 358 end 335 359 if nbview==2 336 [Data{1},Data{2}]= feval(Series.CoordType,Data{1},XmlData{1},Data{2},XmlData{2});360 [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2}); 337 361 if isempty(Data{2}) 338 362 Data(2)=[]; 339 363 end 340 364 else 341 Data{1}= feval(Series.CoordType,Data{1},XmlData{1});342 end 343 end 365 Data{1}=transform_fct(Data{1},XmlData); 366 end 367 end 344 368 if testcivx 345 369 Data{iview}=calc_field(FieldName,Data{iview});%calculate field (vort..) … … 354 378 Field=Data{1}; 355 379 end 356 if isfield(Series,'ProjObject') 357 Series.ProjObject 358 [Field,errormsg]=proj_field(Field,Series.ProjObject); 380 if test_object 381 [Field,errormsg]=proj_field(Field,ProjObject); 359 382 if ~isempty(errormsg) 360 383 msgbox_uvmat('ERROR',['error in time_series/proj_field:' errormsg]) … … 393 416 end 394 417 % check whether the variable ivar is a dimension variable 395 %index=Field.VarDimIndex{ivar};%dimension indices of the variable #ivar396 418 DimCell=Field.VarDimName{ivar}; 397 419 if ischar(DimCell) … … 416 438 if testsum(ivar)==2% test for recorded variable 417 439 eval(['VarVal=Field.' VarName ';']); 418 if isequal( Series.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode440 if isequal(ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode 419 441 if isempty(VarVal) 420 442 msgbox_uvmat('ERROR',['empty result at frame index ' num2str(num_i1{iview}(ifile))])
Note: See TracChangeset
for help on using the changeset viewer.