Changeset 397 for trunk/src/uvmat.m
- Timestamp:
- Apr 26, 2012, 8:59:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r389 r397 641 641 % --- Update information about a new field series (indices to scan, timing, 642 642 % calibration from an xml file, then refresh current plots 643 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType, MovieObject,index)643 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,index) 644 644 %------------------------------------------------------------------------ 645 645 %% define the relevant handles depending on the index (1=first file series, 2= second file series) … … 689 689 imainfo=[]; 690 690 ColorType='falsecolor'; %default 691 hhh=''; 692 if isequal(lower(FileExt),'.avi') %.avi file 691 hhh=[]; 692 UvData.MovieObject{index}=VideoObject; 693 if ~isempty(VideoObject) 694 imainfo=get(VideoObject); 693 695 testima=1; 694 imainfo=aviinfo([FileName]);695 nbfield=imainfo.NumFrames;696 696 nbfield_j=1; 697 set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FramesPerSecond) 'ms']);%display the elementary time interval in millisec698 XmlData.Time=(0:1/imainfo.FramesPerSecond:(imainfo.NumFrames-1)/imainfo.FramesPerSecond)';699 697 TimeUnit='s'; 700 hhh=which('mmreader'); 701 ColorType=imainfo.ImageType;%='truecolor' for color images 698 XmlData.Time=(0:1/imainfo.FrameRate:(imainfo.NumberOfFrames-1)/imainfo.FrameRate)'; 699 % % nbfield=imainfo.NumberOfFrames; 700 set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FrameRate) 'ms']);%display the elementary time interval in millisec 701 ColorType='truecolor'; 702 702 elseif ~isempty(FileExt(2:end))&&(~isempty(imformats(FileExt(2:end))) || isequal(FileExt,'.vol'))%&& isequal(NomType,'*')% multi-frame image 703 703 testima=1; 704 704 if ~isequal(SubDir,'') 705 RootFile=get(handles.RootFile,'String');705 RootFile=get(handles.RootFile,'String'); 706 706 imainfo=imfinfo([fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]); 707 707 else … … 712 712 nbfield=length(imainfo); 713 713 nbfield_j=1; 714 end 715 end 716 if ~strcmp(hhh,'')% if the function mmreader is found (recent version of matlab) 717 UvData.MovieObject{index}=mmreader([FileBase FileIndices FileExt]); 718 else 719 UvData.MovieObject{index}=[]; 714 end 720 715 end 721 716 if isfield(imainfo,'Width') && isfield(imainfo,'Height') … … 1923 1918 % num_i1,num_i2,num_j1,num_j2; frame indices 1924 1919 % Field: structure describing an optional input field (then replace the input file) 1920 1925 1921 function errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,Field) 1926 1922 %------------------------------------------------------------------------ … … 2224 2220 2225 2221 %% calculate scalar 2226 if (strcmp(FileType,'civdata')||strcmp(FileType,'civx'))&&~strcmp(ParamOut.FieldName,'velocity')&& ~strcmp(ParamOut.FieldName,'get_field...');% ~isequal(ParamOut.CivStage,0)%&&~isempty(FieldName)%2227 Field{1}=calc_field([{ParamOut.FieldName} {ParamOut.ColorVar}],Field{1},ParamOut.VelType);2228 end2229 if numel(Field)==2 && ~test_keepdata_1 && (strcmp(FileType,'civdata')||strcmp(FileType,'civx')) &&~strcmp(ParamOut.FieldName,'velocity') && ~strcmp(ParamOut_1.FieldName,'get_field...')2230 Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2},ParamOut_1.VelType);2231 end2222 % if (strcmp(FileType,'civdata')||strcmp(FileType,'civx'))&&~strcmp(ParamOut.FieldName,'velocity')&& ~strcmp(ParamOut.FieldName,'get_field...');% ~isequal(ParamOut.CivStage,0)%&&~isempty(FieldName)% 2223 % Field{1}=calc_field([{ParamOut.FieldName} {ParamOut.ColorVar}],Field{1}); 2224 % end 2225 % if numel(Field)==2 && ~test_keepdata_1 && (strcmp(FileType,'civdata')||strcmp(FileType,'civx')) &&~strcmp(ParamOut.FieldName,'velocity') && ~strcmp(ParamOut_1.FieldName,'get_field...') 2226 % Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2}); 2227 % end 2232 2228 2233 2229 %% combine the two input fields (e.g. substract velocity fields) … … 2450 2446 for imap=1:numel(IndexObj) 2451 2447 iobj=IndexObj(imap); 2452 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj}) ;% project field on the object2448 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj})% project field on the object 2453 2449 2454 2450 if ~isempty(errormsg) … … 4589 4585 delete(hset_object)% delete existing version of set_object 4590 4586 end 4587 if ~isfield(ObjectData,'Type')% default plane 4588 ObjectData.Type='plane'; 4589 end 4591 4590 hset_object=set_object(ObjectData,[],ZBounds); 4591 if get(handles.edit_object,'Value')% edit mode 4592 hhset_object=guidata(hset_object); 4593 set(hhset_object.PLOT,'Enable','on') 4594 end 4592 4595 4593 4596
Note: See TracChangeset
for help on using the changeset viewer.