Changeset 605


Ignore:
Timestamp:
Apr 5, 2013, 1:17:53 PM (8 years ago)
Author:
sommeria
Message:

bugs corrected to get an advancement bar with status

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r604 r605  
    417417%------------------------------------------------------------------------
    418418set(handles.REFRESH,'Visible','on')
     419set(handles.REFRESH_title,'Visible','on')
    419420iview=eventdata.Indices(1);
    420421view_set=get(handles.REFRESH,'UserData');
     
    432433set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red
    433434
    434 %update the output dir
    435 % SubDir=sort(InputTable(:,2)); %set of subdirectories sorted in alphabetical order
    436 % SubDirOut=SubDir{1};
    437 % if numel(SubDir)>1
    438 %     for ilist=2:numel(SubDir)
    439 %         SubDirOut=[SubDirOut '-' SubDir{ilist}];
    440 %     end
    441 % end
    442 % set(handles.OutputSubDir,'String',SubDirOut)
    443 
    444435%------------------------------------------------------------------------
    445436% --- Executes on button press in REFRESH.
     
    448439InputTable=get(handles.InputTable,'Data');
    449440view_set=get(handles.REFRESH,'UserData');
    450 set(handles.REFRESH,'BackgroundColor',[0.7 0.7 0.7])% set REFRESH  button to grey color
     441set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH  button to yellow color (indicate activation)
    451442drawnow
    452443for iview=view_set
     
    460451    end
    461452    if isempty(i1_series)
    462         [FileName, PathName, filterindex] = uigetfile( ...
     453        [FileName, PathName] = uigetfile( ...
    463454            {'*.xml;*.xls;*.png;*.tif;*.avi;*.AVI;*.nc', ' (*.xml,*.xls, *.png,*.tif, *.avi,*.nc)';
    464455            '*.xml',  '.xml files '; ...
     
    469460            '*.nc','.netcdf files'; ...
    470461            '*.*',  'All Files (*.*)'}, ...
    471             ['unvalid entry at line ' num2str(iview) ', pick a file'],RootPath);
     462            ['unvalid entry at line ' num2str(iview) ', pick a new input file'],RootPath);
    472463        fileinput=[PathName FileName];%complete file name
    473         if isempty(fileinput),return;end %abandon if the operation has been cancelled: no input from browser
     464        if isempty(fileinput) %abandon if the operation has been cancelled: no input from browser
     465            set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH  back to red color
     466            return;
     467        end
    474468        [path,name,ext]=fileparts(fileinput);
    475469        display_file_name(handles,fileinput,iview)
     
    478472    end
    479473end
    480 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH  button to grey color
    481474set(handles.REFRESH,'Visible','off')
     475set(handles.REFRESH_title,'Visible','off')
    482476set(handles.REFRESH,'UserData',[])
    483477
     
    14621456%% record nbre of output files and starting time for computation for status
    14631457StatusData=get(handles.status,'UserData');
     1458if isfield(StatusData,'OutputFileMode')
    14641459    switch StatusData.OutputFileMode
    14651460        case 'NbInput'
     
    14701465            StatusData.NbOutputFile=str2num(get(handles.num_NbSlice,'String'));
    14711466    end
     1467end
    14721468StatusData.TimeStart=now;
    14731469set(handles.status,'UserData',StatusData)
     
    27422738NbSlice=str2num(get(handles.num_NbSlice,'String'));
    27432739set(handles.num_NbProcess,'String',num2str(NbSlice))
    2744 
    2745 
  • trunk/src/series/aver_stat.m

    r598 r605  
    4343%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
    4444if isstruct(Param) && isequal(Param.Action.RUN,0)
    45     ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    46     ParamOut.WholeIndexRange='off';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    47     ParamOut.NbSlice='on'; ...%nbre of slices ('off' by default)
    48     ParamOut.VelType='two';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    49     ParamOut.FieldName='two';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    50     ParamOut.FieldTransform = 'on';...%can use a transform function
    51     ParamOut.ProjObject='on';...%can use projection object(option 'off'/'on',
    52     ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
     45    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     46    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     47    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
     48    ParamOut.VelType='two';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     49    ParamOut.FieldName='two';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     50    ParamOut.FieldTransform = 'on';%can use a transform function
     51    ParamOut.ProjObject='on';%can use projection object(option 'off'/'on',
     52    ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
    5353    ParamOut.OutputDirExt='.stat';%set the output dir extension
    54 return
     54    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
     55    filecell=get_file_series(Param);%check existence of the first input file
     56    if ~exist(filecell{1,1},'file')
     57        msgbox_uvmat('WARNING','the first input file does not exist')
     58    end
     59    return
    5560end
    5661
  • trunk/src/series/civ_series.m

    r604 r605  
    5959end
    6060
    61 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
    62 
    6361%% read input parameters from an xml file if input is a file name (batch mode)
    6462checkrun=1;
     
    6765    checkrun=0;
    6866end
     67
     68%% input files and indexing
     69NbField=1;
     70if isfield(Param,'InputTable')
     71    RootPath=Param.InputTable{1,1};
     72    RootFile=Param.InputTable{1,3};
     73    SubDir=Param.InputTable{1,2};
     74    NomType=Param.InputTable{1,4};
     75    FileExt=Param.InputTable{1,5};
     76    PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1;
     77    PairCiv2='';
     78    if isfield(Param.ActionInput.PairIndices,'ListPairCiv2')
     79        PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;
     80    end
     81    MaxIndex=cell2mat(Param.IndexRange.MaxIndex);
     82    MinIndex=cell2mat(Param.IndexRange.MinIndex);
     83    [filecell,i_series,tild,j_series]=get_file_series(Param);
     84    [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=...
     85        find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex,MaxIndex);
     86    if ~isempty(PairCiv2)
     87        [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=...
     88            find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex,MaxIndex);
     89        check_bounds=check_bounds | check_bounds_Civ2;
     90    end
     91    i1_series_Civ1=i1_series_Civ1(~check_bounds);
     92    i2_series_Civ1=i2_series_Civ1(~check_bounds);
     93    j1_series_Civ1=j1_series_Civ1(~check_bounds);
     94    j2_series_Civ1=j2_series_Civ1(~check_bounds);
     95    if ~isempty(j1_series_Civ1)
     96        FrameIndex_A_Civ1=j1_series_Civ1;
     97        FrameIndex_B_Civ1=j2_series_Civ1;
     98    else
     99        FrameIndex_A_Civ1=i1_series_Civ1;
     100        FrameIndex_B_Civ1=i2_series_Civ1;
     101    end
     102    if ~isempty(PairCiv2)
     103        i1_series_Civ2=i1_series_Civ2(~check_bounds);
     104        i2_series_Civ2=i2_series_Civ2(~check_bounds);
     105        j1_series_Civ2=j1_series_Civ2(~check_bounds);
     106        j2_series_Civ2=j2_series_Civ2(~check_bounds);
     107        if ~isempty(j1_series_Civ2)
     108            FrameIndex_A_Civ2=j1_series_Civ2;
     109            FrameIndex_B_Civ2=j2_series_Civ2;
     110        else
     111            FrameIndex_A_Civ2=i1_series_Civ2;
     112            FrameIndex_B_Civ2=i2_series_Civ2;
     113        end
     114    end
     115   
     116    NbField=numel(i1_series_Civ1);
     117    ImageTypeOptions={'image','multimage','mmreader','video'};
     118    [FileType_A,FileInfo,MovieObject_A]=get_file_type(filecell{1,1});
     119    FileType_B=FileType_A;
     120    MovieObject_B=MovieObject_A;
     121    if size(filecell,1)>=2 && ~strcmp(filecell{1,1},filecell{2,1})
     122        [FileType_B,FileInfo,MovieObject_B]=get_file_type(filecell{2,1});
     123        CheckImage_B=~isempty(find(strcmp(FileType,ImageTypeOptions)));% =1 for images
     124    end
     125end
     126
     127
     128%% Output directory
    69129OutputDir=[Param.OutputSubDir Param.OutputDirExt];
    70130
     
    81141check_patch1=0;%default
    82142
    83 % case of input Param set by an xml file (batch mode)
    84 if ischar(Param)
    85     Param=xml2struct(Param); %if Param is the name of an xml file, read this file as a Matlab structure
    86 end
    87 
    88 RootPath=Param.InputTable{1,1};
    89 RootFile=Param.InputTable{1,3};
    90 SubDir=Param.InputTable{1,2};
    91 NomType=Param.InputTable{1,4};
    92 FileExt=Param.InputTable{1,5};
    93 PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1;
    94 PairCiv2='';
    95 if isfield(Param.ActionInput.PairIndices,'ListPairCiv2')
    96     PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;
    97 end
    98 
    99 % option use with GUI series
    100 NbField=1;
    101 MovieObject_A=[];
    102 if isfield(Param,'InputTable')
    103     MaxIndex=cell2mat(Param.IndexRange.MaxIndex);
    104     MinIndex=cell2mat(Param.IndexRange.MinIndex);
    105     [filecell,i_series,tild,j_series]=get_file_series(Param);
    106     [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=...
    107         find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex,MaxIndex);
    108     if ~isempty(PairCiv2)
    109         [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=...
    110             find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex,MaxIndex);
    111         check_bounds=check_bounds | check_bounds_Civ2;
    112     end
    113     i1_series_Civ1=i1_series_Civ1(~check_bounds);
    114     i2_series_Civ1=i2_series_Civ1(~check_bounds);
    115     j1_series_Civ1=j1_series_Civ1(~check_bounds);
    116     j2_series_Civ1=j2_series_Civ1(~check_bounds);
    117     if ~isempty(j1_series_Civ1)
    118         FrameIndex_A_Civ1=j1_series_Civ1;
    119         FrameIndex_B_Civ1=j2_series_Civ1;
    120     else
    121         FrameIndex_A_Civ1=i1_series_Civ1;
    122         FrameIndex_B_Civ1=i2_series_Civ1;
    123     end
    124     if ~isempty(PairCiv2)
    125         i1_series_Civ2=i1_series_Civ2(~check_bounds);
    126         i2_series_Civ2=i2_series_Civ2(~check_bounds);
    127         j1_series_Civ2=j1_series_Civ2(~check_bounds);
    128         j2_series_Civ2=j2_series_Civ2(~check_bounds);
    129         if ~isempty(j1_series_Civ2)
    130             FrameIndex_A_Civ2=j1_series_Civ2;
    131             FrameIndex_B_Civ2=j2_series_Civ2;
    132         else
    133             FrameIndex_A_Civ2=i1_series_Civ2;
    134             FrameIndex_B_Civ2=i2_series_Civ2;
    135         end
    136     end
    137    
    138     NbField=numel(i1_series_Civ1);
    139     ImageTypeOptions={'image','multimage','mmreader','video'};
    140     [FileType_A,FileInfo,MovieObject_A]=get_file_type(filecell{1,1});
    141     FileType_B=FileType_A;
    142     MovieObject_B=MovieObject_A;
    143     if size(filecell,1)>=2 && ~strcmp(filecell{1,1},filecell{2,1})
    144         [FileType_B,FileInfo,MovieObject_B]=get_file_type(filecell{2,1});
    145         CheckImage_B=~isempty(find(strcmp(FileType,ImageTypeOptions)));% =1 for images
    146     end
    147 end
     143
     144
     145
    148146
    149147%%%%% MAIN LOOP %%%%%%
  • trunk/src/series/merge_proj.m

    r596 r605  
    4141function ParamOut=merge_proj(Param)
    4242
    43 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName
     43%% set the input elements needed on the GUI series when the function is selected in the menu ActionName
    4444if isstruct(Param) && isequal(Param.Action.RUN,0)
    4545    ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     
    5252    ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
    5353    ParamOut.OutputDirExt='.mproj';%set the output dir extension
     54    ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
     55    filecell=get_file_series(Param);%check existence of the first input file
     56    if ~exist(filecell{1,1},'file')
     57        msgbox_uvmat('WARNING','the first input file does not exist')
     58    elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject')
     59         msgbox_uvmat('WARNING','a projection object of type plane needs to be introduced for merge_proj')
     60    end
    5461return
    5562end
  • trunk/src/series/sub_background.m

    r599 r605  
    5656%% input preparation mode (no RUN)
    5757if isstruct(Param) && isequal(Param.Action.RUN,0)
    58     ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    59     ParamOut.WholeIndexRange='on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    60     ParamOut.NbSlice='on'; ...%nbre of slices ('off' by default)
    61     ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    62     ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    63     ParamOut.FieldTransform = 'off';...%can use a transform function
    64     ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on',
    65     ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
     58    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     59    ParamOut.WholeIndexRange='on';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     60    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
     61    ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     62    ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     63    ParamOut.FieldTransform = 'off';%can use a transform function
     64    ParamOut.ProjObject='off';%can use projection object(option 'off'/'on',
     65    ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
    6666    ParamOut.OutputDirExt='.sback';%set the output dir extension
    67    
     67    ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
     68    filecell=get_file_series(Param);%check existence of the first input file
    6869    %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
    6970   
    7071    %% root input file(s) and type
    71 %     RootPath=Param.InputTable(:,1);
    72 %     RootFile=Param.InputTable(:,3);
    73 %     SubDir=Param.InputTable(:,2);
    74 %     NomType=Param.InputTable(:,4);
    75 %     FileExt=Param.InputTable(:,5);
    7672    [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
     73    if ~exist(filecell{1,1},'file')
     74        msgbox_uvmat('WARNING','the first input file does not exist')
     75        return
     76    end
    7777    %%%%%%%%%%%%
    7878    % The cell array filecell is the list of input file names, while
  • trunk/src/series/time_series.m

    r599 r605  
    4444%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
    4545if isstruct(Param) && isequal(Param.Action.RUN,0)
    46     ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    47         ParamOut.WholeIndexRange='off';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    48         ParamOut.NbSlice='on'; ...%nbre of slices ('off' by default)
    49         ParamOut.VelType='two';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    50         ParamOut.FieldName='two';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    51         ParamOut.FieldTransform = 'on';...%can use a transform function
    52         ParamOut.ProjObject='on';...%can use projection object(option 'off'/'on',
    53         ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
    54         ParamOut.OutputDirExt='.tseries';%set the output dir extension
     46    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     47    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     48    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
     49    ParamOut.VelType='two';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     50    ParamOut.FieldName='two';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     51    ParamOut.FieldTransform = 'on';%can use a transform function
     52    ParamOut.ProjObject='on';%can use projection object(option 'off'/'on',
     53    ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
     54    ParamOut.OutputDirExt='.tseries';%set the output dir extension
     55    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
     56    filecell=get_file_series(Param);%check existence of the first input file
     57    if ~exist(filecell{1,1},'file')
     58        msgbox_uvmat('WARNING','the first input file does not exist')
     59    elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject')
     60        msgbox_uvmat('WARNING','a projection object  needs to be introduced for time_series')
     61    end
    5562    return
    5663end
Note: See TracChangeset for help on using the changeset viewer.