- Timestamp:
- May 20, 2013, 10:12:57 AM (12 years ago)
- Location:
- trunk/src/series
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r635 r637 25 25 26 26 27 % Last Modified by GUIDE v2.5 04-Apr-2013 22:08:2327 % Last Modified by GUIDE v2.5 20-May-2013 09:55:30 28 28 % Begin initialization code - DO NOT EDIT 29 29 gui_Singleton = 1; … … 82 82 %% input file info 83 83 RootPath=Param.InputTable{1,1}; 84 set(handles.RootPath,'String',RootPath)84 %set(handles.RootPath,'String',RootPath) 85 85 RootFile=Param.InputTable{1,3}; 86 86 SubDir=Param.InputTable{1,2}; … … 98 98 switch FileType 99 99 case {'image','multimage','video','mmreader'} 100 NomTypeIma =NomTypeInput;100 NomTypeImaA=NomTypeInput; 101 101 case 'civdata' 102 102 if ~strcmp(Param.Action.ActionName,'civ_series') … … 111 111 else 112 112 set(handles.ListCompareMode,'Value',1) 113 set(handles.RootFile_1,'Visible','Off');113 % set(handles.RootFile_1,'Visible','Off'); 114 114 end 115 115 imageinput=''; … … 117 117 [PathCiv1_ImageA,Civ1_ImageA,FileExtA]=fileparts(Data.Civ1_ImageA); 118 118 [PathCiv1_ImageB,Civ1_ImageB,FileExtA]=fileparts(Data.Civ1_ImageB); 119 % set(handles.Civ1_ImageA,'String',Civ1_ImageA) 120 % set(handles.Civ1_ImageB,'String',Civ1_ImageB) 121 if ~isempty(Data.Civ2_ImageA) 119 122 [PathCiv2_ImageA,Civ2_ImageA,FileExtA]=fileparts(Data.Civ2_ImageA); 120 123 [PathCiv2_ImageB,Civ2_ImageB,FileExtA]=fileparts(Data.Civ2_ImageB); 121 set(handles.Civ1_ImageA,'String',Civ1_ImageA) 122 set(handles.Civ1_ImageB,'String',Civ1_ImageB) 123 set(handles.Civ2_ImageA,'String',Civ2_ImageA) 124 set(handles.Civ2_ImageB,'String',Civ2_ImageB) 124 % set(handles.Civ2_ImageA,'String',Civ2_ImageA) 125 % set(handles.Civ2_ImageB,'String',Civ2_ImageB) 126 end 127 hhseries=guidata(gcbf); 128 if size(Param.InputTable,1)==1 129 series('display_file_name',hhseries,Data.Civ1_ImageA,'append'); 130 end 125 131 if isfield(Data,'Txt') 126 132 errormsg=Data.Txt; … … 155 161 156 162 %display the parameters stored on the GUI series 157 % set(handles.first_i,'String',num2str(Param.IndexRange.first_i))158 % set(handles.incr_i,'String',num2str(Param.IndexRange.incr_i))159 % set(handles.last_i,'String',num2str(Param.IndexRange.last_i))160 163 set(handles.ref_i,'String',num2str(Param.IndexRange.first_i)) 161 164 if isfield(Param.IndexRange,'first_j') 162 % set(handles.first_j,'String',num2str(Param.IndexRange.first_j))163 % set(handles.incr_j,'String',num2str(Param.IndexRange.incr_j))164 % set(handles.last_j,'String',num2str(Param.IndexRange.last_j))165 165 set(handles.ref_j,'String',num2str(Param.IndexRange.first_j)) 166 166 end … … 193 193 194 194 %% set the menus of image pairs and default selection for civ_input %%%%%%%%%%%%%%%%%%% 195 %check_letter=~isempty(regexp(NomTypeIma,'[ab|AB]$'));%detect pair label by letter196 %if isequal(NomTypeNc,'_1-2')||isempty(MaxIndex_j)|| (MaxIndex_j==1)197 195 MaxIndex_i=Param.IndexRange.MaxIndex_i(1); 198 196 MinIndex_i=Param.IndexRange.MinIndex_i(1); … … 256 254 end 257 255 end 258 % timing set by video input259 % if isempty(time) && (strcmp(FileType,'video') || strcmp(FileType,'mmreader'))260 % set(handles.ListPairMode,'Value',1);261 % dt=1/get(MovieObject,'FrameRate');%time interval between successive frames262 % if strcmp(NomTypeIma,'*')263 % set(handles.ListPairMode,'String',{'series(Di)'})264 % time=(dt*(0:MaxIndex_i-1))';%list of image times265 % else266 % set(handles.ListPairMode,'String',[{'series(Dj)'};{'series(Di)'}])267 % time=ones(MaxIndex_i,1)*(dt*(0:MaxIndex_j-1));%list of image times268 % enable_j(handles,'on')269 % end270 % TimeUnit='s';271 % set(handles.ImaDoc,'BackgroundColor',[1 1 1])% set display box back to whiter272 % end273 256 274 257 %% timing display … … 288 271 time=time+0.001*(MinIndex_j:MaxIndex_j)'*ones(1,MaxIndex_i-MinIndex_i+1); 289 272 end 290 % time=[zeros(size(time,1),1) time]; %insert a vertical line of zeros (to deal with zero file indices)291 % time=[zeros(1,size(time,2)); time]; %insert a horizontal line of zeros292 273 CivInputData.Time=time; 293 CivInputData.NomTypeIma=NomTypeIma ;274 CivInputData.NomTypeIma=NomTypeImaA; 294 275 set(handles.civ_input,'UserData',CivInputData) 295 276 set(handles.dt_unit,'String',['dt in m' TimeUnit]);%display dt in unit 10-3 of the time (e.g ms) 296 277 set(handles.TimeUnit,'String',TimeUnit); 297 % set(handles.nb_field,'String',num2str(MaxIndex_i));298 % set(handles.nb_field2,'String',num2str(MaxIndex_j));299 300 278 set(handles.CoordUnit,'String',CoordUnit) 301 279 set(handles.SearchRange,'UserData', pxcm_search); … … 597 575 % end 598 576 set(handles.PairIndices,'Visible','on') 599 set(handles.Civ1_ImageB,'Visible','on')600 set(handles.TitleSubdirCiv1,'Visible','on')577 %set(handles.Civ1_ImageB,'Visible','on') 578 %set(handles.TitleSubdirCiv1,'Visible','on') 601 579 if opening==0 602 580 errormsg=find_netcpair_civ(handles,1); % select the available netcdf files … … 607 585 if max(checkbox(4:6))% case of civ2 pair choice needed 608 586 set(handles.TitlePairCiv2,'Visible','on') 609 set(handles.TitleSubdirCiv2,'Visible','on')610 set(handles.Civ2_ImageA,'Visible','on')587 % set(handles.TitleSubdirCiv2,'Visible','on') 588 % set(handles.Civ2_ImageA,'Visible','on') 611 589 %set(handles.ListSubdirCiv2,'Visible','on') 612 590 set(handles.ListPairCiv2,'Visible','on') … … 618 596 end 619 597 else 620 set(handles.TitleSubdirCiv2,'Visible','off')621 set(handles.Civ2_ImageA,'Visible','off')598 % set(handles.TitleSubdirCiv2,'Visible','off') 599 % set(handles.Civ2_ImageA,'Visible','off') 622 600 set(handles.ListPairCiv2,'Visible','off') 623 601 end … … 1118 1096 1119 1097 %% reads .nc subdirectoy and image numbers from the interface 1120 SubDirImages=get(handles.Civ1_ImageA,'String');1098 %SubDirImages=get(handles.Civ1_ImageA,'String'); 1121 1099 %TODO: determine 1122 subdir_civ1=[SubDirImages get(handles.Civ1_ImageB,'String')];%subdirectory subdir_civ1 for the netcdf data1123 subdir_civ2=[SubDirImages get(handles.Civ2_ImageA,'String')];%subdirectory subdir_civ2 for the netcdf data1100 %subdir_civ1=[SubDirImages get(handles.Civ1_ImageB,'String')];%subdirectory subdir_civ1 for the netcdf data 1101 %subdir_civ2=[SubDirImages get(handles.Civ2_ImageA,'String')];%subdirectory subdir_civ2 for the netcdf data 1124 1102 ref_i=str2double(get(handles.ref_i,'String')); 1125 1103 ref_j=[]; … … 1142 1120 select=ones(size(1:nbpair));%flag for displayed pairs =1 for display 1143 1121 testpair=0; 1144 RootPath=get(handles.RootPath,'String');1145 RootFile=get(handles.Civ2_ImageB,'String');1122 % RootPath=get(handles.RootPath,'String'); 1123 % RootFile=get(handles.Civ2_ImageB,'String'); 1146 1124 nbpair=200; %default 1147 if index==1 % case civ1 1148 if ~get(handles.CheckCiv1,'Value') % 1149 if ~exist(fullfile(RootPath,subdir_civ1),'dir') 1150 errormsg=['no civ1 file available: subdirectory ' subdir_civ1 ' does not exist']; 1151 set(handles.ListPairCiv1,'String',{}); 1152 return 1153 end 1154 for ipair=1:nbpair 1155 filename=fullfile_uvmat(RootPath,subdir_civ1,RootFile,'.nc',nom_type_nc,... 1156 ref_i+displ_num(3,ipair),ref_i+displ_num(4,ipair),ref_j+displ_num(1,ipair),ref_j+displ_num(2,ipair)); 1157 select(ipair)=exist(filename,'file')==2;% put flag to 0 if the file does not exist 1158 end 1159 % case of no displayed pair 1160 if isequal(select,zeros(size(1:nbpair))) 1161 if isfield(browse,'incr_pair') && ~isequal(browse.incr_pair,[0 0]) 1162 num_i1=ref_i-floor(browse.incr_pair(1)/2); 1163 num_i2=ref_i+ceil(browse.incr_pair(1)/2); 1164 num_j1=ref_j-floor(browse.incr_pair(2)/2); 1165 num_j2=ref_j+ceil(browse.incr_pair(2)/2); 1166 filename=fullfile_uvmat(RootPath,subdir_civ1,RootFile,'.nc',nom_type_nc,num_i1,num_i2,num_j1,num_j2); 1167 select(1)=exist(filename,'file')==2; 1168 testpair=1; 1169 else 1125 % if index==1 % case civ1 1126 % if ~get(handles.CheckCiv1,'Value') % 1127 % if ~exist(fullfile(RootPath,subdir_civ1),'dir') 1128 % errormsg=['no civ1 file available: subdirectory ' subdir_civ1 ' does not exist']; 1129 % set(handles.ListPairCiv1,'String',{}); 1130 % return 1131 % end 1132 % for ipair=1:nbpair 1133 % filename=fullfile_uvmat(RootPath,subdir_civ1,RootFile,'.nc',nom_type_nc,... 1134 % ref_i+displ_num(3,ipair),ref_i+displ_num(4,ipair),ref_j+displ_num(1,ipair),ref_j+displ_num(2,ipair)); 1135 % select(ipair)=exist(filename,'file')==2;% put flag to 0 if the file does not exist 1136 % end 1137 % % case of no displayed pair 1138 % if isequal(select,zeros(size(1:nbpair))) 1139 % if isfield(browse,'incr_pair') && ~isequal(browse.incr_pair,[0 0]) 1140 % num_i1=ref_i-floor(browse.incr_pair(1)/2); 1141 % num_i2=ref_i+ceil(browse.incr_pair(1)/2); 1142 % num_j1=ref_j-floor(browse.incr_pair(2)/2); 1143 % num_j2=ref_j+ceil(browse.incr_pair(2)/2); 1144 % filename=fullfile_uvmat(RootPath,subdir_civ1,RootFile,'.nc',nom_type_nc,num_i1,num_i2,num_j1,num_j2); 1145 % select(1)=exist(filename,'file')==2; 1146 % testpair=1; 1147 % else 1148 % % if isequal(mode,'series(Dj)')% | isequal(mode,'st_series(Dj)') 1149 % % errormsg=['no civ1 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ1]; 1150 % % else 1151 % errormsg=['no civ1 file available for the selected reference indices (i,j)= ' num2str(ref_i) ', ' num2str(ref_j) ' and subdirectory ' subdir_civ1]; 1152 % % end 1153 % set(handles.ListPairCiv1,'String',{''}); 1154 % %COMPLETER CAS STEREO 1155 % return 1156 % end 1157 % end 1158 % end 1159 % else %case civ2 alone 1160 % if ~get(handles.CheckCiv2,'Value') && ~get(handles.CheckCiv1,'Value') && ~get(handles.CheckFix1,'Value') && ~get(handles.CheckPatch1,'Value') 1161 % if ~exist(fullfile(RootPath,subdir_civ2),'dir') 1162 % msgbox_uvmat('ERROR',['no civ2 file available: subdirectory ' subdir_civ2 ' does not exist']) 1163 % set(handles.ListPairCiv2,'Value',1); 1164 % set(handles.ListPairCiv2,'String',{''}); 1165 % return 1166 % end 1167 % for ipair=1:nbpair 1168 % filename=fullfile_uvmat(RootPath,subdir_civ1,RootFile,'.nc',nom_type_nc,... 1169 % ref_i+displ_num(3,ipair),ref_i+displ_num(4,ipair),ref_j+displ_num(1,ipair),ref_j+displ_num(2,ipair)); 1170 % select(ipair)=exist(filename,'file')==2; 1171 % end 1172 % if isequal(select,zeros(size(1:nbpair))) 1173 % if isfield(browse,'incr_pair') 1174 % num_i1=ref_i-floor(browse.incr_pair(1)/2); 1175 % num_i2=ref_i+floor((browse.incr_pair(1)+1)/2); 1176 % num_j1=ref_j-floor(browse.incr_pair(2)/2); 1177 % num_j2=ref_j+floor((browse.incr_pair(2)+1)/2); 1178 % filename=fullfile_uvmat(RootPath,subdir_civ2,RootFile,'.nc',nom_type_nc,num_i1,num_i2,num_j1,num_j2); 1179 % select(1)=exist(filename,'file')==2; 1180 % else 1170 1181 % if isequal(mode,'series(Dj)')% | isequal(mode,'st_series(Dj)') 1171 % errormsg=['no civ 1 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ1];1182 % errormsg=['no civ2 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ2]; 1172 1183 % else 1173 errormsg=['no civ1 file available for the selected reference indices (i,j)= ' num2str(ref_i) ', ' num2str(ref_j) ' and subdirectory ' subdir_civ1];1184 % errormsg=['no civ2 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ2]; 1174 1185 % end 1175 set(handles.ListPairCiv1,'String',{''}); 1176 %COMPLETER CAS STEREO 1177 return 1178 end 1179 end 1180 end 1181 else %case civ2 alone 1182 if ~get(handles.CheckCiv2,'Value') && ~get(handles.CheckCiv1,'Value') && ~get(handles.CheckFix1,'Value') && ~get(handles.CheckPatch1,'Value') 1183 if ~exist(fullfile(RootPath,subdir_civ2),'dir') 1184 msgbox_uvmat('ERROR',['no civ2 file available: subdirectory ' subdir_civ2 ' does not exist']) 1185 set(handles.ListPairCiv2,'Value',1); 1186 set(handles.ListPairCiv2,'String',{''}); 1187 return 1188 end 1189 for ipair=1:nbpair 1190 filename=fullfile_uvmat(RootPath,subdir_civ1,RootFile,'.nc',nom_type_nc,... 1191 ref_i+displ_num(3,ipair),ref_i+displ_num(4,ipair),ref_j+displ_num(1,ipair),ref_j+displ_num(2,ipair)); 1192 select(ipair)=exist(filename,'file')==2; 1193 end 1194 if isequal(select,zeros(size(1:nbpair))) 1195 if isfield(browse,'incr_pair') 1196 num_i1=ref_i-floor(browse.incr_pair(1)/2); 1197 num_i2=ref_i+floor((browse.incr_pair(1)+1)/2); 1198 num_j1=ref_j-floor(browse.incr_pair(2)/2); 1199 num_j2=ref_j+floor((browse.incr_pair(2)+1)/2); 1200 filename=fullfile_uvmat(RootPath,subdir_civ2,RootFile,'.nc',nom_type_nc,num_i1,num_i2,num_j1,num_j2); 1201 select(1)=exist(filename,'file')==2; 1202 else 1203 if isequal(mode,'series(Dj)')% | isequal(mode,'st_series(Dj)') 1204 errormsg=['no civ2 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ2]; 1205 else 1206 errormsg=['no civ2 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ2]; 1207 end 1208 set(handles.ListPairCiv2,'Value',1); 1209 set(handles.ListPairCiv2,'String',{''}); 1210 return 1211 end 1212 end 1213 end 1214 end 1186 % set(handles.ListPairCiv2,'Value',1); 1187 % set(handles.ListPairCiv2,'String',{''}); 1188 % return 1189 % end 1190 % end 1191 % end 1192 % end 1215 1193 1216 1194 %% determine the menu display in .ListPairCiv1 … … 2181 2159 % --- Executes on button press in TestCiv2. 2182 2160 function TestCiv2_Callback(hObject, eventdata, handles) 2183 2184 2185 -
trunk/src/series/civ_series.m
r635 r637 208 208 end 209 209 end 210 if ~isempty(find(strcmp(FileType_A,{'mmreader','video'})))% case of video input210 if isempty(time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video'})))% case of video input 211 211 time=zeros(2,FileInfo_A.NumberOfFrames+1); 212 212 time(2,:)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate); … … 215 215 ColorType='truecolor'; 216 216 end 217 if isempty(time)% time = index i +0.001 index j by default 218 time=(MinIndex_i:MaxIndex_i)'*ones(1,MaxIndex_j-MinIndex_j+1); 219 time=time+0.001*ones(MaxIndex_i-MinIndex_i+1,1)*(MinIndex_j:MaxIndex_j); 220 time=[zeros(1,MaxIndex_j-MinIndex_j+1);time];% insert a first line of zeros 221 time=[zeros(MaxIndex_i-MinIndex_i+2,1) time];% insert a first column of zeros 222 end 223 217 224 if length(FileInfo_A) >1 %case of image with multiple frames 218 225 nbfield=length(FileInfo_A); … … 269 276 j2=j2_series_Civ1(ifield); 270 277 end 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);278 Data.Civ1_Time=(time(i2+1,j2+1)+time(i1+1,j1+1))/2; 279 Data.Civ1_Dt=time(i2+1,j2+1)-time(i1+1,j1+1); 273 280 for ilist=1:length(list_param) 274 281 Data.(Civ1_param{4+ilist})=Param.ActionInput.Civ1.(list_param{ilist});
Note: See TracChangeset
for help on using the changeset viewer.