Changeset 635 for trunk/src/series
- Timestamp:
- May 19, 2013, 11:37:49 PM (12 years ago)
- Location:
- trunk/src/series
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/aver_stat.m
r633 r635 94 94 nbfield_i=size(i1_series{1},2); %nb of fields for the i index 95 95 nbfield=nbfield_j*nbfield_i; %total number of fields 96 [first_i,tild,last_i,first_j,tild,last_j,errormsg]=get_index_range(Param.IndexRange);97 if ~isempty(errormsg),display(errormsg),return,end98 96 99 97 %% determine the file type on each line from the first input file … … 140 138 elseif CheckNc{1} 141 139 FileExtOut='.nc';% write result as .nc files for netcdf inputs 142 else 140 else 143 141 msgbox_uvmat('ERROR',['invalid file type input ' FileType{1}]) 144 142 return 145 143 end 146 144 if nbview==2 && ~isequal(CheckImage{1},CheckImage{2}) 147 145 msgbox_uvmat('ERROR','input must be two image series or two netcdf file series') 148 146 return 149 147 end 150 %NomTypeOut='_1-2_1';% output file index will indicate the first and last ref index in the series 148 149 %% settings for the output file 151 150 NomTypeOut=nomtype2pair(NomType{1});% determine the index nomenclature type for the output file 151 first_i=i1_series{1}(1); 152 last_i=i1_series{1}(end); 153 if isempty(j1_series{1})% if there is no second index j 154 first_j=1;last_j=1; 155 else 156 first_j=j1_series{1}(1); 157 last_j=j1_series{1}(end); 158 end 152 159 153 160 %% Set field names and velocity types … … 177 184 for index=1:nbfield 178 185 update_waitbar(WaitbarHandle,index/nbfield) 179 if ~isempty(RUNHandle)&& ishandle(RUNHandle) &&~strcmp(get(RUNHandle,'BusyAction'),'queue')186 if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 180 187 disp('program stopped by user') 181 188 break … … 238 245 239 246 %%%%%%%%%%%% MAIN RUNNING OPERATIONS %%%%%%%%%%%% 240 %update sum241 247 if nbfiles==1 %first field 242 248 time_1=[]; … … 255 261 siz=size(Field.(VarName)); 256 262 if ~isequal(DataOut.(VarName),0)&& ~isequal(siz,sizmean) 257 msgbox_uvmat('ERROR',['unequal size of input field ' VarName ', need to project on a grid'])263 displ_uvmat('ERROR',['unequal size of input field ' VarName ', need to project on a grid'],checkrun) 258 264 return 259 265 else … … 285 291 end 286 292 else % time from ImaDoc prevails if it exists 287 % j1=1;%default288 % if ~isempty(j1_series{1})289 % j1=j1_series{1};290 % end291 %DataOut.Time=time(1,i1_series{1}(1),j1);292 %DataOut.Time_end=time(end,i1_series{end}(end),j1_series{end}(end));293 293 DataOut.Time=time(1); 294 294 DataOut.Time_end=time(end); -
trunk/src/series/check_data_files.m
r626 r635 104 104 Tabchar{2}=''; 105 105 Tabchar{3}=[num2str(FileInfo.FrameRate) ' frames/s ']; 106 message=''; 106 107 % Tabchar{4}=''; 107 108 % Tabchar{5}=[' compression' FileInfo.VideoCompression]; -
trunk/src/series/civ_input.m
r633 r635 195 195 %check_letter=~isempty(regexp(NomTypeIma,'[ab|AB]$'));%detect pair label by letter 196 196 %if isequal(NomTypeNc,'_1-2')||isempty(MaxIndex_j)|| (MaxIndex_j==1) 197 MaxIndex_i=Param.IndexRange.MaxIndex_i{1}; 198 MaxIndex_j=Param.IndexRange.MaxIndex_j{1}; 199 MinIndex_i=Param.IndexRange.MinIndex_i{1}; 200 MinIndex_j=Param.IndexRange.MinIndex_j{1}; 197 MaxIndex_i=Param.IndexRange.MaxIndex_i(1); 198 MinIndex_i=Param.IndexRange.MinIndex_i(1); 199 MaxIndex_j=1;%default 200 MinIndex_j=1; 201 if isfield(Param.IndexRange,'MaxIndex_j')&&isfield(Param.IndexRange,'MinIndex_j') 202 MaxIndex_j=Param.IndexRange.MaxIndex_j(1); 203 MinIndex_j=Param.IndexRange.MinIndex_j(1); 204 end 201 205 CivInputData.MaxIndex_i=MaxIndex_i; 202 206 CivInputData.MaxIndex_j=MaxIndex_j; … … 211 215 set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' except in MaxIndex_j is large 212 216 end 213 elseif ~(strcmp(FileType,'video') || strcmp(FileType,'mmreader')) 217 %elseif ~(strcmp(FileType,'video') || strcmp(FileType,'mmreader')) 218 else 214 219 set(handles.ListPairMode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice 215 220 if strcmp(NomTypeNc,'_1-2_1') … … 1131 1136 Time=CivInputData.Time; 1132 1137 checkframe=strcmp(TimeUnit,'frame'); 1133 %displ_num=get(handles.ListPairCiv1,'UserData');1134 1135 %% eliminate the first pairs inconsistent with the position1136 % if isempty(displ_num)1137 % nbpair=0;1138 % else1139 % nbpair=length(displ_num(1,:));%nbre of displayed pairs1140 % if isequal(mode,'series(Di)') %| isequal(mode,'st_series(Di)')1141 % nbpair=min(2*ref_i-1,nbpair);%limit the number of pairs with positive first index1142 % elseif isequal(mode,'series(Dj)')% | isequal(mode,'st_series(Dj)')1143 % nbpair=min(2*ref_j-1,nbpair);%limit the number of pairs with positive first index1144 % end1145 % end1146 % nbpair=min(200,nbpair);%limit the number of displayed pairs to 2001147 1138 1148 1139 %% case with no Civ1 operation, netcdf files need to exist for reading … … 1224 1215 1225 1216 %% determine the menu display in .ListPairCiv1 1226 % the menu depends on the mode defined in ListPairMode_callback through the array displ_num:1227 % displ_num(1,:)=indices j11228 % displ_num(2,:)=indices j21229 % displ_num(3,:)=indices i11230 % displ_num(4,:)=indices i21231 % in mode 'pair j1-j2', j1 and j2 are the file indices, else the indices1232 % are relative to the reference indices ref_i and ref_j respectively.1233 1217 testpair=0; %TODO: check 1234 1218 if isequal(mode,'series(Di)') … … 1239 1223 if select(ipair) 1240 1224 displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))]; 1241 %if ~checkframe && size(Time,1)>=ref_i+1+displ_num(4,ipair) && size(Time,2)>=ref_j+1+displ_num(2,ipair)&&displ_num(2,ipair)>=1 &&displ_num(1,ipair)>=1 1242 % dt=Time(ref_i+1+displ_num(4,ipair),ref_j+1+displ_num(2,ipair))-Time(ref_i+1+displ_num(3,ipair),ref_j+1+displ_num(1,ipair));%Time interval dt 1243 if ~checkframe && size(Time,1)>=ref_i+1+ceil(ipair/2) && size(Time,2)>=ref_j+1&& ref_i-floor(ipair/2)>=0 && ref_j>=0 1225 if ~checkframe 1226 if size(Time,1)>=ref_i+1+ceil(ipair/2) && size(Time,2)>=ref_j+1&& ref_i-floor(ipair/2)>=0 && ref_j>=0 1244 1227 dt=Time(ref_i+1+ceil(ipair/2),ref_j+1)-Time(ref_i+1-floor(ipair/2),ref_j+1);%Time interval dtref_j+1 1228 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)]; 1229 end 1245 1230 else 1246 dt= 1;1247 end1248 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)];1231 dt=ipair/1000; 1232 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(ipair)]; 1233 end 1249 1234 else 1250 1235 displ_pair{ipair}='...'; %pair not displayed in the menu … … 1259 1244 if select(ipair) 1260 1245 displ_pair{ipair}=['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))]; 1261 if ~checkframe && size(Time,1)>=ref_i+1+displ_num(4,ipair) && size(Time,2)>=ref_j+1+displ_num(2,ipair) 1262 dt=Time(ref_i+1+displ_num(4,ipair),ref_j+1+displ_num(2,ipair))-Time(ref_i+1+displ_num(3,ipair),ref_j+1+displ_num(1,ipair));%Time interval dt 1246 if ~checkframe 1247 if size(Time,2)>=ref_j+1+ceil(ipair/2) && size(Time,1)>=ref_i+1 && ref_j-floor(ipair/2)>=0 && ref_i>=0 1248 dt=Time(ref_i+1,ref_j+1+ceil(ipair/2))-Time(ref_i+1,ref_j+1-floor(ipair/2));%Time interval dtref_j+1 1249 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)]; 1250 end 1251 else 1252 dt=ipair/1000; 1263 1253 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)]; 1264 end1254 end 1265 1255 else 1266 1256 displ_pair{ipair}='...'; %pair not displayed in the menu -
trunk/src/series/civ_series.m
r633 r635 79 79 %% input files and indexing 80 80 NbField=1; 81 MaxIndex=cell2mat(Param.IndexRange.MaxIndex); 82 MinIndex=cell2mat(Param.IndexRange.MinIndex); 81 MaxIndex_i=Param.IndexRange.MaxIndex_i; 82 MinIndex_i=Param.IndexRange.MinIndex_i; 83 MaxIndex_j=1;MinIndex_j=1; 84 if isfield(Param.IndexRange,'MaxIndex_j')&& isfield(Param.IndexRange,'MinIndex_j') 85 MaxIndex_j=Param.IndexRange.MaxIndex_j; 86 MinIndex_j=Param.IndexRange.MinIndex_j; 87 end 83 88 if isfield(Param,'InputTable') 84 89 [filecell,i_series,tild,j_series]=get_file_series(Param); … … 120 125 if iview_B==0 121 126 FileType_B=FileType_A; 122 VideoObject_B=VideoObject_A;127 VideoObject_B=VideoObject_A; 123 128 PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1; 124 129 PairCiv2=''; … … 127 132 end 128 133 [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=... 129 find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex ,MaxIndex);134 find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 130 135 if ~isempty(PairCiv2) 131 136 [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=... 132 find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex ,MaxIndex);137 find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 133 138 check_bounds=check_bounds | check_bounds_Civ2; 134 139 end … … 158 163 end 159 164 else 160 165 [FileType_B,FileInfo,VideoObject_B]=get_file_type(filecell{2,1}); 161 166 if isempty(find(strcmp(FileType_B,{'multimage','mmreader','video'}))) 162 167 displ(['ERROR: the file line ' num2str(iview_B) ' must be an image']) 163 end 168 end 164 169 %TODO : introduce the second file series if relevant: case %displacement 165 170 end … … 217 222 %%%%% MAIN LOOP %%%%%% 218 223 for ifield=1:NbField 219 update_waitbar(WaitbarHandle,i ndex/nbfield)220 if ~isempty(RUNHandle) && ishandle(RUNHandle) &&~strcmp(get(RUNHandle,'BusyAction'),'queue')224 update_waitbar(WaitbarHandle,ifield/NbField) 225 if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue') 221 226 disp('program stopped by user') 222 227 break … … 264 269 j2=j2_series_Civ1(ifield); 265 270 end 266 Data.Civ1_Time=(time( i2+1,j2+1)+time(i1+1,j1+1))/2;267 Data.Civ1_Dt=time( i2+1,j2+1)-time(i1+1,j1+1);271 Data.Civ1_Time=(time(j2+1,i2+1)+time(j1+1,i1+1))/2; 272 Data.Civ1_Dt=time(j2+1,i2+1)-time(j1+1,i1+1); 268 273 for ilist=1:length(list_param) 269 274 Data.(Civ1_param{4+ilist})=Param.ActionInput.Civ1.(list_param{ilist}); … … 400 405 ImageName_A_Civ2=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,i1_series_Civ2(ifield),[],j1_series_Civ2(ifield)); 401 406 402 if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A_Civ1(ifield),FrameIndex_A_Civ2 )407 if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A_Civ1(ifield),FrameIndex_A_Civ2(ifield)) 403 408 par_civ2.ImageA=par_civ1.ImageA; 404 409 else 405 [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ2 );410 [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield)); 406 411 end 407 412 ImageName_B_Civ2=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,i2_series_Civ2(ifield),[],j2_series_Civ2(ifield)); … … 409 414 par_civ2.ImageB=par_civ1.ImageB; 410 415 else 411 [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2 );416 [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield)); 412 417 end 413 418 414 419 ncfile=fullfile_uvmat(RootPath,OutputDir,RootFile,'.nc',NomTypeNc,i1_series_Civ2(ifield),i2_series_Civ2(ifield),... 415 420 j1_series_Civ2(ifield),j2_series_Civ2(ifield)); 416 par_civ2.ImageWidth=FileInfo .Width;417 par_civ2.ImageHeight=FileInfo .Height;421 par_civ2.ImageWidth=FileInfo_A.Width; 422 par_civ2.ImageHeight=FileInfo_A.Height; 418 423 419 424 if isfield(par_civ2,'Grid')% grid points set as input file … … 935 940 % --- determine the list of index pairs of processing file 936 941 function [i1_series,i2_series,j1_series,j2_series,check_bounds,NomTypeNc]=... 937 find_pair_indices(str_civ,i_series,j_series,MinIndex ,MaxIndex)942 find_pair_indices(str_civ,i_series,j_series,MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j) 938 943 %------------------------------------------------------------------------ 939 944 i1_series=i_series;% set of first image indexes … … 973 978 i1_series=i_series-ind1;% set of first image numbers 974 979 i2_series=i_series+ind2; 975 check_bounds=i1_series<MinIndex(1,1) | i2_series>MaxIndex(1,1);980 check_bounds=i1_series<MinIndex_i | i2_series>MaxIndex_i; 976 981 if isempty(j_series) 977 982 NomTypeNc='_1-2'; … … 984 989 j1_series=j_series-ind1; 985 990 j2_series=j_series+ind2; 986 check_bounds=j1_series<MinIndex (1,2) | j2_series>MaxIndex(1,2);991 check_bounds=j1_series<MinIndex_j | j2_series>MaxIndex_j; 987 992 NomTypeNc='_1_1-2'; 988 993 else %bursts -
trunk/src/series/float_tracking.m
r619 r635 115 115 nbfield_i=size(i1_series{1},2); %nb of fields for the i index 116 116 nbfield=nbfield_j*nbfield_i; %total number of fields 117 [first_i,tild,last_i,first_j,tild,last_j,errormsg]=get_index_range(Param.IndexRange);118 if ~isempty(errormsg),display(errormsg),return,end119 117 120 118 %% frame index for movie or multimage file input -
trunk/src/series/ima_levels.m
r633 r635 151 151 for ifile=1:nbfield 152 152 update_waitbar(WaitbarHandle,ifile/nbfield) 153 if ~isempty(RUNHandle) &&ishandle(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')153 if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 154 154 disp('program stopped by user') 155 155 return -
trunk/src/series/merge_proj.m
r633 r635 51 51 ParamOut.TransformPath=fullfile(fileparts(which('uvmat')),'transform_field');% path to transform functions (needed for compilation only) 52 52 ParamOut.ProjObject='on';%can use projection object(option 'off'/'on', 53 ParamOut.Mask='o ff';%can use mask option (option 'off'/'on', 'off' by default)53 ParamOut.Mask='on';%can use mask option (option 'off'/'on', 'off' by default) 54 54 ParamOut.OutputDirExt='.mproj';%set the output dir extension 55 55 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 … … 58 58 msgbox_uvmat('WARNING','the first input file does not exist') 59 59 elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject') 60 msgbox_uvmat('WARNING',' a projection object of type plane needs to be introducedfor merge_proj')60 msgbox_uvmat('WARNING','You may need a projection object of type plane for merge_proj') 61 61 end 62 62 return -
trunk/src/series/particle_tracking.m
r619 r635 115 115 nbfield_i=size(i1_series{1},2); %nb of fields for the i index 116 116 nbfield=nbfield_j*nbfield_i; %total number of fields 117 [first_i,tild,last_i,first_j,tild,last_j,errormsg]=get_index_range(Param.IndexRange);118 if ~isempty(errormsg),display(errormsg),return,end119 117 120 118 %% frame index for movie or multimage file input -
trunk/src/series/relabel_i_j.m
r624 r635 226 226 for ifile=1:nbfield 227 227 update_waitbar(WaitbarHandle,ifile/nbfield) 228 if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')228 if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue') 229 229 disp('program stopped by user') 230 230 break -
trunk/src/series/time_series.m
r633 r635 98 98 nbfield_i=size(i1_series{1},2); %nb of fields for the i index 99 99 nbfield=nbfield_j*nbfield_i; %total number of fields 100 [first_i,tild,last_i,first_j,tild,last_j,errormsg]=get_index_range(Param.IndexRange);101 if ~isempty(errormsg),display(errormsg),return,end100 % [first_i,tild,last_i,first_j,tild,last_j,errormsg]=get_index_range(Param.IndexRange); 101 % if ~isempty(errormsg),display(errormsg),return,end 102 102 103 103 %% determine the file type on each line from the first input file … … 153 153 return 154 154 end 155 156 %% settings for the output file 155 157 NomTypeOut=nomtype2pair(NomType{1});% determine the index nomenclature type for the output file 158 first_i=i1_series{1}(1); 159 last_i=i1_series{1}(end); 160 if isempty(j1_series{1})% if there is no second index j 161 first_j=1;last_j=1; 162 else 163 first_j=j1_series{1}(1); 164 last_j=j1_series{1}(end); 165 end 156 166 157 167 %% Set field names and velocity types … … 210 220 for index=1:nbfield 211 221 update_waitbar(WaitbarHandle,index/nbfield) 212 if ~isempty(RUNHandle) && ishandle(RUNHandle) &&~strcmp(get(RUNHandle,'BusyAction'),'queue')222 if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue') 213 223 disp('program stopped by user') 214 224 break % leave the loop if stop is ordered
Note: See TracChangeset
for help on using the changeset viewer.