Changeset 824


Ignore:
Timestamp:
Nov 22, 2014, 12:15:53 AM (10 years ago)
Author:
sommeria
Message:

message

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r822 r824  
    28282828
    28292829% --------------------------------------------------------------------
    2830 function MenuImportParam_Callback(hObject, eventdata, handles)
    2831 %% use a starting file name for browserr
    2832 InputTable=get(handles.InputTable,'Data');
    2833 oldfile=InputTable{1,1};
    2834 if isempty(oldfile)
    2835     % use a file name stored in prefdir
    2836     dir_perso=prefdir;
    2837     profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    2838     if exist(profil_perso,'file')
    2839         h=load (profil_perso);
    2840         if isfield(h,'RootPath') && ischar(h.RootPath)
    2841             oldfile=h.RootPath;
    2842         end
    2843     end
    2844 end
    2845 filexml=uigetfile_uvmat('pick a xml parameter file',oldfile,'.xml');% get the xml file containing processing parameters
    2846 %proceed only if a file has been introduced by the browser
    2847 if ~isempty(filexml)
    2848     Param=xml2struct(filexml);% read the input xml file as a Matlab structure
    2849     % ask to stop current Action if button RUN is in action (another process is already running)
    2850     if isequal(get(handles.RUN,'Value'),1)
    2851         answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?');
    2852         if strcmp(answer,'Yes')
    2853             STOP_Callback(hObject, eventdata, handles)
    2854         else
    2855             return
    2856         end
    2857     end
    2858     Param.Action.RUN=0; %desactivate the input RUN=1
    2859     if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')
    2860         msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')
    2861         return
    2862     end
    2863     Param=rmfield(Param,'InputTable');% do not refresh Input files and index range
    2864     Param=rmfield(Param,'IndexRange'); 
    2865     fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters
    2866     SeriesData=get(handles.series,'UserData');
    2867     if isfield(Param,'InputFields')
    2868         ListField=Param.InputFields.FieldName;
    2869         set(handles.FieldName,'String',[ListField;{'get-field...'}])
    2870          set(handles.FieldName,'Value',1:numel(ListField))
    2871     end       
    2872     if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
    2873         set(handles.ActionInput,'Visible','on')
    2874         set(handles.ActionInput,'Value',0)
    2875         Param.ActionInput.ConfigSource=filexml;% record the source of config for future info
    2876         SeriesData.ActionInput=Param.ActionInput;
    2877     end
    2878     if isfield(Param,'ProjObject') %introduce projection object if relevant
    2879         SeriesData.ProjObject=Param.ProjObject;
    2880     end
    2881     set(handles.series,'UserData',SeriesData)
    2882     if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
    2883         set(handles.ProjObject,'String',Param.ProjObject.Name)
    2884         set(handles.ViewObject,'Visible','on')
    2885         set(handles.EditObject,'Visible','on')
    2886         set(handles.DeleteObject,'Visible','on')
    2887     else     
    2888         set(handles.ProjObject,'String','')
    2889         set(handles.ProjObject,'Visible','off')
    2890         set(handles.ViewObject,'Visible','off')
    2891         set(handles.EditObject,'Visible','off')
    2892         set(handles.DeleteObject,'Visible','off')     
    2893     end     
    2894     set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated
    2895 end
     2830% function MenuImportParam_Callback(hObject, eventdata, handles)
     2831% %% use a starting file name for browserr
     2832% InputTable=get(handles.InputTable,'Data');
     2833% oldfile=InputTable{1,1};
     2834% if isempty(oldfile)
     2835%     % use a file name stored in prefdir
     2836%     dir_perso=prefdir;
     2837%     profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     2838%     if exist(profil_perso,'file')
     2839%         h=load (profil_perso);
     2840%         if isfield(h,'RootPath') && ischar(h.RootPath)
     2841%             oldfile=h.RootPath;
     2842%         end
     2843%     end
     2844% end
     2845% filexml=uigetfile_uvmat('pick a xml parameter file',oldfile,'.xml');% get the xml file containing processing parameters
     2846% %proceed only if a file has been introduced by the browser
     2847% if ~isempty(filexml)
     2848%     Param=xml2struct(filexml);% read the input xml file as a Matlab structure
     2849%     % ask to stop current Action if button RUN is in action (another process is already running)
     2850%     if isequal(get(handles.RUN,'Value'),1)
     2851%         answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?');
     2852%         if strcmp(answer,'Yes')
     2853%             STOP_Callback(hObject, eventdata, handles)
     2854%         else
     2855%             return
     2856%         end
     2857%     end
     2858%     Param.Action.RUN=0; %desactivate the input RUN=1
     2859%     if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')
     2860%         msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')
     2861%         return
     2862%     end
     2863%     Param=rmfield(Param,'InputTable');% do not refresh Input files and index range
     2864%     Param=rmfield(Param,'IndexRange'); 
     2865%     fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters
     2866%     SeriesData=get(handles.series,'UserData');
     2867%     if isfield(Param,'InputFields')
     2868%         ListField=Param.InputFields.FieldName;
     2869%         set(handles.FieldName,'String',[ListField;{'get-field...'}])
     2870%          set(handles.FieldName,'Value',1:numel(ListField))
     2871%     end       
     2872%     if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
     2873%         set(handles.ActionInput,'Visible','on')
     2874%         set(handles.ActionInput,'Value',0)
     2875%         Param.ActionInput.ConfigSource=filexml;% record the source of config for future info
     2876%         SeriesData.ActionInput=Param.ActionInput;
     2877%     end
     2878%     if isfield(Param,'ProjObject') %introduce projection object if relevant
     2879%         SeriesData.ProjObject=Param.ProjObject;
     2880%     end
     2881%     set(handles.series,'UserData',SeriesData)
     2882%     if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
     2883%         set(handles.ProjObject,'String',Param.ProjObject.Name)
     2884%         set(handles.ViewObject,'Visible','on')
     2885%         set(handles.EditObject,'Visible','on')
     2886%         set(handles.DeleteObject,'Visible','on')
     2887%     else     
     2888%         set(handles.ProjObject,'String','')
     2889%         set(handles.ProjObject,'Visible','off')
     2890%         set(handles.ViewObject,'Visible','off')
     2891%         set(handles.EditObject,'Visible','off')
     2892%         set(handles.DeleteObject,'Visible','off')     
     2893%     end     
     2894%     set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated
     2895% end
    28962896
    28972897
     
    33333333%------------------------------------------------------------------------
    33343334Mode_Callback([],[])
    3335 
    3336 
  • trunk/src/series/civ_input.m

    r822 r824  
    20992099
    21002100% handles    structure with handles and user data (see GUIDATA)
     2101
     2102
     2103% --- Executes on button press in InportParam.
     2104function InportParam_Callback(hObject, eventdata, handles)
     2105hseries=findobj(allchild(0),'Tag','series');
     2106hhseries=guidata(hseries);
     2107InputTable=get(hhseries.InputTable,'Data');% read the input file(s) table in the GUI series
     2108oldfile=InputTable{1,1};
     2109if isempty(oldfile)
     2110    % use a file name stored in prefdir
     2111    dir_perso=prefdir;
     2112    profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     2113    if exist(profil_perso,'file')
     2114        h=load (profil_perso);
     2115        if isfield(h,'RootPath') && ischar(h.RootPath)
     2116            oldfile=h.RootPath;
     2117        end
     2118    end
     2119end
     2120filexml=uigetfile_uvmat('pick a xml parameter file for civ',oldfile,'.xml');% get the xml file containing processing parameters
     2121%proceed only if a file has been introduced by the browser
     2122if ~isempty(filexml)
     2123    Param=xml2struct(filexml);% read the input xml file as a Matlab structure
     2124
     2125   % Param.Action.RUN=0; %desactivate the input RUN=1
     2126    if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')
     2127        msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')
     2128        return
     2129    end
     2130    check_input=0;
     2131    if isfield(Param,'ActionInput')
     2132        if isfield(Param.ActionInput,'Program')&& strcmp(Param.ActionInput.Program,'civ_series')
     2133            fill_GUI(Param.ActionInput,handles.civ_input)% fill the elements of the GUI series with the input parameters
     2134            check_input=1;
     2135            update_CivOptions(handles,0)
     2136               
     2137        end
     2138    end
     2139    if ~check_input
     2140        msgbox_uvmat('ERROR','invalid config file (not for civ_series')
     2141        return
     2142    end
     2143%     Param=rmfield(Param,'InputTable');% do not refresh Input files and index range
     2144%     Param=rmfield(Param,'IndexRange'); 
     2145%     fill_GUI(Param,handles.civ_input)% fill the elements of the GUI series with the input parameters
     2146% %     SeriesData=get(h,'UserData');
     2147%     if isfield(Param,'InputFields')
     2148%         ListField=Param.InputFields.FieldName;
     2149%         set(handles.FieldName,'String',[ListField;{'get-field...'}])
     2150%          set(handles.FieldName,'Value',1:numel(ListField))
     2151%     end       
     2152%     if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
     2153%         set(handles.ActionInput,'Visible','on')
     2154%         set(handles.ActionInput,'Value',0)
     2155%         Param.ActionInput.ConfigSource=filexml;% record the source of config for future info
     2156%         SeriesData.ActionInput=Param.ActionInput;
     2157%     end
     2158%     if isfield(Param,'ProjObject') %introduce projection object if relevant
     2159%         SeriesData.ProjObject=Param.ProjObject;
     2160%     end
     2161%     set(handles.series,'UserData',SeriesData)
     2162%     if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
     2163%         set(handles.ProjObject,'String',Param.ProjObject.Name)
     2164%         set(handles.ViewObject,'Visible','on')
     2165%         set(handles.EditObject,'Visible','on')
     2166%         set(handles.DeleteObject,'Visible','on')
     2167%     else     
     2168%         set(handles.ProjObject,'String','')
     2169%         set(handles.ProjObject,'Visible','off')
     2170%         set(handles.ViewObject,'Visible','off')
     2171%         set(handles.EditObject,'Visible','off')
     2172%         set(handles.DeleteObject,'Visible','off')     
     2173%     end     
     2174%     set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated
     2175end
  • trunk/src/series/civ_series.m

    r822 r824  
    131131            PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1;
    132132            if isfield(Param.ActionInput.PairIndices,'ListPairCiv2')
    133                 PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;
     133                PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;%string which determines the civ2 pair
    134134            end
    135135            if iview_A==1% if Civ1 is performed
     
    157157%             j2_series_Civ1=j2_series_Civ1(~check_bounds);
    158158        case 'displacement'
    159             i1_series_Civ1=Param.ActionInput.OriginIndex*ones(size(i_series{1}));
    160             i2_series_Civ1=i_series{1};i2_series_Civ2=i_series{1};
    161             j1_series_Civ1=ones(size(i_series{1}));% first j index is 1
     159            i1_series_Civ1=Param.ActionInput.OriginIndex*ones(size(i1_series{1}));
     160            i2_series_Civ1=i1_series{1};i2_series_Civ2=i1_series{1};
     161            j1_series_Civ1=ones(size(i1_series{1}));% first j index is 1
    162162            if isempty(j1_series_Civ1)
    163                 j2_series_Civ1=ones(size(i_series{1}));
     163                j2_series_Civ1=ones(size(i1_series{1}));
    164164            else
    165165                j2_series_Civ1=j1_series_Civ1;
     
    170170            NomTypeNc=NomType;
    171171        case 'shift'
    172             i1_series_Civ1=i_series{1};i1_series_Civ2=i_series{1};
    173             i2_series_Civ1=i_series{1};i2_series_Civ2=i_series{1};
    174             if isempty(j_series{1})
    175                 j1_series_Civ1=ones(size(i_series{1}));
    176                 j2_series_Civ1=ones(size(i_series{1}));
     172            i1_series_Civ1=i1_series{1};i1_series_Civ2=i1_series{1};
     173            i2_series_Civ1=i1_series{2};i2_series_Civ2=i1_series{2};
     174            if isempty(j1_series{1})
     175                j1_series_Civ1=ones(size(i1_series{1}));
     176                j2_series_Civ1=ones(size(i1_series{2}));
    177177            else
    178                 j1_series_Civ1=j_series{1};
    179                 j2_series_Civ1=j_series{1};
     178                j1_series_Civ1=j1_series{1};
     179                j2_series_Civ1=j1_series{2};
    180180            end
    181181            j1_series_Civ2=j1_series_Civ1;
     
    192192        FrameIndex_B_Civ1=j2_series_Civ1;
    193193    end
    194     if ~isempty(PairCiv2)
    195 %         i1_series_Civ2=i1_series_Civ2(~check_bounds);
    196 %         i2_series_Civ2=i2_series_Civ2(~check_bounds);
    197 %         j1_series_Civ2=j1_series_Civ2(~check_bounds);
    198 %         j2_series_Civ2=j2_series_Civ2(~check_bounds);
     194    if isempty(PairCiv2)
     195            FrameIndex_A_Civ2=FrameIndex_A_Civ1;
     196            FrameIndex_B_Civ2=FrameIndex_B_Civ1;
     197    else
    199198        if isempty(j1_series_Civ2)
    200199            FrameIndex_A_Civ2=i1_series_Civ2;
  • trunk/src/series/extract_rdvision.m

    r810 r824  
    117117    return
    118118end
     119if exist(fullfile(RootPath{1},OutputDir),'dir')
     120     msgbox_uvmat('ERROR',['output folder ' OutputDir ' already exists, put data in a new folder Experiment']);
     121     return
     122end
    119123
    120124%% calibration data and timing: read the ImaDoc files
     
    198202    ImageName='img_1.png';
    199203end
    200 
     204 
    201205%update information of 'Heading'
    202206uid_Heading=find(t,'ImaDoc/Heading');
  • trunk/src/series/turb_stat.m

    r810 r824  
    221221        Uprev=Field.U;
    222222        Vprev=Field.V;
     223        if isfield(Field,'FF')
    223224        FFprev=Field.FF;
     225        else
     226            FFprev=true(size(Field.U));
     227        end
    224228    end
    225229    FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U
  • trunk/src/uigetfile_uvmat.m

    r809 r824  
    147147htitlebox=findobj(hfig,'tag','titlebox');  % display the current dir name 
    148148DirName=get(htitlebox,'String');
    149 
     149if isempty(regexp(DirName,'^http://'))% if the input dir is not a web site (begins by http://)
     150%     FullSelectName=DirName;
     151% else
    150152if ~strcmp(filter_ext,'uigetdir')% a file is expected as output, not a dir
    151153    hlist=findobj(hfig,'Tag','list');
     
    162164    end
    163165    FullSelectName=fullfile(DirName,SelectName);
     166    % if regexp(DirName,'^http://')% if the input dir is a web site (begins by http://)
     167
    164168    if exist(FullSelectName,'file')
    165169        switch option
     
    181185    end
    182186end
     187end
    183188set(hObject,'backgroundColor',[0 1 0])% indicate end button activation
    184189uiresume(get(hObject,'parent'))
     
    313318NumFiles=0; %default
    314319if numel(ListStruct)<1  % case of empty dir
     320%     if regexp(DirName,'^http://')% if the input dir is a web site (begins by http://)
     321%         web(DirName)
     322%     else
    315323    ListFiles={};
    316324    return
     325%     end
    317326end
    318327ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
Note: See TracChangeset for help on using the changeset viewer.