- Timestamp:
- Apr 4, 2013, 12:08:47 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/fill_GUI.m
r598 r603 16 16 %handles=guidata(GUI_handle); 17 17 children=get(GUI_handle,'children'); 18 handles=[]; 18 19 for ichild=1:numel(children) 19 20 handles.(get(children(ichild),'tag'))=children(ichild); -
trunk/src/proj_field.m
r595 r603 891 891 if isfield(ObjectData,'DX') && ~isempty(ObjectData.DX) 892 892 DX=abs(ObjectData.DX);%mesh of interpolation points 893 else 893 elseif isfield(FieldData,'CoordMesh') 894 894 DX=FieldData.CoordMesh; 895 895 end 896 896 if isfield(ObjectData,'DY') && ~isempty(ObjectData.DY) 897 897 DY=abs(ObjectData.DY);%mesh of interpolation points 898 else 898 elseif isfield(FieldData,'CoordMesh') 899 899 DY=FieldData.CoordMesh; 900 900 end -
trunk/src/series.m
r602 r603 542 542 543 543 %% determine the selected reference field indices for pair display 544 ref_i=1; %default ref_i is a reference frame index used to find existing pairs from PIV 545 if ~isempty(i1) 546 ref_i=i1; 547 if ~isempty(i2)548 ref_i=floor((ref_i+i2)/2);% reference image number corresponding to the file549 550 end 544 if isempty(i1) 545 i1=1; 546 end 547 if isempty(i2) 548 i2=i1; 549 end 550 ref_i=floor((i1+i2)/2);% reference image number corresponding to the file 551 551 set(handles.num_ref_i,'String',num2str(ref_i)); 552 ref_j=1; %default ref_j is a reference frame index used to find existing pairs from PIV 553 if ~isempty(j1) 554 ref_j=j1; 555 if ~isempty(j2) 556 ref_j=floor((j1+j2)/2); 557 end 558 end 552 set(handles.num_ref_i,'UserData',[i1 i2]) 553 if isempty(j1) 554 j1=1; 555 end 556 if isempty(j2) 557 j2=j1; 558 end 559 ref_j=floor((j1+j2)/2);% reference image number corresponding to the file 559 560 set(handles.num_ref_j,'String',num2str(ref_j)); 561 set(handles.num_ref_j,'UserData',[j1 j2]) 560 562 561 563 %% update the list of recent files in the menubar and save it for future opening … … 793 795 %% update the series info in 'UserData' 794 796 SeriesData=get(handles.series,'UserData'); 797 SeriesData.Ref_i{iview}=get(handles.num_ref_i,'UserData'); 798 SeriesData.Ref_j{iview}=get(handles.num_ref_j,'UserData'); 795 799 SeriesData.i1_series{iview}=i1_series; 796 800 SeriesData.i2_series{iview}=i2_series; … … 2367 2371 commandwindow; %brings the Matlab command window to the front 2368 2372 2373 2374 % -------------------------------------------------------------------- 2375 function MenuImportConfig_Callback(hObject, eventdata, handles) 2376 % -------------------------------------------------------------------- 2377 InputTable=get(handles.InputTable,'Data'); 2378 [FileName, PathName] = uigetfile( ... 2379 {'*.xml', ' (*.xml)'; 2380 '*.xml', '.xml files '; ... 2381 '*.*', 'All Files (*.*)'}, ... 2382 'Pick a file',InputTable{1,1}); 2383 filexml=[PathName FileName];%complete file name 2384 if isempty(filexml),return;end %abandon if no file is introduced by the browser 2385 Param=xml2struct(filexml); 2386 fill_GUI(Param,handles.series) 2369 2387 2370 2388 % --- Executes on selection change in RunMode. -
trunk/src/series/civ_input.m
r599 r603 25 25 26 26 27 % Last Modified by GUIDE v2.5 0 1-Apr-2013 10:00:5727 % Last Modified by GUIDE v2.5 04-Apr-2013 09:14:14 28 28 % Begin initialization code - DO NOT EDIT 29 29 gui_Singleton = 1; … … 63 63 %% set visibility options: case civ_matlab 64 64 if strcmp(Param.Action.ActionName,'civ_series') 65 set(handles.Program,'String','civ_series') 65 66 set(handles.num_MaxDiff,'Visible','on') 66 67 set(handles.num_MaxVel,'Visible','on') … … 87 88 FileType=SeriesData.FileType{1}; 88 89 FileInfo=SeriesData.FileInfo{1}; 90 Ref_i=SeriesData.Ref_i{1}; 91 Ref_j=SeriesData.Ref_j{1}; 92 FileInput=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomTypeInput,Ref_i(1),Ref_i(2),Ref_j(1),Ref_j(2)); 89 93 90 94 %% case of netcdf file as input, get the processing stage and look for corresponding images … … 94 98 NomTypeNc=''; 95 99 switch FileType 100 case {'image','multimage','video','mmreader'} 101 NomTypeIma=NomTypeInput; 96 102 case 'civdata' 103 if ~strcmp(Param.Action.ActionName,'civ_series') 104 msgbox_uvmat('ERROR','bad input data file: open an image or a nc file from civ_series') 105 return 106 end 97 107 NomTypeNc=NomTypeInput; 98 108 ind_opening=FileInfo.CivStage; … … 105 115 end 106 116 imageinput=''; 107 set(handles.Program,'Value',1) %select civ/Matlab by default 117 Data=nc2struct(FileInput,'ListGlobalAttribute','Civ2_ImageA','Civ1_ImageA','Civ2_ImageB','Civ1_ImageB'); 118 if isfield(Data,'Txt') 119 errormsg=Data.Txt; 120 return 121 %TODO: introduce the image in the input table of series 122 end 108 123 % if ~isempty(Data.Civ2_ImageB)%get the corresponding input image in the netcdf file 109 124 % imageinput=Data.Civ2_ImageB; … … 131 146 end 132 147 end 133 if ~exist(imageinput,'file')134 imageinput=fullfile_uvmat(RootPath,regexprep(SubDir,'.civ(_?)(\d*)$',''),RootFile,'.png',NomTypeIma,i1,[],j1);135 end148 % if ~exist(imageinput,'file') 149 % imageinput=fullfile_uvmat(RootPath,regexprep(SubDir,'.civ(_?)(\d*)$',''),RootFile,'.png',NomTypeIma,i1,[],j1); 150 % end 136 151 case 'civxdata'% case of civx data, 137 152 NomTypeNc=NomTypeInput; … … 140 155 msgbox_uvmat('ERROR','old civX convention, use the GUI civ') 141 156 return 142 case {'image','multimage','video','mmreader'} 143 NomTypeIma=NomTypeInput; 157 144 158 end 145 159 … … 160 174 161 175 %display the parameters stored on the GUI series 162 set(handles.first_i,'String',num2str(Param.IndexRange.first_i))163 set(handles.incr_i,'String',num2str(Param.IndexRange.incr_i))164 set(handles.last_i,'String',num2str(Param.IndexRange.last_i))176 % set(handles.first_i,'String',num2str(Param.IndexRange.first_i)) 177 % set(handles.incr_i,'String',num2str(Param.IndexRange.incr_i)) 178 % set(handles.last_i,'String',num2str(Param.IndexRange.last_i)) 165 179 set(handles.ref_i,'String',num2str(Param.IndexRange.first_i)) 166 180 if isfield(Param.IndexRange,'first_j') 167 set(handles.first_j,'String',num2str(Param.IndexRange.first_j))168 set(handles.incr_j,'String',num2str(Param.IndexRange.incr_j))169 set(handles.last_j,'String',num2str(Param.IndexRange.last_j))170 set(handles.ref_ i,'String',num2str(Param.IndexRange.first_j))181 % set(handles.first_j,'String',num2str(Param.IndexRange.first_j)) 182 % set(handles.incr_j,'String',num2str(Param.IndexRange.incr_j)) 183 % set(handles.last_j,'String',num2str(Param.IndexRange.last_j)) 184 set(handles.ref_j,'String',num2str(Param.IndexRange.first_j)) 171 185 end 172 186 … … 195 209 196 210 %set(handles.(ListOptions{min(ind_opening+1,6)}),'value',1) 197 update_CivOptions(handles,ind_opening) 211 198 212 199 213 %% set the menus of image pairs and default selection for civ_input %%%%%%%%%%%%%%%%%%% … … 286 300 time=[zeros(1,size(time,2)); time]; %insert a horizontal line of zeros 287 301 CivInputData.Time=time; 302 CivInputData.NomTypeIma=NomTypeIma; 288 303 set(handles.civ_input,'UserData',CivInputData) 289 304 %set(handles.ImaDoc,'UserData',time); %store the matrix of times 290 set(handles.NomType,'String',NomTypeIma)291 305 set(handles.dt_unit,'String',['dt in m' TimeUnit]);%display dt in unit 10-3 of the time (e.g ms) 292 306 set(handles.TimeUnit,'String',TimeUnit); … … 303 317 num_ref_j=str2num(get(handles.ref_j,'String')); 304 318 319 update_CivOptions(handles,ind_opening) 305 320 306 321 %% list the possible index pairs, depending on the option set in ListPairMode … … 401 416 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 402 417 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 403 %[RootPath, SubDirImages,RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileType,MovieObject]=find_file_series(FilePath,[FileName ImaExt]);418 %[RootPath,ImageACiv1,RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileType,MovieObject]=find_file_series(FilePath,[FileName ImaExt]); 404 419 switch Param.FileType{1} 405 420 case {'image','multimage','video','mmreader'} … … 409 424 end 410 425 set(handles.RootPath,'String',RootPath) 411 set(handles. SubDirImages,'String',SubDirImages)426 set(handles.ImageACiv1,'String',SubDirImages) 412 427 set(handles.RootFile,'String',RootFile) 413 428 if strcmp(ExtInput,'.nc') … … 416 431 SubDirCiv= '.civ'; 417 432 end 418 set(handles. SubdirCiv1,'String',SubDirCiv)419 set(handles. SubdirCiv2,'String',SubDirCiv)433 set(handles.ImageBCiv1,'String',SubDirCiv) 434 set(handles.ImageACiv2,'String',SubDirCiv) 420 435 browse=get(handles.RootPath,'UserData'); 421 436 browse.incr_pair=[0 0];%default … … 496 511 %------------------------------------------------------------------------ 497 512 % --- Executes on carriage return on the subdir checkciv1 edit window 498 function SubdirCiv1_Callback(hObject, eventdata, handles)499 %------------------------------------------------------------------------ 500 SubDir=get(handles. SubdirCiv1,'String');513 function ImageBCiv1_Callback(hObject, eventdata, handles) 514 %------------------------------------------------------------------------ 515 SubDir=get(handles.ImageBCiv1,'String'); 501 516 menu_str=get(handles.ListSubdirCiv1,'String');% read the list of subdirectories for update 502 517 ichoice=find(strcmp(SubDir,menu_str),1); … … 508 523 set(handles.ListSubdirCiv1,'Value',ilist)% select the selected subdir in the menu 509 524 if get(handles.CheckCiv1,'Value')% if Civ1 is performed 510 set(handles. SubdirCiv2,'String',SubDir);% set by default civ2 directory the same as civ1525 set(handles.ImageACiv2,'String',SubDir);% set by default civ2 directory the same as civ1 511 526 % set(handles.ListSubdirCiv2,'Value',ilist) 512 527 else % if Civ1 data already exist … … 519 534 %------------------------------------------------------------------------ 520 535 % --- Executes on carriage return on the SubDir checkciv1 edit window 521 function SubdirCiv2_Callback(hObject, eventdata, handles)522 %------------------------------------------------------------------------ 523 SubDir=get(handles. SubdirCiv1,'String');536 function ImageACiv2_Callback(hObject, eventdata, handles) 537 %------------------------------------------------------------------------ 538 SubDir=get(handles.ImageBCiv1,'String'); 524 539 menu_str=get(handles.ListSubdirCiv2,'String');% read the list of subdirectories for update 525 540 ichoice=find(strcmp(SubDir,menu_str),1); … … 594 609 % end 595 610 set(handles.PairIndices,'Visible','on') 596 set(handles. SubdirCiv1,'Visible','on')611 set(handles.ImageBCiv1,'Visible','on') 597 612 set(handles.TitleSubdirCiv1,'Visible','on') 598 613 if opening==0 … … 605 620 set(handles.TitlePairCiv2,'Visible','on') 606 621 set(handles.TitleSubdirCiv2,'Visible','on') 607 set(handles. SubdirCiv2,'Visible','on')622 set(handles.ImageACiv2,'Visible','on') 608 623 %set(handles.ListSubdirCiv2,'Visible','on') 609 624 set(handles.ListPairCiv2,'Visible','on') … … 616 631 else 617 632 set(handles.TitleSubdirCiv2,'Visible','off') 618 set(handles. SubdirCiv2,'Visible','off')633 set(handles.ImageACiv2,'Visible','off') 619 634 set(handles.ListPairCiv2,'Visible','off') 620 635 end … … 953 968 function enable_i(handles, state) 954 969 set(handles.itext,'Visible',state) 955 set(handles.first_i,'Visible',state)956 set(handles.last_i,'Visible',state)957 set(handles.incr_i,'Visible',state)970 % set(handles.first_i,'Visible',state) 971 % set(handles.last_i,'Visible',state) 972 % set(handles.incr_i,'Visible',state) 958 973 set(handles.nb_field,'Visible',state) 959 974 set(handles.ref_i,'Visible',state) … … 961 976 function enable_j(handles, state) 962 977 set(handles.jtext,'Visible',state) 963 set(handles.first_j,'Visible',state)964 set(handles.last_j,'Visible',state)965 set(handles.incr_j,'Visible',state)978 % set(handles.first_j,'Visible',state) 979 % set(handles.last_j,'Visible',state) 980 % set(handles.incr_j,'Visible',state) 966 981 set(handles.nb_field2,'Visible',state) 967 982 set(handles.ref_j,'Visible',state) … … 1094 1109 %% initialisation 1095 1110 errormsg=''; 1111 CivInputData=get(handles.civ_input,'UserData'); 1096 1112 %browse=get(handles.RootPath,'UserData'); 1097 1113 compare_list=get(handles.ListCompareMode,'String'); … … 1108 1124 mode=mode_list{mode_value}; 1109 1125 end 1110 nom_type_ima= get(handles.NomType,'String');1126 nom_type_ima=CivInputData.NomTypeIma; 1111 1127 1112 1128 %% determine nom_type_nc, nomenclature type of the .nc files: … … 1114 1130 1115 1131 %% reads .nc subdirectoy and image numbers from the interface 1116 SubDirImages=get(handles. SubDirImages,'String');1117 subdir_civ1=[SubDirImages get(handles. SubdirCiv1,'String')];%subdirectory subdir_civ1 for the netcdf data1118 subdir_civ2=[SubDirImages get(handles. SubdirCiv2,'String')];%subdirectory subdir_civ2 for the netcdf data1132 SubDirImages=get(handles.ImageACiv1,'String'); 1133 subdir_civ1=[SubDirImages get(handles.ImageBCiv1,'String')];%subdirectory subdir_civ1 for the netcdf data 1134 subdir_civ2=[SubDirImages get(handles.ImageACiv2,'String')];%subdirectory subdir_civ2 for the netcdf data 1119 1135 ref_i=str2double(get(handles.ref_i,'String')); 1120 1136 ref_j=[]; … … 1576 1592 nbslice=1; 1577 1593 1578 % subdir=get(handles. SubdirCiv1,'String');1594 % subdir=get(handles.ImageBCiv1,'String'); 1579 1595 [Path,Name]=fileparts(filebase); 1580 1596 if ~isdir(Path) … … 1672 1688 % end 1673 1689 % end 1674 % set(handles. SubdirCiv1,'String',SubDir);1690 % set(handles.ImageBCiv1,'String',SubDir); 1675 1691 % errormsg=find_netcpair_civ(handles,1); 1676 1692 % if ~isempty(errormsg) … … 1693 1709 % end 1694 1710 % end 1695 % set(handles. SubdirCiv2,'String',SubDir);1711 % set(handles.ImageACiv2,'String',SubDir); 1696 1712 1697 1713 %------------------------------------------------------------------------ … … 2136 2152 end 2137 2153 2138 function NomType_Callback(hObject, eventdata, handles)2139 set(handles.RootPath,'BackgroundColor',[1 1 0])%paint RootName edit box in yellow to indicate that the file input is proceeding2140 RootPath=get(handles.RootPath,'String');2141 RootFile=get(handles.RootFile,'String');2142 SubDirImages=get(handles.SubDirImages,'String');2143 ref_i=str2num(get(handles.ref_i,'String'));2144 ref_j=str2num(get(handles.ref_j,'String'));2145 NomType=get(handles.NomType,'String');2146 ImaExt=get(handles.ImaExt,'String');2147 fileinput=fullfile_uvmat(RootPath,SubDirImages,RootFile,ImaExt,NomType,ref_i,[],ref_j);2148 errormsg=display_file_name(handles,fileinput);2149 if ~isempty(errormsg)2150 msgbox_uvmat('ERROR',errormsg)2151 end2152 set(handles.RootPath,'BackgroundColor',[1 1 1])%paint RootName back to white to indicate that the file input is finished2153 2154 % --- Executes on selection change in Program.2155 function Program_Callback(hObject, eventdata, handles)2156 ListProgram=get(handles.Program,'String');2157 Program=ListProgram{get(handles.Program,'value')};2158 switch Program2159 case 'CivX'2160 set(handles.num_MaxDiff,'Visible','off')2161 set(handles.num_MaxVel,'Visible','off')2162 set(handles.title_MaxVel,'Visible','off')2163 set(handles.num_Nx,'Visible','on')2164 set(handles.num_Ny,'Visible','on')2165 set(handles.title_Nx,'Visible','on')2166 set(handles.title_Ny,'Visible','on')2167 set(handles.title_MaxDiff,'Visible','off')2168 set(handles.num_CorrSmooth,'Style','edit')2169 set(handles.num_CorrSmooth,'String','1')2170 set(handles.BATCH,'Enable','on')2171 set(handles.CheckThreshold,'Visible','off')2172 set(handles.CheckDeformation,'Value',1)2173 set(handles.CheckDecimal,'Value',1)2174 case {'civ_matlab','civ_matlab.sh'}2175 set(handles.num_MaxDiff,'Visible','on')2176 set(handles.num_MaxVel,'Visible','on')2177 set(handles.title_MaxVel,'Visible','on')2178 set(handles.title_MaxDiff,'Visible','on')2179 set(handles.num_Nx,'Visible','off')2180 set(handles.num_Ny,'Visible','off')2181 set(handles.title_Nx,'Visible','off')2182 set(handles.title_Ny,'Visible','off')2183 set(handles.num_CorrSmooth,'Style','popupmenu')2184 set(handles.num_CorrSmooth,'Value',1)2185 set(handles.num_CorrSmooth,'String',{'1';'2'})2186 set(handles.CheckThreshold,'Visible','on')2187 set(handles.CheckDeformation,'Value',0)% desactivate (work in progress)2188 set(handles.CheckDecimal,'Value',0)% desactivate (work in progress)2189 end2190 2191 2154 % --- Executes on button press in TestPatch1. 2192 2155 function TestPatch1_Callback(hObject, eventdata, handles) … … 2236 2199 % --- Executes on button press in TestCiv2. 2237 2200 function TestCiv2_Callback(hObject, eventdata, handles) 2201 2202 2203 2204 function NcFileCiv2_Callback(hObject, eventdata, handles) 2205 % hObject handle to NcFileCiv2 (see GCBO) 2206 % eventdata reserved - to be defined in a future version of MATLAB 2207 % handles structure with handles and user data (see GUIDATA) 2208 2209 % Hints: get(hObject,'String') returns contents of NcFileCiv2 as text 2210 % str2double(get(hObject,'String')) returns contents of NcFileCiv2 as a double 2211 2212 2213 % --- Executes during object creation, after setting all properties. 2214 function NcFileCiv2_CreateFcn(hObject, eventdata, handles) 2215 % hObject handle to NcFileCiv2 (see GCBO) 2216 % eventdata reserved - to be defined in a future version of MATLAB 2217 % handles empty - handles not created until after all CreateFcns called 2218 2219 % Hint: edit controls usually have a white background on Windows. 2220 % See ISPC and COMPUTER. 2221 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 2222 set(hObject,'BackgroundColor','white'); 2223 end 2224 2225 2226 2227 function ImageACiv1_Callback(hObject, eventdata, handles) 2228 % hObject handle to ImageACiv1 (see GCBO) 2229 % eventdata reserved - to be defined in a future version of MATLAB 2230 % handles structure with handles and user data (see GUIDATA) 2231 2232 % Hints: get(hObject,'String') returns contents of ImageACiv1 as text 2233 % str2double(get(hObject,'String')) returns contents of ImageACiv1 as a double
Note: See TracChangeset
for help on using the changeset viewer.