Changeset 646
- Timestamp:
- Jun 2, 2013, 4:00:34 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 3 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_files.m
r625 r646 32 32 svn_info.status=[]; 33 33 list_fct={... 34 'activate';...% emulate the mouse selection of a GUI element, for demo 34 35 'browse_data';...% function for scanning directories in a project/campaign 35 36 'browse_data.fig';...% GUI corresponding to dataview … … 38 39 'cell2tab';... %transform a Matlab cell in a character array suitable for display in a table 39 40 'check_files';... 40 'civ';... %function associated with the interface 'civ.fig' for PIV and spline interpolation 41 'civ';... %function associated with the interface 'civ.fig' for PIV and spline interpolation (to be replaced by civ_series) 41 42 'civ.fig';... 42 'civ_3D';... function associated with the interface 'civ_3D.fig' for PIV in volume (TODO: combine with civ.m)43 'civ_3D';... % function associated with the interface 'civ_3D.fig' for PIV in volume (TODO: combine with civ.m) 43 44 'civ_3D.fig';... 44 45 'civ_matlab';...% civ programs, Matlab version (called by civ.m, option Civprogram/Matlab in the upper menu bar) 46 'compile';...% compile a Matlab function, create a binary in a subdirectory /bin 45 47 'copyfields';...% copy fields between two matlab structures 46 48 'create_grid';...% called by the GUI geometry_calib to create a physical grid 47 49 'create_grid.fig';...% GUI corresponding to create_grid.m 48 'displ_uvmat';... 49 'editxml';...% display and edit xml files using a xls schema50 'editxml.fig';...% interface for editxml50 'displ_uvmat';...% display a message using msgbox_uvmat or on the log file in batch mode 51 'editxml';...% display and edit xml files using a xls schema 52 'editxml.fig';...% interface for editxml 51 53 'fileparts_uvmat';...% extracts the root name,field indexes and nomenclature type from an input filename 52 54 'fill_GUI';...% fill a GUI with a set of parameters from a Matlab structure 53 55 'filter_tps';...% find the thin plate spline coefficients for interpolation-smoothing 54 56 'find_field_cells';...% group the variables of a 'field object' into 'field cells' and specify their structure 55 'find_file_series';...% check the content of an input file and find the corresponding file series57 'find_file_series';...% check the content of an input file and find the corresponding file series 56 58 'find_imadoc';...% find the ImaDoc xml file associated with a given input file 57 'fullfile_uvmat';...% creates a file name from a root name and indices.58 'geometry_calib';...% performs geometric calibration from a set of reference points59 'geometry_calib.fig';...% interface for geometry_calib59 'fullfile_uvmat';...% creates a file name from a root name and indices. 60 'geometry_calib';...% performs geometric calibration from a set of reference points 61 'geometry_calib.fig';...% interface for geometry_calib 60 62 'get_field';...% choose and plot a field from a Netcdf file 61 63 'get_field.fig';...%interface for get_field … … 64 66 'hist_update';...% update of a current global histogram by inclusion of a new field 65 67 'imadoc2struct';...%convert the image documentation file ImaDoc into a Matlab structure 68 'interp2_uvmat';...% linearly interpolate an image or scalar defined on a regular grid 66 69 'keyboard_callback';... % function activated when a key is pressed on the keyboard 67 'ListDir';... scan the structure of the directory tree (for dataview.m) 70 'ListDir';... % scan the structure of the directory tree (for editxml.m) 71 'mask_proj';...% restrict input fields to a mask region, set to 0 outside 68 72 'mouse_down';% function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn') 69 73 'mouse_motion';...% permanently called by mouse motion over a figure (callback for 'WindowButtonMotionFcn') 70 74 'mouse_up';... % function to be activated when the mouse button is released (callback for 'WindowButtonUpFcn') 71 'msgbox_uvmat';... associated with GUI msgbox_uvmat.fig to display message boxes, for error, warning or input calls75 'msgbox_uvmat';... % associated with GUI msgbox_uvmat.fig to display message boxes, for error, warning or input calls 72 76 'msgbox_uvmat.fig';... 77 'nomtype2pair';... creates nomenclature for index pairs knowing the image nomenclature, used by series fct 73 78 'nc2struct';...% transform a netcdf file in a corresponding matlab structure 74 79 'num2stra';...% transform number to the corresponding character string depending on the nomenclature … … 82 87 'read_civdata';... reads new civ data from netcdf files 83 88 'read_field';...% read the fields from files in different formats (netcdf files, images, video) 89 'read_geometry_calib';... read data on the GUI geometry_calib 84 90 'read_GUI';... %read a GUI and provide the data as a Matlab structure 85 91 'read_image';...%read images or video objects … … 109 115 'translate_points';...% associated with GUI translate_points.fig to display translation parameters 110 116 'translate_points.fig';... 117 'uigetfile_uvmat';... browser, and display of directories, faster than the Matlab fct uigetfile 111 118 'update_imadoc';... %update the ImaDoc xml file 112 119 'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series' -
trunk/src/get_field.m
r644 r646 22 22 function varargout = get_field(varargin) 23 23 24 % Last Modified by GUIDE v2.5 28-May-2013 01:55:2524 % Last Modified by GUIDE v2.5 02-Jun-2013 14:00:39 25 25 26 26 % Begin initialization code - DO NOT EDIT … … 75 75 set(hObject,'Unit','pixel') 76 76 pos_view_field=get(hObject,'Position'); 77 set(0,'Unit','pixels') 77 78 ScreenSize=get(0,'ScreenSize'); 78 79 pos_view_field(1)=ScreenSize(1)+ScreenSize(3)-pos_view_field(3); … … 106 107 set(handles.variables,'String',[{'*'} Txt]) 107 108 variables_Callback(handles.variables,[], handles) 108 109 % set(handles.abscissa,'String',[{''} Txt ])110 109 set(handles.ordinate,'String',Txt) 111 set(handles.vector_x,'String', [Txt ])112 set(handles.vector_y,'String', [Txt ])110 set(handles.vector_x,'String',Txt) 111 set(handles.vector_y,'String',Txt ) 113 112 set(handles.vector_z,'String',[{''} Txt ]) 114 113 set(handles.vec_color,'String',[{''} Txt ]) 115 set(handles.XVarName,'String',[{''} Txt ]) 116 set(handles.YVarName,'String',[{''} Txt ]) 117 set(handles.ZVarName,'String',[{''} Txt ]) 118 % set(handles.coord_x_vectors,'String',[{''} Txt ]) 119 % set(handles.coord_y_vectors,'String',[{''} Txt ]) 120 % set(handles.YVarName,'String',[{''} Txt ]) 121 % set(handles.TimeVarName,'String',[{''} Txt ]) 114 set(handles.XVarName,'String',Txt ) 115 set(handles.YVarName,'String',Txt ) 116 set(handles.ZVarName,'String',Txt ) 122 117 set(handles.scalar,'Value',1) 123 118 set(handles.scalar,'String', Txt ) 124 119 125 %% ana nlyse the input field cells120 %% analyse the input field cells 126 121 [CellInfo,NbDim,errormsg]=find_field_cells(Field); 127 122 if ~isempty(errormsg) … … 162 157 163 158 %% set time mode 164 ListSwitchVarIndexTime={'file index'}; 159 ListSwitchVarIndexTime={'file index'};% default setting: the time is the file index 165 160 % look at global attributes with numerical values 166 161 check_numvalue=false; 167 162 check_time=false; 168 169 170 171 172 end 163 for ilist=1:numel(Field.ListGlobalAttribute) 164 Value=Field.(Field.ListGlobalAttribute{ilist}); 165 check_numvalue(ilist)=isnumeric(Value); 166 check_time(ilist)=~isempty(find(regexp(Field.ListGlobalAttribute{ilist},'Time'),1)); 167 end 173 168 Field.ListNumAttributes=Field.ListGlobalAttribute(check_numvalue);% select the attributes with float numerical value 174 169 if ~isempty(Field.ListNumAttributes) 175 ListSwitchVarIndexTime=[ListSwitchVarIndexTime; {'attribute'}]; 170 ListSwitchVarIndexTime=[ListSwitchVarIndexTime; {'attribute'}];% the time can be chosen as a global attribute 176 171 end 177 172 nboption=numel(ListSwitchVarIndexTime); 178 173 if Field.MaxDim>=2 179 ListSwitchVarIndexTime=[ListSwitchVarIndexTime;{'variable'};{'dim index'}]; 180 end 181 if Field.MaxDim>=4 182 174 ListSwitchVarIndexTime=[ListSwitchVarIndexTime;{'variable'};{'dim index'}];% the time can be chosen as a dim index 175 end 176 if Field.MaxDim>=4% for dim >=4, one dim is proposed as time 177 option=nboption+1; 183 178 elseif ~isempty(find(check_time, 1)) 184 179 option=2; … … 186 181 option=1; 187 182 end 188 %set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)189 %set(handles.SwitchVarIndexTime,'Value',option)183 set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime) 184 set(handles.SwitchVarIndexTime,'Value',option) 190 185 set(handles.get_field,'UserData',Field);% record the finput field structure 191 %SwitchVarIndexTime_Callback([],[], handles)186 SwitchVarIndexTime_Callback([],[], handles) 192 187 193 188 %% set z coordinate menu if relevant … … 207 202 %% set vector menu (priority) if detected or scalar menu for space dim >=2, or usual (x,y) plot for 1D fields 208 203 if Field.MaxDim>=2 % case of 2D (or 3D) fields 204 if isfield(CellInfo{imax},'VarIndex_coord_x')&& isfield(CellInfo{imax},'VarIndex_coord_y') 205 set(handles.XVarName,'Value',CellInfo{imax}.VarIndex_coord_x(1)) 206 set(handles.YVarName,'Value',CellInfo{imax}.VarIndex_coord_y(1)) 207 end 209 208 if isfield(CellInfo{imax},'VarIndex_vector_x') && isfield(CellInfo{imax},'VarIndex_vector_y') 210 set(handles.CheckVector,'Value',1) 211 set(handles.CheckScalar,'Value',0) 209 set(handles.FieldOption,'Value',3)% set vector selection option 212 210 set(handles.vector_x,'Value',CellInfo{imax}.VarIndex_vector_x(1)) 213 211 set(handles.vector_y,'Value',CellInfo{imax}.VarIndex_vector_y(1)) … … 354 352 end 355 353 end 356 val=get(handles.abscissa,'Value');357 set(handles.abscissa,'Value',min(val,2));354 %val=get(handles.abscissa,'Value'); 355 %set(handles.abscissa,'Value',min(val,2)); 358 356 coord_x_index=CellInfo{cell_select}.VarIndex_coord_x; 359 357 coord_x_index=coord_x_index(coord_x_index~=0); 360 set(handles.XVarName,'String',[{''}; (Field.ListVarName(coord_x_index))'; (Field.ListVarName(VarIndex))']) 358 %set(handles.XVarName,'String',[{''}; (Field.ListVarName(coord_x_index))'; (Field.ListVarName(VarIndex))']) 359 set(handles.XVarName,'String',[(Field.ListVarName(coord_x_index))'; (Field.ListVarName(VarIndex))']) 361 360 362 361 %------------------------------------------------------------------------ … … 395 394 %eliminate time 396 395 TimeDimName='';%default 396 397 397 % SwitchVarIndexTime=get(handles.SwitchVarIndexTime,'String'); 398 398 % TimeVarOption=SwitchVarIndexTime{get(handles.SwitchVarIndexTime,'Value')}; 399 if strcmp(TimeVarOption,'variable') 400 List=get(handles.TimeVarName,'String'); 399 List=get(handles.TimeVarName,'String'); 400 if get(handles.CheckDimensionTime) 401 TimeDimName=List{get(handles.TimeVarName,'Value')}; 402 elseif ~get(handles.CheckAttributeTime) 401 403 TimeVarName=List{get(handles.TimeVarName,'Value')}; 402 elseif strcmp(TimeVarOption,'dim index')403 List=get(handles.TimeVarName,'String');404 TimeDimName=List{get(handles.TimeVarName,'Value')};405 404 end 406 405 % A completer … … 1038 1037 end 1039 1038 1040 % --------------------------------------------------------------------1041 function MenuOpen_Callback(hObject, eventdata, handles)1042 % hObject handle to MenuOpen (see GCBO)1043 % eventdata reserved - to be defined in a future version of MATLAB1044 % handles structure with handles and user data (see GUIDATA)1045 1046 1047 % --------------------------------------------------------------------1048 function MenuExport_Callback(hObject, eventdata, handles)1049 % hObject handle to MenuExport (see GCBO)1050 % eventdata reserved - to be defined in a future version of MATLAB1051 % handles structure with handles and user data (see GUIDATA)1052 1053 1054 % --------------------------------------------------------------------1055 function MenuBrowse_Callback(hObject, eventdata, handles)1056 1057 oldfile=get(handles.inputfile,'String');1058 testrootfile=0;1059 testsubdir=0;1060 if isempty(oldfile)|isequal(oldfile,'') %loads the previously stored file name and set it as default in the file_input box1061 oldfile='';1062 dir_perso=prefdir;1063 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');1064 if exist(profil_perso,'file')1065 h=load (profil_perso);1066 if isfield(h,'RootPath')1067 RootPath=h.RootPath;1068 end1069 if isfield(h,'SubDir')1070 SubDir=h.SubDir;1071 if ~isempty(SubDir)1072 testsubdir=1;1073 end1074 end1075 if isfield(h,'RootFile')1076 RootFile=h.RootFile;1077 if ~isempty(RootFile)1078 testrootfile=1;1079 end1080 end1081 end1082 end1083 if testrootfile1084 if ~testsubdir1085 oldfile=fullfile(RootPath,RootFile);1086 else1087 oldfile=fullfile(RootPath,SubDir,RootFile);1088 end1089 end1090 [FileName, PathName] = uigetfile( ...1091 {'*.nc', ' *.nc';...1092 '*.cdf', ' *.cdf';...1093 '*.*', 'All Files (*.*)'}, ...1094 'Pick a file',oldfile);1095 1096 %global inputfile1097 fileinput=[PathName FileName];%complete file name1098 sizf=size(fileinput);1099 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end1100 set(handles.inputfile,'String',fileinput)1101 inputfile_Callback(hObject, eventdata, handles)1102 1103 %update list of recent files in the menubar1104 MenuFile_1=fileinput;1105 MenuFile_2=get(handles.MenuFile_1,'Label');1106 MenuFile_3=get(handles.MenuFile_2,'Label');1107 MenuFile_4=get(handles.MenuFile_3,'Label');1108 MenuFile_5=get(handles.MenuFile_4,'Label');1109 set(handles.MenuFile_1,'Label',MenuFile_1)1110 set(handles.MenuFile_2,'Label',MenuFile_2)1111 set(handles.MenuFile_3,'Label',MenuFile_3)1112 set(handles.MenuFile_4,'Label',MenuFile_4)1113 set(handles.MenuFile_5,'Label',MenuFile_5)1114 dir_perso=prefdir;1115 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');1116 display(profil_perso)1117 if exist(profil_perso,'file')1118 save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat1119 else1120 txt=ver('MATLAB');1121 Release=txt.Release;1122 relnumb=str2double(Release(3:4));1123 if relnumb >= 141124 save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat1125 else1126 save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat1127 end1128 end1129 1130 % --------------------------------------------------------------------1131 function MenuFile_1_Callback(hObject, eventdata, handles)1132 fileinput=get(handles.MenuFile_1,'Label');1133 set(handles.inputfile,'String',fileinput)1134 inputfile_Callback(hObject, eventdata, handles)1135 1136 % --------------------------------------------------------------------1137 function MenuFile_2_Callback(hObject, eventdata, handles)1138 fileinput=get(handles.MenuFile_2,'Label');1139 set(handles.inputfile,'String',fileinput)1140 inputfile_Callback(hObject, eventdata, handles)1141 1142 % -----------------------------------------------------------------------1143 function MenuFile_3_Callback(hObject, eventdata, handles)1144 % -----------------------------------------------------------------------1145 fileinput=get(handles.MenuFile_3,'Label');1146 set(handles.inputfile,'String',fileinput)1147 inputfile_Callback(hObject, eventdata, handles)1148 1149 % -----------------------------------------------------------------------1150 function MenuFile_4_Callback(hObject, eventdata, handles)1151 % -----------------------------------------------------------------------1152 fileinput=get(handles.MenuFile_4,'Label');1153 set(handles.inputfile,'String',fileinput)1154 inputfile_Callback(hObject, eventdata, handles)1155 1156 % -----------------------------------------------------------------------1157 function MenuFile_5_Callback(hObject, eventdata, handles)1158 % -----------------------------------------------------------------------1159 fileinput=get(handles.MenuFile_5,'Label');1160 set(handles.inputfile,'String',fileinput)1161 inputfile_Callback(hObject, eventdata, handles)1162 1163 %------------------------------------------------------------------------1164 function MenuExportField_Callback(hObject, eventdata, handles)1165 %------------------------------------------------------------------------1166 global Data_get_field1167 % huvmat=findobj(allchild(0),'Name','uvmat');1168 inputfile=get(handles.inputfile,'String');1169 Data_get_field=nc2struct(inputfile);1170 % Data_view_field=UvData.ProjField_2;1171 evalin('base','global Data_get_field')%make CurData global in the workspace1172 display(['content of ' inputfile ':'])1173 evalin('base','Data_get_field') %display CurData in the workspace1174 commandwindow;1175 1176 %------------------------------------------------------------------------1177 function MenuHelp_Callback(hObject, eventdata, handles)1178 %------------------------------------------------------------------------1179 path_to_uvmat=which ('uvmat');% check the path of uvmat1180 pathelp=fileparts(path_to_uvmat);1181 helpfile=fullfile(pathelp,'UVMAT_DOC','uvmat_doc.html');1182 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the directory UVMAT/UVMAT_DOC')1183 else1184 web([helpfile '#get_field'])1185 end1186 1039 1187 1040 % ----------------------------------------------------------------------- … … 1384 1237 1385 1238 1386 1239 %------------------------------------------------------------------------ 1387 1240 % --- Executes on selection change in SwitchVarIndexX. 1241 %------------------------------------------------------------------------ 1388 1242 function SwitchVarIndexX_Callback(hObject, eventdata, handles) 1389 % hObject handle to SwitchVarIndexX (see GCBO) 1390 % eventdata reserved - to be defined in a future version of MATLAB 1391 % handles structure with handles and user data (see GUIDATA) 1392 1393 % Hints: contents = cellstr(get(hObject,'String')) returns SwitchVarIndexX contents as cell array 1394 % contents{get(hObject,'Value')} returns selected item from SwitchVarIndexX 1395 1396 1243 1244 %------------------------------------------------------------------------ 1397 1245 % --- Executes on selection change in SwitchVarIndexTime. 1246 %------------------------------------------------------------------------ 1398 1247 function SwitchVarIndexTime_Callback(hObject, eventdata, handles) 1248 1399 1249 menu=get(handles.SwitchVarIndexTime,'String'); 1400 1250 option=menu{get(handles.SwitchVarIndexTime,'Value')}; … … 1453 1303 switch FieldOption 1454 1304 case '1D plot' 1455 set(handles.Panel1Dplot,'Visible','on') 1456 pos=get(handles.Panel1Dplot,'Position'); 1457 pos(1)=2; 1458 pos_coord=get(handles.Coordinates,'Position'); 1459 pos(2)=pos_coord(2)-pos(4)-2; 1460 set(handles.Panel1Dplot,'Position',pos) 1461 set(handles.PanelScalar,'Visible','off') 1462 set(handles.PanelVectors,'Visible','off') 1463 set(handles.YVarName,'Visible','off') 1464 % set(handles.SwitchVarIndexY,'Visible','off') 1465 set(handles.Y_title,'Visible','off') 1466 set(handles.ZVarName,'Visible','off') 1467 % set(handles.SwitchVarIndexZ,'Visible','off') 1468 set(handles.Z_title,'Visible','off') 1469 % ordinate_Callback(hObject, eventdata, handles) 1470 % set(handles.get_field,'Units','pixels') 1471 % size_fig=get(handles.get_field,'Position'); 1472 % Data=get(handles.view_field,'UserData'); 1473 % Data.GUISize=size_fig; 1474 % set(handles.view_field,'UserData',Data) 1475 % 1476 % %% reset position of text_display or TableDisplay 1477 % if strcmp(get(handles.TableDisplay,'Visible'),'off') 1478 % pos_1=get(handles.text_display,'Position'); 1479 % pos_1(1)=size_fig(3)-pos_1(3); 1480 % pos_1(2)=size_fig(4)-pos_1(4); 1481 % set(handles.text_display,'Position',pos_1) 1482 % % reset position of TableDisplay 1483 % else 1484 % pos_1=get(handles.TableDisplay,'Position'); 1485 % pos_1(1)=size_fig(3)-pos_1(3); 1486 % pos_1(2)=size_fig(4)-pos_1(4); 1487 % set(handles.TableDisplay,'Position',pos_1) 1488 % end 1489 % 1490 % %% reset position of Coordinates 1491 % pos_2=get(handles.Coordinates,'Position'); 1492 % pos_2(1)=size_fig(3)-pos_1(3); 1493 % pos_2(2)=pos_1(2)-pos_2(4); 1494 % set(handles.Coordinates,'Position',pos_2) 1305 set(handles.Panel1Dplot,'Visible','on') 1306 pos=get(handles.Panel1Dplot,'Position'); 1307 pos(1)=2; 1308 pos_coord=get(handles.Coordinates,'Position'); 1309 pos(2)=pos_coord(2)-pos(4)-2; 1310 set(handles.Panel1Dplot,'Position',pos) 1311 set(handles.PanelScalar,'Visible','off') 1312 set(handles.PanelVectors,'Visible','off') 1313 set(handles.YVarName,'Visible','off') 1314 % set(handles.SwitchVarIndexY,'Visible','off') 1315 set(handles.Y_title,'Visible','off') 1316 set(handles.ZVarName,'Visible','off') 1317 % set(handles.SwitchVarIndexZ,'Visible','off') 1318 set(handles.Z_title,'Visible','off') 1495 1319 case 'scalar' 1496 1320 set(handles.Panel1Dplot,'Visible','off') 1497 set(handles.PanelScalar,'Visible','on')1498 set(handles.PanelVectors,'Visible','off')1499 1500 1501 1502 1503 1504 set(handles.YVarName,'Visible','on')1505 set(handles.Y_title,'Visible','on')1321 set(handles.PanelScalar,'Visible','on') 1322 set(handles.PanelVectors,'Visible','off') 1323 pos=get(handles.PanelScalar,'Position'); 1324 pos(1)=2; 1325 pos_coord=get(handles.Coordinates,'Position'); 1326 pos(2)=pos_coord(2)-pos(4)-2; 1327 set(handles.PanelScalar,'Position',pos) 1328 set(handles.YVarName,'Visible','on') 1329 set(handles.Y_title,'Visible','on') 1506 1330 case 'vectors' 1507 1331 set(handles.Panel1Dplot,'Visible','off') 1508 set(handles.PanelScalar,'Visible','off') 1509 set(handles.PanelVectors,'Visible','on') 1510 pos=get(handles.PanelVectors,'Position'); 1511 pos(1)=2; 1512 pos_coord=get(handles.Coordinates,'Position'); 1513 pos(2)=pos_coord(2)-pos(4)-2; 1514 set(handles.PanelVectors,'Position',pos) 1515 set(handles.YVarName,'Visible','on') 1516 set(handles.Y_title,'Visible','on') 1517 end 1518 % hObject handle to FieldOption (see GCBO) 1519 % eventdata reserved - to be defined in a future version of MATLAB 1520 % handles structure with handles and user data (see GUIDATA) 1521 1522 % Hints: contents = get(hObject,'String') returns FieldOption contents as cell array 1523 % contents{get(hObject,'Value')} returns selected item from FieldOption 1524 1525 1526 % --- Executes on button press in CheckDimensionX. 1527 function CheckDimensionX_Callback(hObject, eventdata, handles) 1528 % hObject handle to CheckDimensionX (see GCBO) 1529 % eventdata reserved - to be defined in a future version of MATLAB 1530 % handles structure with handles and user data (see GUIDATA) 1531 1532 % Hint: get(hObject,'Value') returns toggle state of CheckDimensionX 1533 1534 1535 % --- Executes on button press in checkbox25. 1536 function checkbox25_Callback(hObject, eventdata, handles) 1537 % hObject handle to checkbox25 (see GCBO) 1538 % eventdata reserved - to be defined in a future version of MATLAB 1539 % handles structure with handles and user data (see GUIDATA) 1540 1541 % Hint: get(hObject,'Value') returns toggle state of checkbox25 1542 1543 1544 % --- Executes on button press in checkbox26. 1545 function checkbox26_Callback(hObject, eventdata, handles) 1546 % hObject handle to checkbox26 (see GCBO) 1547 % eventdata reserved - to be defined in a future version of MATLAB 1548 % handles structure with handles and user data (see GUIDATA) 1549 1550 % Hint: get(hObject,'Value') returns toggle state of checkbox26 1551 1552 1553 % --- Executes on button press in checkbox27. 1554 function checkbox27_Callback(hObject, eventdata, handles) 1555 % hObject handle to checkbox27 (see GCBO) 1556 % eventdata reserved - to be defined in a future version of MATLAB 1557 % handles structure with handles and user data (see GUIDATA) 1558 1559 % Hint: get(hObject,'Value') returns toggle state of checkbox27 1560 1561 1562 % --- Executes on button press in checkbox29. 1563 function checkbox29_Callback(hObject, eventdata, handles) 1564 % hObject handle to checkbox29 (see GCBO) 1565 % eventdata reserved - to be defined in a future version of MATLAB 1566 % handles structure with handles and user data (see GUIDATA) 1567 1568 % Hint: get(hObject,'Value') returns toggle state of checkbox29 1332 set(handles.PanelScalar,'Visible','off') 1333 set(handles.PanelVectors,'Visible','on') 1334 pos=get(handles.PanelVectors,'Position'); 1335 pos(1)=2; 1336 pos_coord=get(handles.Coordinates,'Position'); 1337 pos(2)=pos_coord(2)-pos(4)-2; 1338 set(handles.PanelVectors,'Position',pos) 1339 set(handles.YVarName,'Visible','on') 1340 set(handles.Y_title,'Visible','on') 1341 end -
trunk/src/interp2_uvmat.m
r19 r646 1 %'interp2_uvmat': linearly interpolate an image or scalar defined on a regular grid 2 %-------------------------------------------------------------------- 3 %OUTPUT: 4 % A_out: matrix of interpolated values at positions (XIMA,YIMA) 5 % 6 %INPUT: 1 7 % A matrix (npy,npx) to interpolate 2 8 %XIMA: matrix of non-integer x index values (npY,npX) 3 9 %YIMA: matrix of non-integer y index values (npY,npX), (with the same size as XIMA) 10 4 11 function A_out=interp2_uvmat(A,XIMA,YIMA) 5 12 npx=size(A,2); 6 13 npy=size(A,1); 7 14 npX=size(XIMA,2); 8 npY=size(XIMA,1) 15 npY=size(XIMA,1); 9 16 XIMA=reshape(XIMA,1,npX*npY)+0.5;%indices corresponding to XIMA, reshaped in a matlab vector 10 17 YIMA=reshape(YIMA,1,npX*npY)+0.5;%indices corresponding to XIMA, reshaped in a matlab vector -
trunk/src/mask_proj.m
r639 r646 1 %'mask_proj': projects the field on a projection object1 %'mask_proj': restrict input fields to a mask region, set to 0 outside 2 2 %-------------------------------------------------------------------------- 3 % function [ProjData,errormsg]= proj_field(FieldData,ObjectData)3 % function [ProjData,errormsg]=mask_proj(FieldData,MaskData) 4 4 % 5 5 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -
trunk/src/nomtype2pair.m
r595 r646 1 %'nomtype2pair': creates nomenc alture for index pairs knowing the image nomenclature, used by series fct1 %'nomtype2pair': creates nomenclature for index pairs knowing the image nomenclature, used by series fct 2 2 %--------------------------------------------------------------------- 3 3 % NomTypeOut=nomtype2pair(NomTypeIn) -
trunk/src/proj_field.m
r644 r646 538 538 end 539 539 end 540 % 541 % 542 % x = a \ \cosh \mu \ \cos \nu 543 % 544 % y = a \ \sinh \mu \ \sin \nu 545 540 546 541 547 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions -
trunk/src/set_object.m
r630 r646 698 698 function HELP_Callback(hObject, eventdata, handles) 699 699 %------------------------------------------------------------------------ 700 path_to_uvmat=which ('uvmat');% check the path of uvmat 701 pathelp=fileparts(path_to_uvmat); 702 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 703 if ~isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 704 addpath (fullfile(pathelp,'uvmat_doc')) 705 web([helpfile '#set_object']) 706 end 700 web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#a6-Projectionobjects:') 701 % path_to_uvmat=which ('uvmat');% check the path of uvmat 702 % pathelp=fileparts(path_to_uvmat); 703 % helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 704 % if ~isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 705 % addpath (fullfile(pathelp,'uvmat_doc')) 706 % web([helpfile '#set_object']) 707 % end 707 708 %------------------------------------------------------------------------ 708 709 -
trunk/src/uigetfile_uvmat.m
r644 r646 1 %'uigetfile_uvmat': browser faster than the Matlab fct uigetfile1 %'uigetfile_uvmat': browser, and display of directories, faster than the Matlab fct uigetfile 2 2 %------------------------------------------------------------------------ 3 3 % hfig=uigetfile_uvmat(OutputDir,option) -
trunk/src/uvmat.m
r644 r646 190 190 LowY=round(ScreenSize(4)/2-Height/2); % put at the middle height on the screen 191 191 set(hObject,'Position',[LeftX LowY Width Height]) 192 193 %set(hObject,'Units','Normalized')194 195 %UvData.OpenParam.PosColorbar=[0.8450 0.0900 0.0190 0.3600];196 192 UvData.OpenParam.PosColorbar=[0.80 0.02 0.018 0.445]; 197 %UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object198 193 UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE) 199 % UvData.OpenParam.CalSize=[0.28 1];200 % UvData.PlotAxes=[];%initiate the record of plotted field201 % UvData.axes2=[];202 % UvData.axes1=[];203 194 AxeData.LimEditBox=1; %initialise AxeData 204 195 set(handles.PlotAxes,'UserData',AxeData) 196 % position of table Coord_y 197 set(handles.Coord_y,'Unit','pixel') 198 Pos=get(handles.Coord_y,'Position'); 199 set(handles.Coord_y,'Unit','normalized') 200 set(handles.Coord_y,'ColumnWidth',{Pos(3)}) 201 set(handles.Coord_y,'ColumnFormat',{'char'}) 202 set(handles.Coord_y,'ColumnEditable',false) 203 set(handles.Coord_y,'ColumnName',{''}) 205 204 206 205 %% set functions for the mouse and keyboard … … 344 343 ColumnWidth=max(150,0.18*size_fig(3)); 345 344 ColumnWidth=min(ColumnWidth,250); % width of the right side display column, between 150 and 250, depending on the fig width 346 % Data=get(handles.uvmat,'UserData');347 % Data.GUISize=size_fig;348 % set(handles.uvmat,'UserData',Data)349 350 345 351 346 %% position of panel InputFile 352 %set(handles.InputFile,'Units','pixels')347 set(handles.InputFile,'Units','pixels') 353 348 pos_InputFile=get(handles.InputFile,'Position');% [lower x lower y width height] for text_display 354 349 pos_InputFile(1)=0; 355 350 pos_InputFile(2)=size_fig(4)-pos_InputFile(4); % set frame InputFile to the top of the fig 356 351 pos_InputFile(3)=size_fig(3); 357 358 352 set(handles.InputFile,'Position',pos_InputFile);% [lower x lower y width height] for text_display 359 353 360 354 %% reset position of text_display or TableDisplay 361 355 if strcmp(get(handles.TableDisplay,'Visible'),'off') 356 set(handles.text_display,'Units','pixels') 362 357 pos_1=get(handles.text_display,'Position');% [lower x lower y width height] for text_display 363 358 pos_1(3)=1.2*ColumnWidth; … … 367 362 % reset position of TableDisplay 368 363 else 364 set(handles.TableDisplay,'Units','pixels') 369 365 pos_1=get(handles.TableDisplay,'Position'); 370 366 pos_1(3)=1.2*ColumnWidth; … … 381 377 382 378 %% reset position of Coordinates 379 set(handles.Coordinates,'Units','pixels') 383 380 pos_2=get(handles.Coordinates,'Position');% [lower x lower y width height] for frame 'Coordinates' 384 381 pos_2(3)=ColumnWidth; … … 388 385 389 386 %% reset position of Scalar 387 set(handles.Scalar,'Units','pixels') 390 388 pos_3=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar' 391 389 pos_3(3)=ColumnWidth; … … 415 413 pos(3)=0.77*size_fig(3)-1.2*ColumnWidth; 416 414 pos(4)=size_fig(4)-60; 415 set(handles.PlotAxes,'Units','pixels') 417 416 set(handles.PlotAxes,'Position',pos) 418 417 … … 1094 1093 %% update the data attached to the uvmat interface 1095 1094 if ~isempty(TimeUnit) 1096 set(handles.time_ txt,'String',['time (' TimeUnit ')'])1095 set(handles.time_var,'String',['time (' TimeUnit ')']) 1097 1096 end 1098 1097 UvData.TimeUnit=TimeUnit; … … 1109 1108 switch FileType 1110 1109 case {'civx','civdata'} 1111 % [FieldList,ColorList]=calc_field;1112 1110 [FieldList,ColorList]=set_field_list('U','V','C'); 1113 1111 set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data … … 1121 1119 set(handles.Vectors,'Visible','on') 1122 1120 set(handles.Coord_x,'Value',1); 1123 set(handles.Coord_x,'String', {'X'});1124 set(handles.Coord_y,'Value',1);1125 set(handles.Coord_y,' String',{'Y'});1121 set(handles.Coord_x,'String','X'); 1122 % set(handles.Coord_y,'Value',1); 1123 set(handles.Coord_y,'Data',{'Y'}); 1126 1124 case 'netcdf' 1127 1125 set(handles_Fields,'Value',1) 1128 1126 set(handles_Fields,'String',{'get_field...'}) 1129 1127 FieldName_Callback([],[], handles) 1130 % hget_field=get_field(FileName);1131 % hhget_field=guidata(hget_field);1132 % get_field('RUN_Callback',hhget_field.RUN,[],hhget_field);1133 1128 otherwise 1134 1129 set(handles_Fields,'Value',1) % set menu to 'image' 1135 1130 set(handles_Fields,'String',{'image'}) 1136 1131 set(handles.Coord_x,'Value',1); 1137 set(handles.Coord_x,'String',{'AX'}); 1138 set(handles.Coord_y,'Value',1); 1139 set(handles.Coord_y,'String',{'AY'}); 1132 set(handles.Coord_x,'String','AX'); 1133 set(handles.Coord_y,'Data',{'AY'}); 1140 1134 end 1141 1135 set(handles.uvmat,'UserData',UvData) … … 2118 2112 list_fields=get(handles.FieldName,'String');% list menu fields 2119 2113 FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field 2120 % if get_field... is selected, the GUI get_field will be used to enter fields2121 2114 if ~strcmp(FieldName,'get_field...') 2122 2115 if get(handles.FixVelType,'Value') … … 2164 2157 ParamIn.Coord_x=XNameMenu(get(handles.Coord_x,'Value')); 2165 2158 end 2166 YNameMenu=get(handles.Coord_y,'String'); 2167 if ~isempty(YNameMenu) 2168 ParamIn.Coord_y=YNameMenu(get(handles.Coord_y,'Value')); 2169 end 2159 % YNameMenu=get(handles.Coord_y,'String'); 2160 ParamIn.Coord_y=get(handles.Coord_y,'Data'); 2161 % if ~isempty(YNameMenu) 2162 % ParamIn.Coord_y=YNameMenu(get(handles.Coord_y,'Value')); 2163 % end 2170 2164 end 2171 2165 check_tps = 0; … … 2271 2265 &&~strcmp(ParamOut_1.FieldName,'velocity') && ~strcmp(ParamOut_1.FieldName,'get_field...') 2272 2266 if ~check_proj_tps 2273 % Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2});2274 2267 end 2275 2268 end … … 2289 2282 %% update the display menu for the first velocity type (first menuline) 2290 2283 test_veltype=0; 2291 % if ~isequal(FileType,'netcdf')|| isequal(FieldName,'get_field...')2292 2284 if (strcmp(UvData.FileType{1},'civx')||strcmp(UvData.FileType{1},'civdata'))&& ~strcmp(FieldName,'get_field...') 2293 2285 test_veltype=1; … … 3165 3157 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 3166 3158 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 3167 % hget_field=findobj(allchild(0),'name','get_field');3168 % if ~isempty(hget_field)3169 % delete(hget_field)3170 % end3171 3159 GetFieldData=get_field(FileName,ParamIn); 3172 3160 FieldList={}; 3173 3161 VecColorList={}; 3174 XName=GetFieldData.XVarName; 3175 if GetFieldData.CheckVector 3162 XName=GetFieldData.Coordinates.XVarName; 3163 switch GetFieldData.FieldOption 3164 case 'vectors' 3176 3165 UName=GetFieldData.PanelVectors.vector_x; 3177 3166 VName=GetFieldData.PanelVectors.vector_y; 3178 XName=GetFieldData. XVarName;3179 YName=GetFieldData. YVarName;3167 XName=GetFieldData.Coordinates.XVarName; 3168 YName=GetFieldData.Coordinates.YVarName; 3180 3169 CName=GetFieldData.PanelVectors.vec_color; 3181 3170 [FieldList,VecColorList]=set_field_list(UName,VName,CName); 3182 elseif GetFieldData.CheckScalar3171 case 'scalar' 3183 3172 AName=GetFieldData.PanelScalar.scalar; 3184 XName=GetFieldData. XVarName;3185 YName=GetFieldData. YVarName;3173 XName=GetFieldData.Coordinates.XVarName; 3174 YName=GetFieldData.Coordinates.YVarName; 3186 3175 FieldList={AName}; 3187 elseif GetFieldData.CheckPlot1D;3176 case '1D plot' 3188 3177 YName=GetFieldData.CheckPlot1D.ordinate; 3189 3178 end … … 5275 5264 Param.Coord_x_str=get(handles.Coord_x,'String'); 5276 5265 Param.Coord_x_val=get(handles.Coord_x,'Value'); 5277 Param.Coord_y_str=get(handles.Coord_y,'String'); 5278 Param.Coord_y_val=get(handles.Coord_y,'Value'); 5266 %Param.Coord_y_str=get(handles.Coord_y,'String'); 5267 Param.Coord_y_str=get(handles.Coord_y,'Data'); 5268 %Param.Coord_y_val=get(handles.Coord_y,'Value'); 5279 5269 series(Param); %run the series interface 5280 5270 … … 5290 5280 function MenuHelp_Callback(hObject, eventdata, handles) 5291 5281 % -------------------------------------------------------------------- 5292 path_to_uvmat=which ('uvmat');% check the path of uvmat 5293 pathelp=fileparts(path_to_uvmat); 5294 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 5295 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 5296 else 5297 addpath (fullfile(pathelp,'uvmat_doc')) 5298 web(helpfile); 5299 end 5282 web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp') 5283 5284 % path_to_uvmat=which ('uvmat');% check the path of uvmat 5285 % pathelp=fileparts(path_to_uvmat); 5286 % helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 5287 % if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 5288 % else 5289 % addpath (fullfile(pathelp,'uvmat_doc')) 5290 % web(helpfile); 5291 % end 5300 5292 5301 5293 % --- Executes on selection change in Coord_y. … … 5423 5415 end 5424 5416 end 5417 5418 5419 5420 function time_var_1_Callback(hObject, eventdata, handles) 5421 % hObject handle to time_var_1 (see GCBO) 5422 % eventdata reserved - to be defined in a future version of MATLAB 5423 % handles structure with handles and user data (see GUIDATA) 5424 5425 % Hints: get(hObject,'String') returns contents of time_var_1 as text 5426 % str2double(get(hObject,'String')) returns contents of time_var_1 as a double 5427 5428 5429 % --- Executes during object creation, after setting all properties. 5430 function time_var_1_CreateFcn(hObject, eventdata, handles) 5431 % hObject handle to time_var_1 (see GCBO) 5432 % eventdata reserved - to be defined in a future version of MATLAB 5433 % handles empty - handles not created until after all CreateFcns called 5434 5435 % Hint: edit controls usually have a white background on Windows. 5436 % See ISPC and COMPUTER. 5437 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 5438 set(hObject,'BackgroundColor','white'); 5439 end
Note: See TracChangeset
for help on using the changeset viewer.