Changeset 89 for trunk/src/series
- Timestamp:
- May 20, 2010, 1:48:25 AM (15 years ago)
- Location:
- trunk/src/series
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/merge_proj.m
r78 r89 1 function GUI_input=merge_proj(num_i1,num_i2,num_j1,num_j2,Series) ;1 function GUI_input=merge_proj(num_i1,num_i2,num_j1,num_j2,Series) 2 2 3 3 %requests for the visibility of input windows in the GUI series (activated directly by the selection in the menu ACTION) … … 65 65 if ~isequal(hhh,'')&& mmreader.isPlatformSupported() 66 66 if isequal(lower(FileExt{iview}),'.avi') 67 MovieObject{iview}=mmreader(fullfile( RootPath{iview},[RootFile{iview}FileExt{iview}]));67 MovieObject{iview}=mmreader(fullfile(Series.RootPath{iview},[Series.RootFile{iview} Series.FileExt{iview}])); 68 68 test_movie(iview)=1; 69 69 end … … 117 117 %check coincidence in time 118 118 multitime=0; 119 if length(timecell)==0119 if isempty(timecell) 120 120 time=[]; 121 121 elseif length(timecell)==1 … … 160 160 if isequal(FieldName,'get_field...') 161 161 hget_field=findobj(allchild(0),'Name','get_field');%find the get_field... GUI 162 % hhget_field=guidata(hget_field);%handles of GUI elements in get_field163 162 SubField=get_field('read_get_field',hObject,eventdata,hget_field); %read the names of the variables to plot in the get_field GUI 164 % if isequal(get(hhget_field.menu_coord,'Visible'),'on')165 % list_transform=get(hhget_field.menu_coord,'String');166 % val_list=get(hhget_field.menu_coord,'Value');167 % transform=list_transform{val_list};168 % end169 163 end 170 164 %detect whether all the files are 'images' or 'netcdf' … … 176 170 for iview=1:nbview 177 171 ext=FileExt{iview}; 178 form=imformats(ext( [2:end]));172 form=imformats(ext(2:end)); 179 173 if isequal(lower(ext),'.vol') 180 174 testvol=testvol+1; … … 286 280 Field{iview}=transform_fct(Field{iview},XmlData{iview});%transform to phys if requested 287 281 end 282 min(Field{iview}.X) 288 283 if testcivx 289 284 Field{iview}=calc_field(FieldName,Field{iview}); 290 285 end 286 min(Field{iview}.X) 291 287 292 288 %projection on object (gridded plane) … … 386 382 error=1; 387 383 end 388 % if ~isequal(MergeData.VarDimIndex,Data{iview}.VarDimIndex)389 % error=1;390 % end391 384 end 392 385 if error … … 394 387 return 395 388 end 389 390 %group the variables (fields of 'FieldData') in cells of variables with the same dimensions 391 [CellVarIndex,NbDim,VarTypeCell]=find_field_indices(Data{1}); 392 %LOOP ON GROUPS OF VARIABLES SHARING THE SAME DIMENSIONS 393 % CellVarIndex=cells of variable index arrays 394 ivar_new=0; % index of the current variable in the projected field 395 icoord=0; 396 for icell=1:length(CellVarIndex) 397 if NbDim(icell)==1 398 continue 399 end 400 VarIndex=CellVarIndex{icell};% indices of the selected variables in the list FieldData.ListVarName 401 VarType=VarTypeCell{icell}; 402 ivar_X=VarType.coord_x; 403 ivar_Y=VarType.coord_y; 404 ivar_FF=VarType.errorflag; 405 if isempty(ivar_X) 406 test_grid=1;%test for input data on regular grid (e.g. image)coordinates 407 else 408 if length(ivar_Y)~=1 409 msgbox_uvmat('ERROR','y coordinate missing in proj_field.m') 410 return 411 end 412 test_grid=0; 413 end 414 % DimIndices=Data{1}.VarDimIndex{VarIndex(1)};%indices of the dimensions of the first variable (common to all variables in the cell) 415 %case of input fields with unstructured coordinates 416 if ~test_grid 417 for ivar=VarIndex 418 VarName=MergeData.ListVarName{ivar}; 419 for iview=1:nbview 420 eval(['MergeData.' VarName '=[MergeData.' VarName '; Data{iview}.' VarName '];']) 421 end 422 end 423 %case of fields defined on a structured grid 424 else 425 % DimValue=MergeData.DimValue(DimIndices);%set of dimension values 426 testFF=0; 427 for iview=2:nbview 428 % if ~isequal(DimValue,Data{iview}.DimValue(DimIndices)) 429 % MergeData.Txt='ERROR: attempt at merging structured fields with different sizes'; 430 % return 431 % end 432 for ivar=VarIndex 433 VarName=MergeData.ListVarName{ivar}; 434 if isfield(MergeData,'VarAttribute') 435 if length(MergeData.VarAttribute)>=ivar && isfield(MergeData.VarAttribute{ivar},'Role') && isequal(MergeData.VarAttribute{ivar}.Role,'errorflag') 436 testFF=1; 437 end 438 end 439 eval(['MergeData.' VarName '=MergeData.' VarName '+ Data{iview}.' VarName ';']) 440 end 441 end 442 if testFF 443 nbaver=nbview-MergeData.FF; 444 indgood=find(nbaver>0); 445 for ivar=VarIndex 446 VarName=MergeData.ListVarName{ivar}; 447 eval(['MergeData.' VarName '(indgood)=double(MergeData.' VarName '(indgood))./nbaver(indgood);']) 448 end 449 else 450 for ivar=VarIndex 451 VarName=MergeData.ListVarName{ivar}; 452 eval(['MergeData.' VarName '=double(MergeData.' VarName ')./nbview;']) 453 end 454 end 455 end 456 end 457 -
trunk/src/series/sub_background.m
r54 r89 65 65 FileType=[];%default 66 66 MovieObject=[]; 67 FileExt=Series.FileExt; 68 67 69 if isequal(lower(FileExt),'.avi') 68 70 hhh=which('mmreader'); … … 78 80 form=imformats(FileExt(2:end)); 79 81 if ~isempty(form)% if the extension corresponds to an image format recognized by Matlab 80 if isequal( NomType,'*');82 if isequal(Series.NomType,'*'); 81 83 FileType='multimage'; 82 84 else … … 237 239 ifile=indselect(ifield); 238 240 filename=name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt,Series.NomType); 239 Aread=read_image(filename,FileType,num_i1(ifile), movieobject);241 Aread=read_image(filename,FileType,num_i1(ifile),MovieObject); 240 242 Ak(:,:,ifield)=Aread; 241 243 end … … 272 274 ifile=indselect(ifield+step*floor(nbaver/2)+iburst-1); 273 275 filename=name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt,Series.NomType); 274 Aread=read_image(filename,FileType,num_i1(ifile), movieobject);276 Aread=read_image(filename,FileType,num_i1(ifile),MovieObject); 275 277 Ak(:,:,nbaver_ima-step+iburst)=Aread; 276 278 end … … 316 318 %------------------------------------------------------------------------ 317 319 %--read images and convert them to the uint16 format used for PIV 318 function A=read_image(filename,type_ima,num, movieobject)320 function A=read_image(filename,type_ima,num,MovieObject) 319 321 %------------------------------------------------------------------------ 320 322 %num is the view number needed for an avi movie 321 323 switch type_ima 322 324 case 'movie' 323 A=read( movieobject,num);325 A=read(MovieObject,num); 324 326 case 'avi' 325 327 mov=aviread(filename,num);
Note: See TracChangeset
for help on using the changeset viewer.