- Timestamp:
- Apr 5, 2013, 1:17:53 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r604 r605 417 417 %------------------------------------------------------------------------ 418 418 set(handles.REFRESH,'Visible','on') 419 set(handles.REFRESH_title,'Visible','on') 419 420 iview=eventdata.Indices(1); 420 421 view_set=get(handles.REFRESH,'UserData'); … … 432 433 set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red 433 434 434 %update the output dir435 % SubDir=sort(InputTable(:,2)); %set of subdirectories sorted in alphabetical order436 % SubDirOut=SubDir{1};437 % if numel(SubDir)>1438 % for ilist=2:numel(SubDir)439 % SubDirOut=[SubDirOut '-' SubDir{ilist}];440 % end441 % end442 % set(handles.OutputSubDir,'String',SubDirOut)443 444 435 %------------------------------------------------------------------------ 445 436 % --- Executes on button press in REFRESH. … … 448 439 InputTable=get(handles.InputTable,'Data'); 449 440 view_set=get(handles.REFRESH,'UserData'); 450 set(handles.REFRESH,'BackgroundColor',[ 0.7 0.7 0.7])% set REFRESH button to grey color441 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH button to yellow color (indicate activation) 451 442 drawnow 452 443 for iview=view_set … … 460 451 end 461 452 if isempty(i1_series) 462 [FileName, PathName , filterindex] = uigetfile( ...453 [FileName, PathName] = uigetfile( ... 463 454 {'*.xml;*.xls;*.png;*.tif;*.avi;*.AVI;*.nc', ' (*.xml,*.xls, *.png,*.tif, *.avi,*.nc)'; 464 455 '*.xml', '.xml files '; ... … … 469 460 '*.nc','.netcdf files'; ... 470 461 '*.*', '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); 472 463 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 474 468 [path,name,ext]=fileparts(fileinput); 475 469 display_file_name(handles,fileinput,iview) … … 478 472 end 479 473 end 480 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to grey color481 474 set(handles.REFRESH,'Visible','off') 475 set(handles.REFRESH_title,'Visible','off') 482 476 set(handles.REFRESH,'UserData',[]) 483 477 … … 1462 1456 %% record nbre of output files and starting time for computation for status 1463 1457 StatusData=get(handles.status,'UserData'); 1458 if isfield(StatusData,'OutputFileMode') 1464 1459 switch StatusData.OutputFileMode 1465 1460 case 'NbInput' … … 1470 1465 StatusData.NbOutputFile=str2num(get(handles.num_NbSlice,'String')); 1471 1466 end 1467 end 1472 1468 StatusData.TimeStart=now; 1473 1469 set(handles.status,'UserData',StatusData) … … 2742 2738 NbSlice=str2num(get(handles.num_NbSlice,'String')); 2743 2739 set(handles.num_NbProcess,'String',num2str(NbSlice)) 2744 2745 -
trunk/src/series/aver_stat.m
r598 r605 43 43 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName 44 44 if 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 function51 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) 53 53 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 55 60 end 56 61 -
trunk/src/series/civ_series.m
r604 r605 59 59 end 60 60 61 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%62 63 61 %% read input parameters from an xml file if input is a file name (batch mode) 64 62 checkrun=1; … … 67 65 checkrun=0; 68 66 end 67 68 %% input files and indexing 69 NbField=1; 70 if 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 125 end 126 127 128 %% Output directory 69 129 OutputDir=[Param.OutputSubDir Param.OutputDirExt]; 70 130 … … 81 141 check_patch1=0;%default 82 142 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 148 146 149 147 %%%%% MAIN LOOP %%%%%% -
trunk/src/series/merge_proj.m
r596 r605 41 41 function ParamOut=merge_proj(Param) 42 42 43 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName43 %% set the input elements needed on the GUI series when the function is selected in the menu ActionName 44 44 if isstruct(Param) && isequal(Param.Action.RUN,0) 45 45 ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) … … 52 52 ParamOut.Mask='off';...%can use mask option (option 'off'/'on', 'off' by default) 53 53 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 54 61 return 55 62 end -
trunk/src/series/sub_background.m
r599 r605 56 56 %% input preparation mode (no RUN) 57 57 if 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 function64 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) 66 66 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 68 69 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%% 69 70 70 71 %% 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);76 72 [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 77 77 %%%%%%%%%%%% 78 78 % The cell array filecell is the list of input file names, while -
trunk/src/series/time_series.m
r599 r605 44 44 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName 45 45 if 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 55 62 return 56 63 end
Note: See TracChangeset
for help on using the changeset viewer.