Changeset 1194 for trunk/src/series.m
- Timestamp:
- Feb 23, 2026, 3:58:54 PM (8 days ago)
- File:
-
- 1 edited
-
trunk/src/series.m (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r1193 r1194 650 650 j1=str2double(get(handles.num_first_j,'String')); 651 651 j2=[];%default 652 PairString=get(handles.PairString,'Data'); 653 if numel(PairString)>=iview 654 r=regexp(PairString{iview},'(?<num1>\d+)-(?<num2>\d+)' ,'names'); 655 if ~isempty(r) 656 j1=str2double(r.num1); 657 j2=str2double(r.num2); 658 end 659 end 660 InputFile=fullfile_uvmat('','',InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1,[],j1,j2); 652 % PairString=get(handles.PairString,'Data'); 653 % if numel(PairString)>=iview 654 % r=regexp(PairString{iview},'(?<num1>\d+)-(?<num2>\d+)' ,'names'); 655 % if ~isempty(r) 656 % j1=str2double(r.num1); 657 % j2=str2double(r.num2); 658 % end 659 % end 660 InputFile=[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]; 661 %InputFile=fullfile_uvmat('','',InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1,[],j1,j2); 661 662 [RootPath,~,RootFile,Param.i1_series,Param.i2_series,Param.j1_series,Param.j2_series,~,Param.FileInfo,MovieObject]=... 662 663 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),InputFile); … … 814 815 SeriesData.j1_series={}; 815 816 SeriesData.j2_series={}; 816 SeriesData.FileType={};817 % SeriesData.FileType={}; 817 818 SeriesData.FileInfo={}; 818 819 SeriesData.Time={}; … … 1067 1068 1068 1069 %% get index range in case of relabeling 1069 if ~isempty(Param.XmlData.Time)1070 if isfield(Param,'XmlData') && ~isempty(Param.XmlData.Time) 1070 1071 Time=Param.XmlData.Time; 1071 1072 MinIndex_i=1; … … 1075 1076 TimeName='xml'; 1076 1077 else 1077 [nbfield,nbfield_j]=size(XmlData.Time); 1078 InputTable=get(handles.InputTable,'Data'); 1079 [XmlFileName,Rank]=find_imadoc(InputTable{iview,1},InputTable{iview,2}); 1080 if isempty(XmlFileName) 1081 return 1082 else 1083 Param.XmlData=read_imadoc(XmlFileName); 1084 end 1085 [nbfield,nbfield_j]=size(Param.XmlData.Time); 1078 1086 nbfield=nbfield-1; %remove the possible index 0 1079 1087 nbfield_j=nbfield_j-1; %remove the possible index 0 … … 1089 1097 %i1=(first_i-SeriesData.FileSeries{1}.FirstFileIndex)*SeriesData.FileSeries{1}.NbFramePerFile+1;%frame index deduced from input file index 1090 1098 i1=1; 1091 if strcmp(SeriesData.TimeName,'xml')% indices i and j1099 if isfield(SeriesData,'TimeName') && strcmp(SeriesData.TimeName,'xml')% indices i and j 1092 1100 j1=mod(i1-1,nbfield_j)+first_j; 1093 1101 i1=floor((i1-1)/nbfield_j)+1; … … 1096 1104 end 1097 1105 end 1098 % set(handles.num_first_i,'String',num2str(i1))1099 % % last_i=str2double(get(handles.num_last_i,'String'));1100 % % last_j=str2double(get(handles.num_last_j,'String'));1101 % % i1=(last_i-SeriesData.FileSeries{1}.FirstFileIndex)*SeriesData.FileSeries{1}.NbFramePerFile+1;%frame index deduced from input file index1102 % % if strcmp(SeriesData.TimeName,'xml')% indices i and j1103 % % j1=mod(i1-1,nbfield_j)+1;1104 % % i1=floor((i1-1)/nbfield_j)+1;1105 % % end1106 % set(handles.num_last_i,'String',num2str(nbfield))1107 % set(handles.num_last_j,'String',num2str(nbfield_j))1108 % % else1109 1110 1111 1112 1113 % %% case of possible index relabeling from xml info1114 % if isfield(XmlData,'FileSeries')&& strcmp(FileInfo.FileType,'multimage')1115 % answer=msgbox_uvmat('INPUT_Y-N','relabel the frame indices according to the xml info?');1116 % if strcmp(answer,'Yes')1117 % set(handles.Relabel,'Visible','on')1118 % set(handles.Relabel,'Value',1)1119 % SeriesData.FileSeries{iview}=XmlData.FileSeries;1120 % TimeMin=Time(2,2);1121 % TimeMax=Time(end,end);1122 % TimeFirst=TimeMin;1123 % TimeLast=TimeMax;1124 % end1125 % elseif iview==11126 % set(handles.Relabel,'Visible','off')1127 % end1128 1106 1129 1107 if isfield(Param,'FileInfo') && ~isempty(Param.FileInfo) && strcmp(Param.FileInfo.FileType,'rdvision') … … 1137 1115 end 1138 1116 TimeMin=Time(MinIndex_i+1,MinIndex_j+1); 1139 % if size(Time)>=[first_i+1 first_j+1]1140 % TimeFirst=Time(first_i+1,first_j+1);1141 % end1142 % if size(Time)>=[last_i+1 last_j+1]1143 % TimeLast=Time(last_i+1,last_j+1);1144 % end1145 1117 if size(Time)>=[MaxIndex_i+1 MaxIndex_j+1] 1146 1118 TimeMax=Time(MaxIndex_i+1,MaxIndex_j+1); … … 1261 1233 CheckPair= ~isempty(i2_series)||~isempty(j2_series); % check whether index pairs need to be defined 1262 1234 PairString=get(handles.PairString,'Data'); 1235 PairString{iview,1}=''; % no pair for #iview by default 1263 1236 if CheckPair% if pairs need to be display for line iview 1264 1237 [ModeMenu,ModeValue]=update_mode(i1_series,i2_series,j2_series); 1265 1238 Menu=update_listpair(i1_series,i2_series,j1_series,j2_series,ModeMenu{ModeValue},Time,TimeUnit,ref_i,ref_j,TimeName,InputTable(iview,:),Param.FileInfo); 1266 PairString{iview,1}=Menu{1};1267 else 1268 PairString{iview,1}=''; % no pair for #iview1239 if numel(Menu)>=1 1240 PairString{iview,1}=Menu{1}; 1241 end 1269 1242 end 1270 1243 set(handles.PairString,'Data',PairString) … … 1282 1255 Position=get(handles.FileStatus,'Position'); 1283 1256 set(handles.FileStatus,'Units','normalized') 1284 %xI=0.5:Position(3)-0.5;1285 1257 nbview=numel(SeriesData.i1_series); 1286 j_max=cell(1,nbview);1258 i_max=cell(1,nbview); 1287 1259 MaxIndex_i=ones(1,nbview); % default 1288 1260 MinIndex_i=ones(1,nbview); % default 1261 missing_indices=cell(1,nbview); 1289 1262 for iline=1:nbview 1290 pair_max=squeeze(max(SeriesData.i1_series{iline},[],1)); % max on pair index 1291 j_max{iline}=max(pair_max,[],1); % max on j index 1292 if ~isempty(j_max{iline}) 1293 MaxIndex_i(iline)=find(j_max{iline}, 1, 'last' )-1; % max ref index i 1294 MinIndex_i(iline)=find(j_max{iline}, 1 )-1; % min ref index i 1263 pair_max=squeeze(max(SeriesData.i1_series{iline},[],1)); % max i1 indices from i1_series (as obtained by fct uvmat/find_file_series.m) 1264 % needed in the case of mutiple pairs for the same index ref_i) 1265 i_max{iline}=max(pair_max,[],1); % max on j index 1266 if ~isempty(i_max{iline})&& ~isequal(pair_max,0) 1267 MaxIndex_i(iline)=find(i_max{iline}, 1, 'last' )-1; % max ref index i 1268 MinIndex_i(iline)=find(i_max{iline}, 1 )-1; % min ref index i 1269 missing_indices{iline}= find(i_max{iline}(2:end)==0); 1295 1270 end 1296 1271 end … … 1299 1274 range_index=MaxIndex_i-MinIndex_i+1; 1300 1275 range_y=max(1,floor(Position(4)/nbview)); 1301 npx=floor(Position(3)); 1302 file_indices=MinIndex_i+floor(((0.5:npx-0.5)/npx)*range_index)+1; 1303 CData=zeros(nbview*range_y,npx); % initiate the image representing the existing files 1276 npx=floor(Position(3));%length of the bar image FileStatus in pixels 1277 1278 %file_indices=MinIndex_i+floor(((0.5:npx-0.5)/npx)*range_index)+1; 1279 CData=ones(nbview*range_y,npx); % initiate the image representing the existing files 1280 LineData=ones(1,npx); 1304 1281 for iline=1:nbview 1305 1282 ind_y=1+(iline-1)*range_y:iline*range_y; 1306 LineData=zeros(size(file_indices)); 1307 file_select=file_indices(file_indices<=numel(j_max{iline})); 1308 ind_select=file_indices<=numel(j_max{iline}); 1309 LineData(ind_select)=j_max{iline}(file_select)~=0; 1310 CData(ind_y,:)=ones(size(ind_y'))*LineData; 1283 missing_pixels=floor((missing_indices{iline}-MinIndex_i+1)*npx/range_index)+1; 1284 LineData(missing_pixels)=0; 1285 % LineData=zeros(size(file_indices)); 1286 % file_select=file_indices(file_indices<=numel(i_max{iline})); 1287 % ind_select=file_indices<=numel(i_max{iline}); 1288 % LineData(ind_select)=i_max{iline}(file_select)~=0; 1289 CData(ind_y,:)=ones(numel(ind_y),1)*LineData;%create an image band with width numel(ind_y) 1311 1290 end 1312 1291 CData=cat(3,zeros(size(CData)),CData,zeros(size(CData))); % make color images r=0,g,b=0 … … 1520 1499 if isempty(pos_last), pos_last=1; end 1521 1500 Position=get(handles.Waitbar,'Position'); % position of the waitbar:= [ x,y, width, height] 1522 Position_status=get(handles.FileStatus,'Position'); 1501 Position_status=get(handles.FileStatus,'Position');% position of the FileStatus bar:= [ x,y, width, height] 1523 1502 Position(1)=Position_status(1)+Position_status(3)*pos_first; 1524 1503 Position(3)=max(Position_status(3)*(pos_last-pos_first),0.001); % width must remain positive … … 2642 2621 end 2643 2622 if VelTypeRequest_1 && numel(iview_civ)>=2 2644 menu=set_veltype_display(SeriesData.FileInfo{iview_civ(2)}.CivStage,SeriesData.File Type{iview_civ(2)});2623 menu=set_veltype_display(SeriesData.FileInfo{iview_civ(2)}.CivStage,SeriesData.FileInfo{iview_civ(2)}.FileType); 2645 2624 set(handles.VelType_1,'Value',1)% set first choice by default 2646 2625 set(handles.VelType_1,'String',[{'*'};menu]) … … 2996 2975 FieldListInit(field_index(1))=[]; 2997 2976 SeriesData=get(handles.series,'UserData'); 2977 for iview=1:numel(SeriesData.FileInfo) 2978 FileType{iview}=SeriesData.FileInfo{iview}.FileType; 2979 end 2998 2980 % input line for which the field choice is relevant 2999 iview=find(ismember( SeriesData.FileType,{'netcdf','civx','civdata'})); % all nc files, icluding civ2981 iview=find(ismember(FileType,{'netcdf','civx','civdata'})); % all nc files, icluding civ 3000 2982 hget_field=findobj(allchild(0),'name','get_field'); 3001 2983 if ~isempty(hget_field) … … 3152 3134 end 3153 3135 Param=read_GUI(handles.series); 3154 InputTable=Param.InputTable(2,:);3136 %InputTable=Param.InputTable(2,:); 3155 3137 % check the existence of the first file in the series 3156 3138 first_j=[]; … … 4194 4176 check_input_file_series(handles,CheckRelabel) 4195 4177 ActionInput_Callback([],[], handles) 4196 % if get(handles.Relabel,'Value') 4197 % NomType='*'; 4198 % i1=1;i2=[];j1=1;j2=[]; 4199 % i1_series=1:size(XmlData.Time,1)-1; 4200 % i2_series=[]; 4201 % j1_series=1:size(XmlData.Time,2)-1; 4202 % j2_series=[]; 4203 % 4204 % 4205 % 4206 % SeriesData=get(handles.series,'UserData'); 4207 % if isfield(SeriesData,'FileSeries')&& ~isempty(SeriesData.FileSeries{1}) 4208 % [nbfield,nbfield_j]=size(SeriesData.Time{1}); 4209 % nbfield=nbfield-1; %remove the possible index 0 4210 % nbfield_j=nbfield_j-1; %remove the possible index 0 4211 % MaxIndex_i=get(handles.MaxIndex_i,'Data'); 4212 % MaxIndex_j=get(handles.MaxIndex_j,'Data'); 4213 % MaxIndex_i(1,:)=nbfield; 4214 % MaxIndex_j(1,:)=nbfield_j; 4215 % MinIndex_i(1,:)=1; 4216 % MinIndex_j(1,:)=1; 4217 % set(handles.MaxIndex_i,'Data',MaxIndex_i) 4218 % set(handles.MaxIndex_j,'Data',MaxIndex_j) 4219 % set(handles.MinIndex_i,'Data',MinIndex_i) 4220 % set(handles.MinIndex_j,'Data',MinIndex_j) 4221 % first_i=str2double(get(handles.num_first_i,'String')); 4222 % first_j=str2double(get(handles.num_first_j,'String')); 4223 % %i1=(first_i-SeriesData.FileSeries{1}.FirstFileIndex)*SeriesData.FileSeries{1}.NbFramePerFile+1;%frame index deduced from input file index 4224 % i1=1; 4225 % if strcmp(SeriesData.TimeName,'xml')% indices i and j 4226 % j1=mod(i1-1,nbfield_j)+first_j; 4227 % i1=floor((i1-1)/nbfield_j)+1; 4228 % set(handles.num_first_j,'String',num2str(j1)) 4229 % end 4230 % set(handles.num_first_i,'String',num2str(i1)) 4231 % % last_i=str2double(get(handles.num_last_i,'String')); 4232 % % last_j=str2double(get(handles.num_last_j,'String')); 4233 % % i1=(last_i-SeriesData.FileSeries{1}.FirstFileIndex)*SeriesData.FileSeries{1}.NbFramePerFile+1;%frame index deduced from input file index 4234 % % if strcmp(SeriesData.TimeName,'xml')% indices i and j 4235 % % j1=mod(i1-1,nbfield_j)+1; 4236 % % i1=floor((i1-1)/nbfield_j)+1; 4237 % % end 4238 % set(handles.num_last_i,'String',num2str(nbfield)) 4239 % set(handles.num_last_j,'String',num2str(nbfield_j)) 4240 % end 4241 % else 4242 % check_input_file_series(handles) 4243 % ActionInput_Callback([],[], handles) 4244 % end 4245 4178 4179
Note: See TracChangeset
for help on using the changeset viewer.
