Changeset 474 for trunk/src/series/aver_stat.m
- Timestamp:
- Jun 25, 2012, 12:14:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/aver_stat.m
r470 r474 31 31 % each line decomposed as {RootPath,SubDir,Rootfile,NomType,Extension} 32 32 % .OutputSubDir: name of the subdirectory for data outputs 33 % .OutputDir : directory for data outputs, including path33 % .OutputDirExt: directory extension for data outputs 34 34 % .Action: .ActionName: name of the current activated function 35 35 % .ActionPath: path of the current activated function … … 50 50 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName 51 51 if ~exist('Param','var') % case with no input parameter 52 ParamOut={'NbViewMax';2;...% max nbre of input file series (default='' , no limitation) 53 'AllowInputSort';'off';...% allow alphabetic sorting of the list of input files (options 'off'/'on', 'off' by default) 52 ParamOut={'AllowInputSort';'off';...% allow alphabetic sorting of the list of input files (options 'off'/'on', 'off' by default) 54 53 'WholeIndexRange';'off';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 55 54 'NbSlice';'on'; ...%nbre of slices ('off' by default) … … 64 63 end 65 64 66 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT)%%%%%%%%%%%%65 %%%%%%%%%%%% STANDARD PART %%%%%%%%%%%% 67 66 %% select different modes, RUN, parameter input, BATCH 68 67 % BATCH case: read the xml file for batch case … … 81 80 end 82 81 ParamOut=Param; %default output 83 82 OutputDir=[Param.OutputSubDir Param.OutputDirExt]; 83 84 84 %% root input file(s) and type 85 85 RootPath=Param.InputTable(:,1); … … 88 88 NomType=Param.InputTable(:,4); 89 89 FileExt=Param.InputTable(:,5); 90 91 % get the set of input file names (cell array filecell), and the lists of92 % input file or frame indices i1_series,i2_series,j1_series,j2_series93 90 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 94 % filecell{iview,fileindex}: cell array representing the list of file names 91 %%%%%%%%%%%% 92 % The cell array filecell is the list of input file names, while 93 % filecell{iview,fileindex}: 95 94 % iview: line in the table corresponding to a given file series 96 95 % fileindex: file index within the file series, 97 96 % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j 98 97 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 99 % set of frame indices used for movie or multimage input 100 % numbers of slices and file indices 101 98 %%%%%%%%%%%% 102 99 NbSlice=1;%default 103 100 if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice) … … 140 137 %% coordinate transform or other user defined transform 141 138 transform_fct='';%default 142 if isfield(Param,'FieldTransform')&&isfield(Param.FieldTransform,'TransformHandle') 143 transform_fct=Param.FieldTransform.TransformHandle; 144 end 139 if isfield(Param,'FieldTransform') 140 addpath(Param.FieldTransform.TransformPath) 141 transform_fct=str2func(Param.FieldTransform.TransformName); 142 rmpath(Param.FieldTransform.TransformPath) 143 end 144 145 145 %%%%%%%%%%%% END STANDARD PART %%%%%%%%%%%% 146 146 % EDIT FROM HERE … … 160 160 end 161 161 NomTypeOut='_1-2_1';% output file index will indicate the first and last ref index in the series 162 if NbSlice~=nbfield_j 163 answer=msgbox_uvmat('INPUT_Y-N',['will not average slice by slice: for so cancel and set NbSlice= ' num2str(nbfield_j)]); 164 if ~strcmp(answer,'Yes') 165 return 166 end 162 if checkrun==1 163 return % stop here for input checks 167 164 end 168 165 … … 185 182 end 186 183 187 %% Initiate output fields188 % %initiate the output structure as a copy of the first input one (reproduce fields)189 % [DataOut,ParamOut,errormsg] = read_field(filecell{1,1},FileType{1},InputFields{1},1);190 % if ~isempty(errormsg)191 % msgbox_uvmat('ERROR',['error reading ' filecell{1,1} ': ' errormsg])192 % return193 % end194 % time_1=[];195 % if isfield(DataOut,'Time')196 % time_1=DataOut.Time(1);197 % end198 % if CheckNc{iview}199 % if isempty(strcmp('Conventions',DataOut.ListGlobalAttribute))200 % DataOut.ListGlobalAttribute=['Conventions' DataOut.ListGlobalAttribute];201 % end202 % DataOut.Conventions='uvmat';203 % DataOut.ListGlobalAttribute=[DataOut.ListGlobalAttribute {Param.Action}];204 % ActionKey='Action';205 % while isfield(DataOut,ActionKey)206 % ActionKey=[ActionKey '_1'];207 % end208 % DataOut.(ActionKey)=Param.Action;209 % DataOut.ListGlobalAttribute=[DataOut.ListGlobalAttribute {ActionKey}];210 % if isfield(DataOut,'Time')211 % DataOut.ListGlobalAttribute=[DataOut.ListGlobalAttribute {'Time','Time_end'}];212 % end213 % end214 215 184 %% MAIN LOOP ON SLICES 216 185 %%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%% … … 219 188 nbfiles=0; 220 189 nbmissing=0; 221 222 %initiate result fields 223 % for ivar=1:length(DataOut.ListVarName) 224 % DataOut.(DataOut.ListVarName{ivar})=0; % initialise all fields to zero 225 % end 226 190 227 191 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%% 228 192 for index=index_slice … … 350 314 351 315 %writing the result file 352 OutputFile=fullfile_uvmat(RootPath{1}, Param.OutputSubDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(1),i1_series{1}(end),i_slice,[]);316 OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(1),i1_series{1}(end),i_slice,[]); 353 317 if CheckImage{1} %case of images 354 318 if isequal(FileInfo{1}.BitDepth,16)||(numel(FileInfo)==2 &&isequal(FileInfo{2}.BitDepth,16))
Note: See TracChangeset
for help on using the changeset viewer.