Changeset 630
- Timestamp:
- May 6, 2013, 6:49:54 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r589 r630 703 703 drawnow 704 704 xmlfullname=fullfile(CurrentPath,ExpName,DeviceName,FileName); 705 update_imadoc(DataviewData.GeometryCalib,xmlfullname )705 update_imadoc(DataviewData.GeometryCalib,xmlfullname,'GeometryCalib') 706 706 display([xmlfullname ' updated']) 707 707 break … … 720 720 drawnow 721 721 xmlfullname=fullfile(CurrentPath,ExpName,DeviceName,RecordName,FileName); 722 update_imadoc(DataviewData.GeometryCalib,xmlfullname )722 update_imadoc(DataviewData.GeometryCalib,xmlfullname,'GeometryCalib') 723 723 display([xmlfullname ' updated']) 724 724 break -
trunk/src/geometry_calib.m
r613 r630 188 188 end 189 189 end 190 errormsg=update_imadoc(GeometryCalib,outputfile );% introduce the calibration data in the xml file190 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib');% introduce the calibration data in the xml file 191 191 if ~strcmp(errormsg,'') 192 192 msgbox_uvmat('ERROR',errormsg); … … 244 244 end 245 245 end 246 errormsg=update_imadoc(GeometryCalib,XmlName );% introduce the calibration data in the xml file246 errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file 247 247 if ~strcmp(errormsg,'') 248 248 msgbox_uvmat('ERROR',errormsg); … … 727 727 end 728 728 outputfile=[filebase '.xml']; 729 errormsg=update_imadoc(GeometryCalib,outputfile );729 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib'); 730 730 if ~strcmp(errormsg,'') 731 731 msgbox_uvmat('ERROR',errormsg); -
trunk/src/get_field.m
r606 r630 22 22 function varargout = get_field(varargin) 23 23 24 % Last Modified by GUIDE v2.5 10-Mar-2013 21:19:5224 % Last Modified by GUIDE v2.5 05-May-2013 23:54:32 25 25 26 26 % Begin initialization code - DO NOT EDIT … … 1489 1489 1490 1490 1491 % --- Executes on button press in CheckScalar. 1492 function checkbox22_Callback(hObject, eventdata, handles) 1493 % hObject handle to CheckScalar (see GCBO) 1494 % eventdata reserved - to be defined in a future version of MATLAB 1495 % handles structure with handles and user data (see GUIDATA) 1496 1497 % Hint: get(hObject,'Value') returns toggle state of CheckScalar 1498 1499 1500 % --- Executes on button press in checkbox23. 1501 function checkbox23_Callback(hObject, eventdata, handles) 1502 % hObject handle to checkbox23 (see GCBO) 1503 % eventdata reserved - to be defined in a future version of MATLAB 1504 % handles structure with handles and user data (see GUIDATA) 1505 1506 % Hint: get(hObject,'Value') returns toggle state of checkbox23 -
trunk/src/proj_field.m
r629 r630 935 935 %% initiate Matlab structure for physical field 936 936 [ProjData,errormsg]=proj_heading(FieldData,ObjectData); 937 if ~isempty(errormsg) 938 return 939 end 937 940 938 941 %% reproduce initial plane position and angle … … 1044 1047 case 'scattered' 1045 1048 if strcmp(ProjMode{icell},'interp_tps') 1046 continue %skip for interp_tps(needs tps field cell)1049 continue %skip for next cell (needs tps field cell) 1047 1050 end 1048 1051 coord_x=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)});% initial x coordinates -
trunk/src/series.m
r623 r630 905 905 %% set length of waitbar 906 906 displ_time(handles) 907 908 907 909 908 %% set default options in menu 'Fields' … … 1907 1906 nb_netcdf=numel(find(strcmp('netcdf',SeriesData.FileType))); 1908 1907 end 1908 if nb_civ>=1 1909 menu=set_veltype_display(SeriesData.FileInfo{1}.CivStage,SeriesData.FileType{1}); 1910 set(handles.VelType,'String',[{'*'};menu]) 1911 if nb_civ>=2 1912 menu=set_veltype_display(SeriesData.FileInfo{2}.CivStage,SeriesData.FileType{2}); 1913 set(handles.VelType_1,'String',[{'*'};menu]) 1914 end 1915 end 1916 1917 1909 1918 1910 1919 %% Check whether alphabetical sorting of input Subdir is alowed by the Action fct (for multiples series entries) … … 2247 2256 %------------------------------------------------------------------------ 2248 2257 % --- Executes on button press in CheckObject. 2258 %------------------------------------------------------------------------ 2249 2259 function CheckObject_Callback(hObject, eventdata, handles) 2250 %------------------------------------------------------------------------ 2260 2251 2261 hset_object=findobj(allchild(0),'tag','set_object');%find the set_object interface handle 2252 value=get(handles.CheckObject,'Value'); 2253 if value 2262 if get(handles.CheckObject,'Value') 2254 2263 SeriesData=get(handles.series,'UserData'); 2255 if ~(isfield(SeriesData,'ProjObject')&&~isempty(SeriesData.ProjObject)) 2264 if isfield(SeriesData,'ProjObject') && ~isempty(SeriesData.ProjObject) 2265 set(handles.ViewObject,'Value',1) 2266 ViewObject_Callback(hObject, eventdata, handles) 2267 else 2256 2268 if ishandle(hset_object) 2257 2269 uistack(hset_object,'top')% show the GUI set_object if opened … … 2288 2300 set(handles.series,'UserData',SeriesData); 2289 2301 end 2302 set(handles.EditObject,'Visible','on'); 2290 2303 set(handles.DeleteObject,'Visible','on'); 2291 2304 set(handles.ViewObject,'Visible','on'); 2292 2305 set(handles.ProjObject,'Visible','on'); 2293 2306 else 2307 set(handles.EditObject,'Visible','off'); 2294 2308 set(handles.DeleteObject,'Visible','off'); 2295 2309 set(handles.ViewObject,'Visible','off'); … … 2299 2313 set(handles.ProjObject,'Visible','off'); 2300 2314 end 2301 %set(handles.series,'UserData',SeriesData) 2315 2316 %------------------------------------------------------------------------ 2317 % --- Executes on button press in ViewObject. 2318 %------------------------------------------------------------------------ 2319 function ViewObject_Callback(hObject, eventdata, handles) 2320 2321 if get(handles.ViewObject,'Value') 2322 set(handles.EditObject,'Value',0) 2323 UserData=get(handles.series,'UserData'); 2324 hset_object=set_object(UserData.ProjObject); 2325 set(hset_object,'Name','view_object_series') 2326 else 2327 hset_object=findobj(allchild(0),'Tag','set_object'); 2328 if ~isempty(hset_object) 2329 delete(hset_object) 2330 end 2331 end 2332 2333 %------------------------------------------------------------------------ 2334 % --- Executes on button press in EditObject. 2335 %------------------------------------------------------------------------ 2336 function EditObject_Callback(hObject, eventdata, handles) 2337 2338 if get(handles.EditObject,'Value') 2339 set(handles.ViewObject,'Value',0) 2340 UserData=get(handles.series,'UserData'); 2341 hset_object=set_object(UserData.ProjObject); 2342 set(hset_object,'Name','edit_object_series') 2343 set(get(hset_object,'Children'),'Enable','on') 2344 else 2345 hset_object=findobj(allchild(0),'Tag','set_object'); 2346 if ~isempty(hset_object) 2347 delete(hset_object) 2348 end 2349 end 2350 2351 %------------------------------------------------------------------------ 2352 % --- Executes on button press in DeleteObject. 2353 %------------------------------------------------------------------------ 2354 function DeleteObject_Callback(hObject, eventdata, handles) 2355 2356 if get(handles.DeleteObject,'Value') 2357 SeriesData=get(handles.series,'UserData'); 2358 SeriesData.ProjObject=[]; 2359 set(handles.series,'UserData',SeriesData) 2360 set(handles.ProjObject,'String','') 2361 set(handles.CheckObject,'Value',0) 2362 set(handles.DeleteObject,'Visible','off') 2363 set(handles.ViewObject,'Visible','off') 2364 set(handles.DeleteObject,'Value',0) 2365 end 2302 2366 2303 2367 %-------------------------------------------------------------- 2304 2368 function CheckMask_Callback(hObject, eventdata, handles) 2305 value=get(handles.CheckMask,'Value'); 2306 if value2369 2370 if get(handles.CheckMask,'Value') 2307 2371 msgbox_uvmat('ERROR','not implemented yet') 2308 2372 end … … 2743 2807 2744 2808 2745 function ActionInput_Callback(hObject, eventdata, handles)2746 2747 2748 % --- Executes on button press in DeleteObject.2749 function DeleteObject_Callback(hObject, eventdata, handles)2750 if get(handles.DeleteObject,'Value')2751 SeriesData=get(handles.series,'UserData');2752 SeriesData.ProjObject=[];2753 set(handles.series,'UserData',SeriesData)2754 set(handles.ProjObject,'String','')2755 set(handles.CheckObject,'Value',0)2756 set(handles.DeleteObject,'Visible','off')2757 set(handles.ViewObject,'Visible','off')2758 set(handles.DeleteObject,'Value',0)2759 end2760 2761 % --- Executes on button press in ViewObject.2762 function ViewObject_Callback(hObject, eventdata, handles)2763 if get(handles.ViewObject,'Value')2764 UserData=get(handles.series,'UserData');2765 set_object(UserData.ProjObject)2766 else2767 hset_object=findobj(allchild(0),'Tag','set_object');2768 if ~isempty(hset_object)2769 delete(hset_object)2770 end2771 end2772 2809 2773 2810 … … 2778 2815 NbSlice=str2num(get(handles.num_NbSlice,'String')); 2779 2816 set(handles.num_NbProcess,'String',num2str(NbSlice)) 2817 2818 %------------------------------------------------------------------------ 2819 % --- set the visibility of relevant velocity type menus: 2820 function menu=set_veltype_display(Civ,FileType) 2821 %------------------------------------------------------------------------ 2822 if ~exist('FileType','var') 2823 FileType='civx'; 2824 end 2825 switch FileType 2826 case 'civx' 2827 menu={'civ1';'interp1';'filter1';'civ2';'interp2';'filter2'}; 2828 if isequal(Civ,0) 2829 imax=0; 2830 elseif isequal(Civ,1) || isequal(Civ,2) 2831 imax=1; 2832 elseif isequal(Civ,3) 2833 imax=3; 2834 elseif isequal(Civ,4) || isequal(Civ,5) 2835 imax=4; 2836 elseif isequal(Civ,6) %patch2 2837 imax=6; 2838 end 2839 case 'civdata' 2840 menu={'civ1';'filter1';'civ2';'filter2'}; 2841 if isequal(Civ,0) 2842 imax=0; 2843 elseif isequal(Civ,1) || isequal(Civ,2) 2844 imax=1; 2845 elseif isequal(Civ,3) 2846 imax=2; 2847 elseif isequal(Civ,4) || isequal(Civ,5) 2848 imax=3; 2849 elseif isequal(Civ,6) %patch2 2850 imax=4; 2851 end 2852 end 2853 menu=menu(1:imax); 2854 -
trunk/src/set_object.m
r627 r630 419 419 drawnow 420 420 421 %% update the object in the GUI series if relevant 422 if strcmp(get(handles.set_object,'Name'),'edit_object_series') 423 hseries=findobj(allchild(0),'Tag','series'); 424 if ~isempty(hseries) 425 SeriesData=get(hseries,'UserData'); 426 SeriesData.ProjObject=read_GUI(handles.set_object);%read the parameters defining the object in the GUI set_object 427 set(hseries,'UserData',SeriesData); 428 end 429 set(handles.PLOT,'BackgroundColor',[1 0 0]) 430 return 431 end 432 421 433 %% read the object parameters in the GUI set_object 422 434 ObjectData=read_GUI(handles.set_object);%read the parameters defining the object in the GUI set_object … … 449 461 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; % axes for plot_object 450 462 UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation 451 else 452 % if ~strcmp(ListObject{end},'') 453 % ListObject=[ListObject;{''}]; %append a blank to the list (if nort already done) to indicate the creation of a new object 454 % set(handles.ListObject,'String',ListObject) 455 % end 456 % IndexObj=length(ListObject); 457 % set(handles.uvmat,'UserData',UvData) 463 else 458 464 IndexObj=get(hhuvmat.ListObject,'Value');% index of the selected object for display in uvmat 459 465 end 460 466 461 %set or modify(edit mode) the name of the currently selected object467 %set or modify(edit mode) the name of the currently selected object 462 468 detectname=1; 463 469 ObjectNameNew=ObjectName; … … 495 501 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; %axes taken as object display handle by defualt 496 502 end 497 %set(hhuvmat.edit_object,'Value',1)% set the current object to edit mode498 503 499 504 %% plot the field projected on the object -
trunk/src/update_imadoc.m
r499 r630 1 1 %'update_imadoc': update an xml file with geometric calibration parameters 2 2 %-------------------------------------------------------------------------- 3 % function update_imadoc( GeometryCalib,outputfile)3 % function update_imadoc(Struct,outputfile) 4 4 % 5 5 %INPUT: 6 % GeometryCalib: structure containing the calibration parameters6 % Struct: structure containing the calibration parameters 7 7 % outputfile: xml file to modify 8 % StructName : Name of the field in the xml file 8 9 %------------------------------------------------------------- 9 function errormsg=update_imadoc( GeometryCalib,outputfile)10 function errormsg=update_imadoc(Struct,outputfile,StructName) 10 11 errormsg=''; 11 12 testappend=0; … … 29 30 testappend=1; 30 31 %if the xml file is ImaDoc 31 uid_calib=find(t, 'ImaDoc/GeometryCalib');32 if isempty(uid_calib) %if GeometryCalibdoes not already exists, create it33 [t,uid_calib]=add(t,1,'element', 'GeometryCalib');34 else %if GeometryCalibalready exists, delete its content32 uid_calib=find(t,['ImaDoc/' StructName]); 33 if isempty(uid_calib) %if Struct does not already exists, create it 34 [t,uid_calib]=add(t,1,'element',StructName); 35 else %if Struct already exists, delete its content 35 36 uid_child=children(t,uid_calib); 36 37 t=delete(t,uid_child); … … 44 45 t=set(t,1,'name','ImaDoc'); 45 46 % in case of movie (avi file), copy timing info in the new xml file 46 [pp,outputroot]=fileparts(outputfile);47 % [pp,outputroot]=fileparts(outputfile); 47 48 % imainfo=[]; 48 if exist(fullfile(pp,[outputroot '.avi']),'file')49 FileName=fullfile(pp,[outputroot '.avi']);50 hhh=which('videoreader');51 if isempty(hhh)%use old video function of matlab52 imainfo=aviinfo(FileName);53 imainfo.FrameRate=imainfo.FramesPerSecond;54 imainfo.NumberOfFrames=imainfo.NumFrames;55 else %use video function videoreader of matlab56 imainfo=get(videoreader(FileName));57 end58 if ~isempty(imainfo)59 [t,uid_camera]=add(t,1,'element','Camera');60 Camera.TimeUnit='s';61 Camera.BurstTiming.Time=0;62 Camera.BurstTiming.Dti=1/imainfo.FrameRate;63 Camera.BurstTiming.NbDti=imainfo.NumberOfFrames-1;64 t=struct2xml(Camera,t,uid_camera);65 end66 end67 [t,uid_calib]=add(t,1,'element', 'GeometryCalib');49 % if exist(fullfile(pp,[outputroot '.avi']),'file') 50 % FileName=fullfile(pp,[outputroot '.avi']); 51 % hhh=which('videoreader'); 52 % if isempty(hhh)%use old video function of matlab 53 % imainfo=aviinfo(FileName); 54 % imainfo.FrameRate=imainfo.FramesPerSecond; 55 % imainfo.NumberOfFrames=imainfo.NumFrames; 56 % else %use video function videoreader of matlab 57 % imainfo=get(videoreader(FileName)); 58 % end 59 % if ~isempty(imainfo) 60 % [t,uid_camera]=add(t,1,'element','Camera'); 61 % Camera.TimeUnit='s'; 62 % Camera.BurstTiming.Time=0; 63 % Camera.BurstTiming.Dti=1/imainfo.FrameRate; 64 % Camera.BurstTiming.NbDti=imainfo.NumberOfFrames-1; 65 % t=struct2xml(Camera,t,uid_camera); 66 % end 67 % end 68 [t,uid_calib]=add(t,1,'element',StructName); 68 69 end 69 70 70 71 %% save the output file 71 t=struct2xml( GeometryCalib,t,uid_calib);72 t=struct2xml(Struct,t,uid_calib); 72 73 save(t,outputfile);
Note: See TracChangeset
for help on using the changeset viewer.