- Timestamp:
- Feb 18, 2010, 7:37:48 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dataview.m
r12 r17 4 4 % associated with the GUI dataview.fig 5 5 % 6 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 6 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 7 7 % Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org. 8 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 8 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 9 9 % This file is part of the toolbox UVMAT. 10 10 % … … 18 18 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 19 % GNU General Public License (file UVMAT/COPYING.txt) for more details. 20 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 20 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 21 21 22 22 function varargout = dataview(varargin) … … 43 43 % End initialization code - DO NOT EDIT 44 44 45 45 %------------------------------------------------------------------------ 46 46 % --- Executes just before dataview is made visible. 47 47 function dataview_OpeningFcn(hObject, eventdata, handles, RootDir, SubCampaignTst,GeometryCalib) 48 48 %------------------------------------------------------------------------ 49 49 % Choose default command line output for dataview 50 50 handles.output = 'Cancel'; … … 107 107 end 108 108 109 110 111 109 %------------------------------------------------------------------------ 112 110 % --- Outputs from this function are returned to the command line. … … 117 115 delete(handles.figure) 118 116 119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%120 117 %------------------------------------------------------------------------ 121 118 % --- Executes on button press in browser. … … 136 133 CampaignDir=uigetdir(CurrentFile,'Open the Campaign directory'); %file browser 137 134 set(handles.RootDirectory,'String',CampaignDir) 138 139 135 RootDirectory_Callback(hObject, eventdata, handles) 140 136 -
trunk/src/geometry_calib.m
r12 r17 109 109 %set(htable,'ColumnNames',{'x','y','z','X(pixels)','Y(pixels)'}) 110 110 111 %------------------------------------------------------------------------ 111 112 % --- Outputs from this function are returned to the command line. 112 113 function varargout = geometry_calib_OutputFcn(hObject, eventdata, handles) 113 % varargout cell array for returning output args (see VARARGOUT); 114 % hObject handle to figure 115 % eventdata reserved - to be defined in a future version of MATLAB 116 % handles structure with handles and user data (see GUIDATA) 117 114 %------------------------------------------------------------------------ 118 115 % Get default command line output from handles structure 119 116 varargout{1} = handles.output; … … 123 120 function Phi_Callback(hObject, eventdata, handles) 124 121 125 126 127 128 %-------------------------------------------------- 122 %------------------------------------------------------------------------ 129 123 %read input xml file and update the edit boxes 130 124 function loadfile(handles,fileinput) 131 125 %------------------------------------------------------------------------ 132 126 %read the input xml file 133 127 t=xmltree(fileinput); … … 267 261 unit=unitlist{get(handles.CoordUnit,'value')}; 268 262 GeometryCalib.CoordUnit=unit; 269 263 GeometryCalib.SourceCalib.PointCoord=Object.Coord; 270 264 huvmat=findobj(allchild(0),'Name','uvmat'); 271 265 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat … … 285 279 outputfile=answer{1}; 286 280 end 287 testappend=0; 288 if exist(outputfile,'file');%=1 if the output file already exists, 0 else 289 t=xmltree(outputfile); %read the file 290 backupfile=outputfile; 291 testexist=2; 292 while testexist==2 293 backupfile=[backupfile '~'];% make a backup name by adding ~ to the xml file name 294 testexist=exist(backupfile,'file'); 295 end 296 [success,message]=copyfile(outputfile,backupfile);%make backup 297 t=xmltree(outputfile); %read the file 298 uid=find(t,'ImaDoc'); 299 if ~isequal(uid,1)%if the xml file is not ImaDoc, delete it (after backup) 300 if isequal(success,1) 301 delete(outputfile) 302 else 303 msgbox_uvmat('ERROR',['error in the backup of the existing xml file: ' message]) 304 return 305 end 306 else 307 uid_calib=find(t,'ImaDoc/GeometryCalib'); 308 testappend=1; 309 if isempty(uid_calib) 310 [t,uid_calib]=add(t,1,'element','GeometryCalib'); 311 else %if GeometryCalib already exists, delete its content 312 uid_child=children(t,uid_calib); 313 t=delete(t,uid_child); 314 % testappend=1; 315 end 316 end 317 end 318 if ~testappend %create a new xml file for calibration data 319 t=xmltree; 320 t=set(t,1,'name','ImaDoc'); 321 [t,uid_calib]=add(t,1,'element','GeometryCalib'); 322 end 323 % hgrid=get(handles.REPLICATE,'parent');%read the calibration image source on the interface userdata 324 % imagename=get(hgrid,'UserData'); 325 % if exist(imagename,'file') 326 % GeometryCalib.SourceCalib.ImageCalib=imagename; 281 update_imadoc(GeometryCalib,outputfile) 282 % testappend=0; 283 % if exist(outputfile,'file');%=1 if the output file already exists, 0 else 284 % t=xmltree(outputfile); %read the file 285 % backupfile=outputfile; 286 % testexist=2; 287 % while testexist==2 288 % backupfile=[backupfile '~'];% make a backup name by adding ~ to the xml file name 289 % testexist=exist(backupfile,'file'); 290 % end 291 % [success,message]=copyfile(outputfile,backupfile);%make backup 292 % t=xmltree(outputfile); %read the file 293 % uid=find(t,'ImaDoc'); 294 % if ~isequal(uid,1)%if the xml file is not ImaDoc, delete it (after backup) 295 % if isequal(success,1) 296 % delete(outputfile) 297 % else 298 % msgbox_uvmat('ERROR',['error in the backup of the existing xml file: ' message]) 299 % return 300 % end 301 % else 302 % uid_calib=find(t,'ImaDoc/GeometryCalib'); 303 % testappend=1; 304 % if isempty(uid_calib) 305 % [t,uid_calib]=add(t,1,'element','GeometryCalib'); 306 % else %if GeometryCalib already exists, delete its content 307 % uid_child=children(t,uid_calib); 308 % t=delete(t,uid_child); 309 % % testappend=1; 310 % end 311 % end 327 312 % end 328 GeometryCalib.SourceCalib.PointCoord=Object.Coord; 329 t=struct2xml(GeometryCalib,t,uid_calib); 330 save(t,outputfile); 313 % if ~testappend %create a new xml file for calibration data 314 % t=xmltree; 315 % t=set(t,1,'name','ImaDoc'); 316 % [t,uid_calib]=add(t,1,'element','GeometryCalib'); 317 % end 318 % % hgrid=get(handles.REPLICATE,'parent');%read the calibration image source on the interface userdata 319 % % imagename=get(hgrid,'UserData'); 320 % % if exist(imagename,'file') 321 % % GeometryCalib.SourceCalib.ImageCalib=imagename; 322 % % end 323 % GeometryCalib.SourceCalib.PointCoord=Object.Coord; 324 % t=struct2xml(GeometryCalib,t,uid_calib); 325 % save(t,outputfile); 331 326 msgbox_uvmat('CONFIRMATION',{[outputfile ' updated with calibration data'];... 332 327 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... … … 364 359 end 365 360 % %record image source 366 % hgrid=get(handles.REPLICATE,'parent');%read the calibration image source on the interface userdata367 % imagename=get(hgrid,'UserData');368 % if exist(imagename,'file')369 % GeometryCalib.SourceCalib.ImageCalib=imagename;370 % end371 361 GeometryCalib.SourceCalib.PointCoord=Object.Coord; 372 373 374 %root PROJETS375 362 376 363 %open and read the dataview GUI … … 380 367 end 381 368 CalibData=get(handles.figure1,'UserData');%read the calibration image source on the interface userdata 382 % filename='PROJETS';%default383 % if isfield(CalibData,'XmlInput')384 % [pp,filename]=fileparts(CalibData.XmlInput);385 % end386 % while ~isequal(filename,'PROJETS') && numel(filename)>1387 % filename_1=filename;388 % pp_1=pp;389 % [pp,filename]=fileparts(pp)390 % end391 % projinput=fullfile(pp_1,filename_1)392 % dd=dataview(projinput)393 394 %395 % Device=[];%default396 %397 % h_dataview=dataview;398 % hhdataview=guidata(h_dataview);399 % drawnow400 369 401 370 if isfield(CalibData,'XmlInput') … … 443 412 end 444 413 if testinput 445 outcome=dataview(XmlInput,SubCampaignTest,GeometryCalib) %,SubCampaignTest)414 outcome=dataview(XmlInput,SubCampaignTest,GeometryCalib) 446 415 end 447 416 % %A COMPLETER … … 955 924 set(handles.ListCoord,'String',Tabchar) 956 925 ListCoord_Callback(hObject, eventdata, handles) 957 PLOT_Callback(hObject,eventdata,handles)926 MenuPlot_Callback(hObject,eventdata,handles) 958 927 end 959 928 … … 1051 1020 end 1052 1021 1053 1054 1055 % -------------------------------------------------------------------- 1022 %------------------------------------------------------------------------ 1056 1023 function MenuCreateGrid_Callback(hObject, eventdata, handles) 1024 %------------------------------------------------------------------------ 1057 1025 hcalib=get(handles.calib_type,'parent');%handles of the GUI geometry_calib 1058 1026 CalibData=get(hcalib,'UserData'); … … 1061 1029 Tinput=CalibData.grid; 1062 1030 end 1063 T=create_grid(Tinput) ;%display translate_points GUI and get shift parameters1031 T=create_grid(Tinput)%display the GUI create_grid 1064 1032 CalibData.grid=T; 1065 1033 set(hcalib,'UserData',CalibData) … … 1067 1035 %grid in phys space 1068 1036 Coord_cell=get(handles.ListCoord,'String'); 1069 data=read_geometry_calib(Coord_cell); 1070 data.Coord(:,1)=T(1)+data.Coord(:,1); 1071 data.Coord(:,2)=T(2)+data.Coord(:,2); 1072 data.Coord(:,3)=T(3)+data.Coord(:,3); 1073 data.Coord(:,[4 5])=data.Coord(:,[4 5]); 1074 for i=1:size(data.Coord,1) 1075 for j=1:5 1076 Coord{i,j}=num2str(data.Coord(i,j),4);%phys x,y,z 1037 data=read_geometry_calib(Coord_cell) 1038 nbpoints=size(data.Coord,1); %nbre of calibration points 1039 data.Coord(1:size(T,1),1:3)=T; 1040 for i=1:nbpoints 1041 for j=1:5 1042 Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits 1077 1043 end 1078 1044 end 1045 for i=nbpoints+1:size(data.Coord,1) 1046 for j=1:3 1047 Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits 1048 end 1049 for j=4:5 1050 Coord{i,j}='';%display coordiantes with 4 digi 1051 end 1052 end 1053 1054 1055 %size(data.Coord,1) 1079 1056 Tabchar=cell2tab(Coord,' | '); 1080 1057 set(handles.ListCoord,'Value',1) 1081 1058 set(handles.ListCoord,'String',Tabchar) 1082 1059 1083 1084 1085 % -------------------------------------------------------------------- 1060 %----------------------------------------------------------------------- 1086 1061 function MenuTranslatePoints_Callback(hObject, eventdata, handles) 1062 %----------------------------------------------------------------------- 1087 1063 hcalib=get(handles.calib_type,'parent');%handles of the GUI geometry_calib 1088 1064 CalibData=get(hcalib,'UserData') -
trunk/src/get_field.m
r12 r17 1567 1567 if ~isequal(path_get_field,PathName) 1568 1568 CurrentPath=fileparts(which(ACTION)); 1569 if ~isequal( PathName,CurrentPath)1569 if ~isequal(CurrentPath,PathName)&&~isequal(CurrentPath,fullfile(PathName,'private')) 1570 1570 addpath(PathName) 1571 1571 errormsg=check_functions; -
trunk/src/private/ListDir.m
r8 r17 1 1 %'ListDir': scan the structure of the directory tree (for dataview.m) 2 2 %------------------------------------------------------------------------ 3 % function [ListDevices,ListRecords,ListXml,List]=ListDir(CurrentPath,ListExperiments,ListDevices_in,ListRecords_in) 4 % 5 % 6 % OUTPUT: 7 % ListDevices: list of Devices 8 % ListRecords: list of records 9 % ListXml: list of xml file names 10 % List: structure representing the tree structure 11 % 12 %INPUT 13 % CurrentPath: full name (including path) to the input campaign (or subcampaign), we assume that 14 % data are organised as (sub)campaign/Experiment/Device/(Record/)/file .xml 15 % ListExperiments: list of experiments to scan (cell of names) 16 % ListDevices_in: list of devices to scan (cell of names) 17 % ListRecords_in: list of records to scan (cell of names) 18 3 19 function [ListDevices,ListRecords,ListXml,List]=ListDir(CurrentPath,ListExperiments,ListDevices_in,ListRecords_in) 4 20 … … 73 89 end 74 90 75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 91 92 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 93 % ListDevices: list of devices already scanned 94 % ListDevices_in: list of input devices to scan 76 95 function [testnew,testselect]=test_select(name,ListDevices,ListDevices_in) 96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 77 97 if ~isempty(ListDevices_in) 78 98 testnew=0; -
trunk/src/private/read_geometry_calib.m
r8 r17 18 18 nb_defining_points=length(Coord_cell); 19 19 iline=0; 20 data.Coord=[];%default 20 21 for i=1:nb_defining_points 21 22 coord_str=Coord_cell{i};%character string of line number i -
trunk/src/series.m
r12 r17 1677 1677 if ~isequal(path_series,PathName) 1678 1678 CurrentPath=fileparts(which(ACTION)); 1679 if ~isequal( PathName,CurrentPath)1679 if ~isequal(CurrentPath,PathName)&&~isequal(CurrentPath,fullfile(PathName,'private')) 1680 1680 addpath(PathName) 1681 1681 errormsg=check_functions; … … 4399 4399 last_j2 =last_j +ind_shift(2); 4400 4400 siz=size(SeriesData.Time{1}); 4401 if siz(1)>=last_i2 & siz(2)>=last_j2 4401 if first_i1>=1 && first_j1 4402 >=1 && siz(1)>=last_i2 && siz(2)>=last_j2 4402 4403 time_first=(time(first_i1,first_j1)+time(first_i2,first_j2))/2; 4403 4404 time_last=(time(last_i1,last_j1)+time(last_i2,last_j2))/2; -
trunk/src/update_imadoc.m
r13 r17 11 11 if exist(outputfile,'file');%=1 if the output file already exists, 0 else 12 12 t=xmltree(outputfile); %read the file 13 backupfile=outputfile; 14 testexist=2; 15 while testexist==2 16 backupfile=[backupfile '~']; 17 testexist=exist(backupfile,'file'); 18 end 19 [success,message]=copyfile(outputfile,backupfile);%make backup 13 20 uid=find(t,'ImaDoc'); 14 21 if ~isequal(uid,1) … … 21 28 [t,uid_calib]=add(t,1,'element','GeometryCalib'); 22 29 else %if GeometryCalib already exists, delete its content 23 backupfile=outputfile;24 testexist=2;25 while testexist==226 backupfile=[backupfile '~'];27 testexist=exist(backupfile,'file');28 end29 [success,message]=copyfile(outputfile,backupfile);%make backup30 % backupfile=outputfile; 31 % testexist=2; 32 % while testexist==2 33 % backupfile=[backupfile '~']; 34 % testexist=exist(backupfile,'file'); 35 % end 36 % [success,message]=copyfile(outputfile,backupfile);%make backup 30 37 if isequal(success,1) 31 38 delete(outputfile) -
trunk/src/uvmat.m
r15 r17 3995 3995 PathName=list_path{ind_coord}; 3996 3996 CurrentPath=fileparts(which(coord_option)); 3997 if ~isequal(PathName,CurrentPath) 3997 if ~isequal(PathName,CurrentPath)&&~isequal(CurrentPath,fullfile(PathName,'private')) 3998 3998 addpath(PathName) 3999 3999 errormsg=check_functions;
Note: See TracChangeset
for help on using the changeset viewer.