Changeset 397 for trunk/src/uvmat.m


Ignore:
Timestamp:
Apr 26, 2012, 8:59:09 AM (12 years ago)
Author:
sommeria
Message:

civ_matlab and patch improved, changes in the management of interpolation (still in progress).
adapatation to movies (use of VideoReader?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r389 r397  
    641641% --- Update information about a new field series (indices to scan, timing,
    642642%     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)
     643function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,index)
    644644%------------------------------------------------------------------------
    645645%% define the relevant handles depending on the index (1=first file series, 2= second file series)
     
    689689imainfo=[];
    690690ColorType='falsecolor'; %default
    691 hhh='';
    692 if isequal(lower(FileExt),'.avi') %.avi file
     691hhh=[];
     692UvData.MovieObject{index}=VideoObject;
     693if ~isempty(VideoObject)
     694    imainfo=get(VideoObject);
    693695    testima=1;
    694     imainfo=aviinfo([FileName]);
    695     nbfield=imainfo.NumFrames;
    696696    nbfield_j=1;
    697     set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FramesPerSecond) 'ms']);%display the elementary time interval in millisec
    698     XmlData.Time=(0:1/imainfo.FramesPerSecond:(imainfo.NumFrames-1)/imainfo.FramesPerSecond)';
    699697    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';
    702702elseif ~isempty(FileExt(2:end))&&(~isempty(imformats(FileExt(2:end))) || isequal(FileExt,'.vol'))%&& isequal(NomType,'*')% multi-frame image
    703703    testima=1;
    704704    if ~isequal(SubDir,'')
    705        RootFile=get(handles.RootFile,'String');
     705        RootFile=get(handles.RootFile,'String');
    706706        imainfo=imfinfo([fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]);
    707707    else
     
    712712        nbfield=length(imainfo);
    713713        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
    720715end
    721716if isfield(imainfo,'Width') && isfield(imainfo,'Height')
     
    19231918% num_i1,num_i2,num_j1,num_j2; frame indices
    19241919% Field: structure describing an optional input field (then replace the input file)
     1920
    19251921function errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,Field)
    19261922%------------------------------------------------------------------------
     
    22242220
    22252221%% 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 end
    2229 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 end
     2222% 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
    22322228
    22332229%% combine the two input fields (e.g. substract velocity fields)
     
    24502446for imap=1:numel(IndexObj)
    24512447    iobj=IndexObj(imap);
    2452     [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object
     2448    [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj})% project field on the object
    24532449
    24542450    if ~isempty(errormsg)
     
    45894585    delete(hset_object)% delete existing version of set_object
    45904586end
     4587if ~isfield(ObjectData,'Type')% default plane
     4588    ObjectData.Type='plane';
     4589end
    45914590hset_object=set_object(ObjectData,[],ZBounds);
     4591if get(handles.edit_object,'Value')% edit mode
     4592    hhset_object=guidata(hset_object);
     4593    set(hhset_object.PLOT,'Enable','on')
     4594end
    45924595
    45934596
Note: See TracChangeset for help on using the changeset viewer.