Changeset 38
- Timestamp:
- Mar 7, 2010, 6:30:11 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 12 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/RUN_STLIN.m
r19 r38 26 26 end 27 27 if isempty(npxA) ||isempty(npxB) 28 warndlg_uvmat('The size of image A needs to be defined in the xml file ImaDoc','ERROR')28 msgbox_uvmat('ERROR','The size of image A needs to be defined in the xml file ImaDoc') 29 29 return 30 30 elseif isempty(npxB) || isempty(npyB) 31 warndlg_uvmat('The size of image B needs to be defined in the xml file ImaDoc','ERROR')31 msgbox_uvmat('ERROR','The size of image B needs to be defined in the xml file ImaDoc') 32 32 return 33 33 end … … 35 35 tsaiA=XmlDataA.GeometryCalib; 36 36 else 37 warndlg_uvmat('no geometric calibration available for image A','ERROR')37 msgbox_uvmat('ERROR','no geometric calibration available for image A') 38 38 return 39 39 end … … 41 41 tsaiB=XmlDataB.GeometryCalib; 42 42 else 43 warndlg_uvmat('no geometric calibration available for image B','ERROR')43 msgbox_uvmat('ERROR','no geometric calibration available for image B') 44 44 return 45 45 end … … 98 98 [Field,VelTypeOut]=read_civxdata(file_B,FieldNames,vel_type); 99 99 if ~isequal(Field.dt,dt) 100 warndlg_uvmat('different time intervals for the two velocity fields ','ERROR')100 msgbox_uvmat('ERROR','different time intervals for the two velocity fields ') 101 101 return 102 102 end 103 103 if ~isequal(Field.Time,time) 104 warndlg_uvmat('different times for the two velocity fields ','ERROR')104 msgbox_uvmat('ERROR','different times for the two velocity fields ') 105 105 return 106 106 end … … 191 191 192 192 193 194 195 196 197 198 199 200 201 202 193 %'pxcm_tsai': find differentials of the Tsai calibration 194 % 195 function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys) 196 a_read=a; 197 198 R=(a.R)'; 199 200 x=var_phys(:,1); 201 y=var_phys(:,2); 202 203 if isfield(a,'PlanePos') 204 prompt={'Plane 1 Index','Plane 2 Index'}; 205 Rep=inputdlg(prompt,'Target displacement test'); 206 Z1=str2double(Rep(1)); 207 Z2=str2double(Rep(2)); 208 z=(a.PlanePos(Z2,3)+a.PlanePos(Z1,3))/2 209 else 210 z=0; 211 end 212 213 %transform coeff for differentiels 214 a.C11=R(1)*R(8)-R(2)*R(7); 215 a.C12=R(2)*R(7)-R(1)*R(8); 216 a.C21=R(4)*R(8)-R(5)*R(7); 217 a.C22=R(5)*R(7)-R(4)*R(8); 218 a.C1x=R(3)*R(7)-R(9)*R(1); 219 a.C1y=R(3)*R(8)-R(9)*R(2); 220 a.C2x=R(6)*R(7)-R(9)*R(4); 221 a.C2y=R(6)*R(8)-R(9)*R(5); 222 223 224 %dependence in x,y 225 denom=(R(7)*x+R(8)*y+R(9)*z+a.Tz).*(R(7)*x+R(8)*y+R(9)*z+a.Tz); 226 A11=(a.f*a.sx*(a.C11*y-a.C1x*z+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx; 227 A12=(a.f*a.sx*(a.C12*x-a.C1y*z+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx; 228 A21=(a.f*a.sx*(a.C21*y-a.C2x*z+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy; 229 A22=(a.f*(a.C22*x-a.C2y*z+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy; 230 A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx; 231 A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy; 232 233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 234 %Old Version for z=0 235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 236 % %'camera' coordinates 237 % xc=R(1)*x+R(2)*y+a.Tx; 238 % yc=R(4)*x+R(5)*y+a.Ty; 239 % zc=R(7)*x+R(8)*y+a.Tz; 240 % %undistorted image coordinates 241 % Xu=a.f*xc./zc; 242 % Yu=a.f*yc./zc; 243 % %distorted image coordinates 244 % distortion=(a.kappa1)*(Xu.*Xu+Yu.*Yu)+1; %!! intégrer derivation kappa 245 % % distortion=1; 246 % Xd=Xu./distortion; 247 % Yd=Yu./distortion; 248 % %pixel coordinates 249 % X=Xd*a.sx/a.dpx+a.Cx; 250 % Y=Yd/a.dpy+a.Cy; 251 % 252 % %transform coeff for differentiels 253 % a.C11=R(1)*R(8)-R(2)*R(7); 254 % a.C12=R(2)*R(7)-R(1)*R(8); 255 % a.C21=R(4)*R(8)-R(5)*R(7); 256 % a.C22=R(5)*R(7)-R(4)*R(8); 257 % a.C1x=R(3)*R(7)-R(9)*R(1); 258 % a.C1y=R(3)*R(8)-R(9)*R(2); 259 % a.C2x=R(6)*R(7)-R(9)*R(4); 260 % a.C2y=R(6)*R(8)-R(9)*R(5); 261 % 262 % 263 % %dependence in x,y 264 % denom=(R(7)*x+R(8)*y+a.Tz).*(R(7)*x+R(8)*y+a.Tz); 265 % A11=(a.f*a.sx*(a.C11*y+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx; 266 % A12=(a.f*a.sx*(a.C12*x+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx; 267 % A21=(a.f*a.sx*(a.C21*y+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy; 268 % A22=(a.f*(a.C22*x+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy; 269 % A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx; 270 % A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy; 271 % 272 273 274 275 276 277 278 279 280 281 -
trunk/src/check_field_structure.m
r19 r38 1 %'check_field_structure': check the validity of the field struture representation consi tant with the netcdf format1 %'check_field_structure': check the validity of the field struture representation consistant with the netcdf format 2 2 %---------------------------------------------------------------------- 3 3 % function [DataOut,errormsg]=check_field_structure(Data) -
trunk/src/check_functions.m
r19 r38 28 28 list_fct={'calc_field';...% defines fields (velocity, vort, div...) from civx data and calculate them 29 29 'cell2tab';... %transform a Matlab cell in a character array suitable for display in a table 30 'check_field_structure';...% check the validity of the field struture representation consistant with the netcdf format 30 31 'check_functions';... 31 32 'civ';... %function associated with the interface 'civ.fig' for PIV and spline interpolation … … 34 35 'civ_3D.fig';... 35 36 'close_fig';...% function activated when a figure is closed 36 'copyfields';...%copy fields between two matlab structures 37 'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle 37 'copyfields';...% copy fields between two matlab structures 38 'create_grid';...% called by the GUI geometry_calib to create a physical grid 39 'create_grid.fig';...% GUI corresponding to create_grid.m 40 'dataview';...% function for scanning directories in a campaign 41 'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle 38 42 'editxml';...%display and edit xml files using a xls schema 39 43 'editxml.fig';...%interface for editxml … … 58 62 'nc2struct';...% transform a netcdf file in a corresponding matlab structure 59 63 'peaklock';...% 60 'phys';...% transforms fields from image (px) to real world (phys) coordinates using geometric calibration parameters61 'phys_polar';... transform image coordinates (px) to physical ploar coordinates62 'phys_XYZ';...%transforms image (px) to real world (phys) coordinates using geometric calibration parameters63 'px';...% transform fields from physical to px coordinates using geometrical calibration parameters64 'px_XYZ';...% ransform physical to px coordinates using geometrical calibration parameters65 64 'plot_field';...%displays a vector field and/or scalar or images 66 65 'plot_object';...%draws a projection object (points, line, plane...) … … 88 87 'update_obj';... update the object representation graph and its projection field, record it in the uvmat interface 89 88 'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series' 90 'warndlg_uvmat';...% display messages (error, warning, confirmation) , OBSOLETE, use msgbox_uvmat91 89 'write_plot_param'};%update plotting parameters after plot 92 90 dir_fct=which('uvmat');% path to uvmat -
trunk/src/create_grid.m
r37 r38 1 %'create_grid': associated with GUI create_grid.fig to display message boxes, for error, warning or input calls2 % c reate_grid(title,display)1 %'create_grid': called by the GUI geometry_calib to create a physical grid 2 % coord=create_grid(input_grid) 3 3 % 4 4 % OUTPUT: 5 % answer (text string)= 'yes', 'No', 'cancel', or the text string introduced as input5 % coord: matrix (nbpoint, 3) of coordinates for grid points, with columns x,y,z 6 6 % 7 7 %INPUT: 8 % title: string indicating the type of message box: 9 % title= 'INPUT_TXT','CONFIMATION' ,'ERROR', 'WARNING', 'INPUT_Y-N', default = 'INPUT_TXT' (the title is displayed in the upper bar of the fig). 10 % if title='INPUT_TXT', input data is asked in an edit box 11 % if title='CONFIMATION'', 'ERROR', 'WARNING', the figure remains opened until a button 'OK' is pressed 12 % if title='INPUT_Y-N', an answer Yes/No is requested 13 % display, displayed text 14 % default_answer: default answer in the edit box (only used with title='INPUT_TXT') 8 % input_grid (optional): structure to initiate the GUI with fields .x_0,.Dx,.x_1 9 % (defining x coordinates), .y_0,.Dy,.y_1 (defining y coordinates) 15 10 16 11 function varargout = create_grid(varargin) -
trunk/src/get_field.m
r34 r38 543 543 DimIndex_v(ind)=[];%Mremove singleton 544 544 if ~isequal(DimIndex_u,DimIndex_v) 545 warndlg_uvmat('inconsistent dimensions for u and v','ERROR')545 msgbox_uvmat('ERROR','inconsistent dimensions for u and v') 546 546 set(handles.vector_y,'Value',1); 547 547 return 548 548 elseif test_scalar & ~isequal(DimIndex_u,DimIndex) 549 warndlg_uvmat('inconsistent dimensions for vector and scalar represented as vector color','ERROR')549 msgbox_uvmat('ERROR','inconsistent dimensions for vector and scalar represented as vector color') 550 550 set(handles.scalar,'Value',1); 551 551 return … … 561 561 nbdim=length(DimIndex); 562 562 if nbdim > 3 563 warndlg_uvmat('array with more than three dimensions, not supported','ERROR')563 msgbox_uvmat('ERROR','array with more than three dimensions, not supported') 564 564 return 565 565 else … … 590 590 test_grid=1; 591 591 else 592 warndlg_uvmat('multiple dimensions for the z coordinate','ERROR')592 msgbox_uvmat('ERROR','multiple dimensions for the z coordinate') 593 593 return 594 594 end … … 634 634 end 635 635 elseif test_grid 636 warndlg_uvmat('the dimension of the y coordinate variable should be 1','ERROR')636 msgbox_uvmat('ERROR','the dimension of the y coordinate variable should be 1') 637 637 end 638 638 end … … 677 677 DimIndex=DimIndex(perm_ind); 678 678 elseif test_grid 679 warndlg_uvmat('the dimension of the x coordinate variable should be 1','ERROR')679 msgbox_uvmat('ERROR','the dimension of the x coordinate variable should be 1') 680 680 end 681 681 if isequal(DimIndex_x,DimIndex) … … 1282 1282 check_vector_Callback(hObject, eventdata, handles) 1283 1283 end 1284 %1285 % % --- Executes on selection change in menu_coord.1286 % function menu_coord_Callback(hObject, eventdata, handles)1287 % hget_field=get(handles.menu_coord,'parent');1288 % menu=get(handles.menu_coord,'String');1289 % ind_coord=get(handles.menu_coord,'Value');1290 % coord_option=menu{ind_coord};1291 % if isequal(coord_option,'more...');1292 % fct_name='';1293 % if exist('./TMP/current_usr_fct.mat','file')% if a file is found1294 % h=load('./TMP/current_usr_fct.mat');1295 % if isfield(h,'fct_name');1296 % fct_name=h.fct_name;1297 % end1298 % end1299 % prompt = {'Enter the name of the transform function'};1300 % dlg_title = 'user defined transform';1301 % num_lines= 1;1302 % [FileName, PathName, filterindex] = uigetfile( ...1303 % {'*.m', ' (*.m)';1304 % '*.m', '.m files '; ...1305 % '*.*', 'All Files (*.*)'}, ...1306 % 'Pick a file', fct_name);1307 % fct_name=fullfile(PathName,FileName);1308 % addpath(PathName);%add the path to the selected fct1309 % [errormsg,date_str]=check_functions;%check whether new functions can oversed the uvmat package A UTILISER1310 % if ~exist(fct_name,'file')1311 % warndlg_uvmat(['image procesing fct ' fct_name ' not found'],'WARNING')1312 % else1313 % transform=FileName(1:end-2);%1314 % menu=update_menu(handles.menu_coord,transform);%add the selected fct to the menu1315 % % set(handles.mouse_coord,'String',menu([1:end-1])')%update the mouse coord menu1316 % save ('./TMP/current_usr_fct.mat','fct_name');1317 % end1318 % end1319 1320 1321 1284 1322 1285 %----------------------------------------------------- … … 1330 1293 name=get(hh(ifig),'Name'); 1331 1294 if ~isequal(name,'uvmat')%case of uvmat GUI 1332 % ilist=ilist+1;1333 % list{ilist,1}='uvmat';1334 % else %other figures1335 1295 hchild=get(hh(ifig),'children');% look for axes contained in each figure 1336 1296 nbaxe=0; -
trunk/src/plot_object.m
r19 r38 49 49 end 50 50 if ~isfield(ObjectData,'Style')|isempty(ObjectData.Style)|~ischar(ObjectData.Style) 51 warndlg_uvmat('undefined ObjectData.Style in plot_object.m','ERROR')51 msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m') 52 52 return 53 53 end 54 54 if ~isfield(ObjectData,'Style')|isempty(ObjectData.Style)|~ischar(ObjectData.Style) 55 warndlg_uvmat('undefined ObjectData.Style in plot_object.m','ERROR')55 msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m') 56 56 return 57 57 end … … 377 377 hh=rectangle('Curvature',[1 1],'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col); 378 378 else 379 warndlg_uvmat('unknown ObjectData.Style in plot_object.m','ERROR')379 msgbox_uvmat('ERROR','unknown ObjectData.Style in plot_object.m') 380 380 return 381 381 end 382 382 set(hh,'Tag','proj_object') 383 %set(hh,'UserData',ObjectData)%384 % hh=hplot;385 % set(hh,'DeleteFcn',@deletefcn)386 % if isequal(ObjectData.ProjMode,'inside')387 % if isequal(ObjectData.Style,'ellipse')|isequal(ObjectData.Style,'rectangle')388 % set(hh,'FaceColor',col)389 % set(hh,'EdgeColor',col)390 % end391 % end392 383 if test_patch 393 384 hold on -
trunk/src/proj_field.m
r19 r38 241 241 test3D=1; 242 242 end 243 % if length(ivar_U)>1 | length(ivar_V)>1 | length(ivar_W)>1244 % warndlg_uvmat('multiple vector input in proj_field.m','ERROR')245 % return246 % end247 243 if length(ivar_F)>1 | length(ivar_FF)>1 248 warndlg_uvmat('multiple flag input in proj_field.m','ERROR')244 msgbox_uvmat('ERROR','multiple flag input in proj_field.m') 249 245 return 250 end 251 246 end 252 247 for ipoint=1:siz(1) 253 248 Xpoint=ObjectData.Coord(ipoint,:); … … 473 468 Coord{idim}=[0.5 DimValue(idim)]; 474 469 test_direct(idim)=1; 475 % if isfield(FieldData,'VarAttribute')476 % for ivar=VarIndex477 % if length(FieldData.VarAttribute)>=ivar & isfield(FieldData.VarAttribute{ivar},Coord_i_str)% if there is a variable attribute named Coord_1, _2 or _3478 % eval(['Coord_i=FieldData.VarAttribute{ivar}.' Coord_i_str ';']);%'range x479 % if isnumeric(Coord_i)480 % if length(Coord_i)>=2481 % Coord{idim}=[Coord_i(1) Coord_i(end)];482 % %test_direct(idim)=(Coord{idim}(2)>Coord{idim}(1));483 % else484 % warndlg_uvmat(['two values needed for ' Coord_i_str 'in proj_field.m'],'ERROR')485 % return486 % end487 % else488 % warndlg_uvmat(['non numerical coordinate attributes' Coord_i_str 'in proj_field.m'],'ERROR')489 % return490 % end491 % %test_coord(idim)=1;492 % DCoord_min(idim)=(Coord{idim}(end)-Coord{idim}(1))/(DimValue(idim)-1);493 % end494 % end495 % end496 470 end 497 471 AX=linspace(Coord{2}(1),Coord{2}(2),DimValue(2)); … … 1288 1262 test_direct_min=DCoord_min(idim)>0;% =1 for increasing values, 0 otherwise 1289 1263 if ~isequal(test_direct(idim),test_direct_min) 1290 warndlg_uvmat(['non monotonic dimension variable # ' num2str(idim) ' in proj_field.m'],'ERROR')1264 msgbox_uvmat('ERROR',['non monotonic dimension variable # ' num2str(idim) ' in proj_field.m']) 1291 1265 return 1292 1266 end … … 1299 1273 Coord{idim}=[0.5 DimValue(idim)-0.5]; 1300 1274 test_direct(idim)=1; 1301 % for ivar=VarIndex1302 % if isfield(FieldData.VarAttribute{ivar},Coord_i_str)% if there is a variable attribute named Coord_1, _2 or _31303 % eval(['Coord{idim}=FieldData.VarAttribute{ivar}.' Coord_i_str ';']);%'range x1304 % if isnumeric(Coord{idim})1305 % if length(Coord{idim})>=21306 % test_direct(idim)=(Coord{idim}(2)>Coord{idim}(1));1307 % else1308 % warndlg_uvmat(['two values needed for ' Coord_i_str 'in proj_field.m'],'ERROR')1309 % return1310 % end1311 % else1312 % warndlg_uvmat(['non numerical coordinate attributes' Coord_i_str 'in proj_field.m'],'ERROR')1313 % return1314 % end1315 % DCoord_min(idim)=(Coord{idim}(end)-Coord{idim}(1))/(DimValue(idim)-1);1316 % end1317 % end1318 1275 end 1319 1276 end … … 1557 1514 if ~isequal(Phi,0) & length(ivar_U)==1 1558 1515 if isempty(ivar_V) 1559 warndlg_uvmat('v velocity component missing in proj_field.m','ERROR')1516 msgbox_uvmat('ERROR','v velocity component missing in proj_field.m') 1560 1517 return 1561 1518 end -
trunk/src/proj_grid.m
r19 r38 6 6 function [A,rangx,rangy]=proj_grid(vec_X,vec_Y,vec_A,rgx_in,rgy_in,npxy_in) 7 7 if length(vec_Y)<2 8 warndlg_uvmat('less than 2 points in proj_grid.m','ERROR');8 msgbox_uvmat('ERROR','less than 2 points in proj_grid.m'); 9 9 return; 10 10 end 11 11 diffy=diff(vec_Y); %difference dy=vec_Y(i+1)-vec_Y(i) 12 12 index=find(diffy);% find the indices of vec_Y after wich a change of horizontal line occurs(diffy non zero) 13 if isempty(index); warndlg_uvmat('points aligned along abscissa in proj_grid.m','ERROR'); return; end;%points aligned% A FAIRE: switch to line plot.13 if isempty(index); msgbox_uvmat('ERROR','points aligned along abscissa in proj_grid.m'); return; end;%points aligned% A FAIRE: switch to line plot. 14 14 diff2=diff(diffy(index));% diff2 = fluctuations of the detected vertical grid mesh dy 15 15 if max(abs(diff2))>0.001*abs(diffy(index(1))) % if max(diff2) is larger than 1/1000 of the first mesh dy -
trunk/src/series.m
r36 r38 55 55 %-------------------------------------------------------------------------- 56 56 function series_OpeningFcn(hObject, eventdata, handles,param) 57 global nb_builtin 57 global nb_builtin nb_transform 58 58 % Choose default command line output for series 59 59 handles.output = hObject; … … 133 133 134 134 %loads the information stored in prefdir to initiate the browser and the list of functions 135 menu_str={'check_files';'aver_stat';'time_series';'merge_proj';'clean_civ_cmx'}; 136 nb_builtin=numel(menu_str); %number of functions 135 fct_menu={'check_files';'aver_stat';'time_series';'merge_proj';'clean_civ_cmx'}; 136 transform_menu={'';'phys';'px';'phys_polar'}; 137 nb_builtin=numel(fct_menu); %number of functions 138 nb_transform=numel(transform_menu); 137 139 [path_series,name,ext]=fileparts(which('series')); 138 140 path_series=fullfile(path_series,'series');%path of the function 'series' 139 140 for ilist=1:length( menu_str)141 path_transform=fullfile(path_series,'transform_field');%path of the function 'series' 142 for ilist=1:length(fct_menu) 141 143 fct_path{ilist,1}=path_series;%paths of the fuctions buil-in in 'series.m' 144 end 145 for ilist=1:length(transform_menu) 146 transform_path{ilist,1}=path_transform; 142 147 end 143 148 % read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir … … 150 155 [path,file]=fileparts(h.series_fct{ilist}); 151 156 fct_path=[fct_path; {path}];%concatene the list of paths 152 menu_str=[menu_str; {file}];157 transform_menu=[transform_menu; {file}]; 153 158 end 154 159 end 155 end 156 157 menu_str=[menu_str;{'more...'}]; 158 set(handles.ACTION,'String',menu_str) 160 if isfield(h,'transform_fct') && iscell(h.transform_fct) 161 for ilist=1:length(h.transform_fct) 162 [path,file]=fileparts(h.transform_fct{ilist}); 163 transform_path=[transform_path; {path}];%concatene the list of paths 164 transform_menu=[transform_menu;{file}]; 165 end 166 end 167 end 168 fct_menu=[fct_menu;{'more...'}]; 169 set(handles.ACTION,'String',fct_menu) 159 170 set(handles.ACTION,'UserData',fct_path)% store the list of path in UserData of ACTION 171 transform_menu=[transform_menu;{'more...'}]; 172 set(handles.CoordType,'String',transform_menu) 173 set(handles.CoordType,'UserData',transform_path)% store the list of path in UserData of ACTION 160 174 161 175 % display the GUI for the default action 'check_files' -
trunk/src/series/aver_stat.m
r29 r38 358 358 eval(['siz=size(Field.' VarName ');']); 359 359 if ~isequal(siz,sizmean) 360 warndlg_uvmat(['unequal size of input field ' VarName ', need to interpolate on a grid'],'WARNING')360 msgbox_uvmat('WARNING',['unequal size of input field ' VarName ', need to interpolate on a grid']) 361 361 nbmissing=nbmissing+1; 362 362 break -
trunk/src/series/sub_background.m
r24 r38 118 118 end 119 119 if ~isequal(floor(nbslice_i),nbslice_i) 120 warndlg_uvmat('the number of slices must be a multiple of the i increment','ERROR')120 msgbox_uvmat('ERROR','the number of slices must be a multiple of the i increment') 121 121 return 122 122 end -
trunk/src/series/time_series.m
r27 r38 249 249 for icell=1:length(timecell) 250 250 if ~isequal(size(timecell{icell}),size(timecell{1})) 251 warndlg_uvmat('inconsistent time array dimensions in ImaDoc fields, the time for the first series is used','WARNING')251 msgbox_uvmat('WARNING','inconsistent time array dimensions in ImaDoc fields, the time for the first series is used') 252 252 time=timecell{1}; 253 253 multitime=0; … … 262 262 diff_time=max(max(diff(time))); 263 263 if diff_time>0 264 warndlg_uvmat(['times of series differ by more than ' num2str(diff_time)],'WARNING')264 msgbox_uvmat('WARNING',['times of series differ by more than ' num2str(diff_time)]) 265 265 end 266 266 end -
trunk/src/set_grid.m
r2 r38 478 478 if isempty(imageA) | isequal(imageA,'') 479 479 if isempty(imageB) | isequal(imageB,'') 480 warndlg_uvmat('at least one image file name must be introduced','ERROR')480 msgbox_uvmat('ERROR','at least one image file name must be introduced') 481 481 else 482 482 imageA=imageB; … … 518 518 testexist=exist(imageB,'file'); 519 519 if isequal(testexist,0) 520 warndlg_uvmat(['input image file' imageB 'does not exist'],'ERROR')520 msgbox_uvmat('ERROR',['input image file' imageB 'does not exist']) 521 521 return 522 522 end … … 524 524 form=imformats(ext([2:end])); 525 525 if isempty(form)% if the extension corresponds to an image format recognized by Matlab 526 warndlg_uvmat(['error in read_image.m: ' imageB ' is not an image name recognized by Matlab '],'ERROR')526 msgbox_uvmat('ERROR',['error in read_image.m: ' imageB ' is not an image name recognized by Matlab ']) 527 527 return 528 528 end … … 532 532 tsaiB=XmlDataB.GeometryCalib; 533 533 else 534 warndlg_uvmat('no geometric calibration available for image B','WARNING')534 msgbox_uvmat('WARNING','no geometric calibration available for image B') 535 535 tsaiB=[]; 536 536 end -
trunk/src/uvmat.m
r36 r38 12 12 % 13 13 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 14 % Copyright Joel Sommeria, Louis Gostiaux, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.14 % Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, joel.sommeria@legi.grenoble-inp.fr. 15 15 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 16 16 % This open is part of the toolbox UVMAT. … … 199 199 handles.output = hObject; 200 200 201 % %group handles for input file in a structure handles.InputFile202 % handlesInputFile={handles.RootPath,handles.SubDir,handles.RootFile,handles.FileIndex,handles.FileExt};203 % TagsInputFile={'RootPath','SubDir','RootFile','FileIndex','FileExt'};204 % handles.InputFile=cell2struct(handlesInputFile,TagsInputFile,2);205 %206 % %group handles for the second input file in a structure handles.InputFile_1207 % handlesInputFile={handles.RootPath_1,handles.SubDir_1,handles.RootFile_1,handles.FileIndex_1,handles.FileExt_1};208 % TagsInputFile={'RootPath','SubDir','RootFile','FileIndex','FileExt'};209 % handles.InputFile_1=cell2struct(handlesInputFile,TagsInputFile,2);210 211 201 % Update handles structure 212 202 guidata(hObject, handles); … … 271 261 %check the path of menu_coord transform 272 262 %set(handles.menu_coord,'String',{'';'phys';'px';'more...'}) 273 path_fct{1}='';274 path_fct{2}=fileparts(path_to_uvmat);275 path_fct{3}=fileparts(path_to_uvmat);276 path_fct{4}=fileparts(path_to_uvmat);277 set(handles.menu_coord,'UserData',path_fct)263 % path_fct{1}=''; 264 % path_fct{2}=fileparts(path_to_uvmat); 265 % path_fct{3}=fileparts(path_to_uvmat); 266 % path_fct{4}=fileparts(path_to_uvmat); 267 % set(handles.menu_coord,'UserData',path_fct) 278 268 279 269 %case of an input argument for uvmat … … 283 273 if exist('input','var') 284 274 if ~isempty(errormsg) 285 warndlg_uvmat(errormsg,'WARNING')275 msgbox_uvmat('WARNING',errormsg) 286 276 end 287 277 if ishandle(handles.UVMAT_title) … … 298 288 sizinput=size(input); 299 289 if sizinput(1)<=1 || sizinput(2)<=1 300 warndlg_uvmat('bad input for uvmat: file name, structure or numerical matrix accepted','ERROR')290 msgbox_uvmat('ERROR','bad input for uvmat: file name, structure or numerical matrix accepted') 301 291 return 302 292 end … … 354 344 end 355 345 end 346 347 %TRANSFORM menu: loads the information stored in prefdir to initiate the browser and the list of functions 348 menu_str={'';'phys';'px';'phys_polar'}; 349 nb_builtin=numel(menu_str); %number of functions 350 [path_uvmat,name,ext]=fileparts(which('uvmat')); 351 addpath(fullfile(path_uvmat,'transform_field')) 352 fct_handle{1,1}=[]; 353 testexist(1)=1; 354 for ilist=2:length(menu_str) 355 if exist(menu_str{ilist},'file') 356 fct_handle{ilist,1}=str2func(menu_str{ilist}); 357 testexist(ilist)=1; 358 else 359 testexist(ilist)=0; 360 end 361 % fct_handle{ilist,1}=fullfile(path_uvmat,'transform_field');%path to the transform functions path_transform; 362 end 363 rmpath(fullfile(path_uvmat,'transform_field')) 364 % read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir 365 dir_perso=prefdir; 366 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 367 if exist(profil_perso,'file') 368 h=load (profil_perso); 369 if isfield(h,'transform_fct') && iscell(h.transform_fct) 370 for ilist=1:length(h.transform_fct) 371 [path,file]=fileparts(h.transform{ilist}); 372 addpath(path) 373 if exist(file,'file') 374 h_func=str2func(path); 375 testexist=[testexist 1]; 376 else 377 h_func=[]; 378 testexist=[testexist 0]; 379 end 380 fct_handle=[fct_handle; {h_func}];%concatene the list of paths 381 rmpath(path) 382 % fct_path=[fct_path; {path}];%concatene the list of paths 383 menu_str=[menu_str; {file}]; 384 end 385 end 386 end 387 menu_str=menu_str(find(testexist)); 388 fct_handle=fct_handle(find(testexist)); 389 menu_str=[menu_str;{'more...'}]; 390 set(handles.menu_coord,'String',menu_str) 391 set(handles.menu_coord,'UserData',fct_handle)% store the list of path in UserData of ACTION 392 356 393 set_vec_col_bar(handles) 357 394 … … 408 445 testblank=findstr(fileinput,' ');%look for blanks 409 446 if ~isempty(testblank) 410 warndlg_uvmat(['The input file name ' fileinput ' contains blank character : This is not allowed. Please change name'],'ERROR')447 msgbox_uvmat('ERROR',['The input file name ' fileinput ' contains blank character : This is not allowed. Please change name']) 411 448 return 412 449 end … … 906 943 testblank=findstr(fileinput_1,' ');%look for blanks 907 944 if ~isempty(testblank) 908 warndlg_uvmat(['The input file name ' fileinput_1 ' contains blank character : This is not allowed. Please change name'],'ERROR')945 msgbox_uvmat('ERROR',['The input file name ' fileinput_1 ' contains blank character : This is not allowed. Please change name']) 909 946 return 910 947 end … … 1008 1045 % set(handles.FileIndex,'UserData',NomType_1); 1009 1046 otherwise 1010 warndlg_uvmat(['invalid input file extension ' FileExt_1 ' for uvmat'],'ERROR')1047 msgbox_uvmat(['invalid input file extension ' FileExt_1 ' for uvmat'],'ERROR') 1011 1048 return 1012 1049 end … … 1015 1052 if nbfield_1 >1 %case of image with multiple frames 1016 1053 if nbfield_1 < num_i1 1017 warndlg_uvmat('current frame index beyond the input movie length','ERROR')1054 msgbox_uvmat('ERROR','current frame index beyond the input movie length') 1018 1055 return 1019 1056 else … … 1037 1074 indices=''; %default 1038 1075 if ~idetect 1039 warndlg_uvmat('second input file with indices corresponding to the first one does not exist','ERROR')1076 msgbox_uvmat('ERROR','second input file with indices corresponding to the first one does not exist') 1040 1077 return 1041 1078 end … … 1195 1232 end 1196 1233 if ~isempty(TimeUnit_1) && ~isequal(TimeUnit_1,TimeUnit) 1197 warndlg_uvmat('the time units for the second series differs from the first one','WARNING')1234 msgbox_uvmat('WARNING','the time units for the second series differs from the first one') 1198 1235 end 1199 1236 … … 1218 1255 set(handles.last_j,'String',last_j_cell); 1219 1256 if ~isequal(last_i_cell{1},last_i_cell{2}) || ~isequal(last_j_cell{1},last_j_cell{2}) 1220 warndlg_uvmat('the numbers of input file of the second series differs from the first one','WARNING')1257 msgbox_uvmat('WARNING','the numbers of input file of the second series differs from the first one') 1221 1258 end 1222 1259 … … 1244 1281 1245 1282 if ~isequal(warntext,'') 1246 warndlg_uvmat(warntext,'WARNING')1283 msgbox_uvmat('WARNING',warntext) 1247 1284 end 1248 1285 … … 1479 1516 end 1480 1517 %px to phys or other transform on field 1481 menu_transform=get(handles.menu_coord,'String');1518 menu_transform=get(handles.menu_coord,'String'); 1482 1519 choice_value=get(handles.menu_coord,'Value'); 1483 transform=menu_transform{choice_value};%name of the transform fct given by the menu 'menu_coord' 1484 if ~isequal(transform,'') && ~isequal(transform,'px') 1520 transform_name=menu_transform{choice_value};%name of the transform fct given by the menu 'menu_coord' 1521 transform_list=get(handles.menu_coord,'UserData'); 1522 transform=transform_list{choice_value}; 1523 if ~isequal(transform_name,'') && ~isequal(transform_name,'px') 1485 1524 if isfield(UvData,'XmlData') && isfield(UvData.XmlData,'GeometryCalib')%use geometry calib recorded from the ImaDoc xml file as first priority 1486 1525 Calib=UvData.XmlData.GeometryCalib; 1487 Mask= feval(transform,Mask,UvData.XmlData);1526 Mask=transform(Mask,UvData.XmlData); 1488 1527 end 1489 1528 end … … 1675 1714 UvData=get(huvmat,'UserData'); 1676 1715 else 1677 warndlg_uvmat('an image or movie must be first introduced as input','ERROR')1716 msgbox_uvmat('ERROR','an image or movie must be first introduced as input') 1678 1717 return 1679 1718 end … … 1686 1725 [imaname_1,idetect]=name_generator(filebase,num_i1,num_j2,Ext,NomType); 1687 1726 if idetect==0 1688 warndlg_uvmat(['second input open (-) ' imaname_1 ' not found'],'ERROR');1727 msgbox_uvmat('ERROR',['second input open (-) ' imaname_1 ' not found']); 1689 1728 return 1690 1729 end … … 1694 1733 [imaname_1,idetect]=name_generator(filebase,num_i2,num_j1,Ext,NomType); 1695 1734 if idetect==0 1696 warndlg_uvmat(['second input open (-) ' imaname_1 ' not found'],'ERROR');1735 msgbox_uvmat('ERROR',['second input open (-) ' imaname_1 ' not found']); 1697 1736 return 1698 1737 end 1699 1738 else 1700 warndlg_uvmat('a second image index i2 or j2 is needed to show the pair as a movie','ERROR')1739 msgbox_uvmat('ERROR', 'a second image index i2 or j2 is needed to show the pair as a movie') 1701 1740 return 1702 1741 end … … 1704 1743 %read the second image 1705 1744 Field.AName='image'; 1706 % Field.ListDimName={'AY','AX'}; %A FAIRE1707 % Field.DimValue=[];1708 % Field.ListVarName={'A'};1709 1745 Field.AX=UvData.Field.AX; 1710 1746 Field.AY=UvData.Field.AY; … … 1716 1752 menu_transform=get(handles.menu_coord,'String'); 1717 1753 choice_value=get(handles.menu_coord,'Value'); 1718 transform=menu_transform{choice_value};%name of the transform fct given by the menu 'menu_coord' 1719 if ~isequal(transform,'') && ~isequal(transform,'px') 1754 transform_name=menu_transform{choice_value};%name of the transform fct given by the menu 'menu_coord' 1755 transform_list=get(handles.menu_coord,'UserData'); 1756 transform=transform_list{choice_value}; 1757 if ~isequal(transform_name,'') && ~isequal(transform_name,'px') 1720 1758 if isfield(UvData,'XmlData') && isfield(UvData.XmlData,'GeometryCalib')%use geometry calib recorded from the ImaDoc xml file as first priority 1721 Field= feval(transform,Field,UvData.XmlData);1759 Field=transform(Field,UvData.XmlData); 1722 1760 end 1723 1761 end … … 1996 2034 [Field{2},var_detect]=nc2struct(filename_1,SubField.ListVarName); %read the corresponding input data 1997 2035 Field{2}.VarAttribute=SubField.VarAttribute; 1998 if isequal(get(hhget_field.menu_coord,'Visible'),'on')1999 list_transform=get(hhget_field.menu_coord,'String');2000 val_list=get(hhget_field.menu_coord,'Value');2001 transf=list_transform{val_list};2002 if ~isempty(transf)2003 Field{2}=feval(transf,Field{2});2004 end2005 end2036 % if isequal(get(hhget_field.menu_coord,'Visible'),'on') 2037 % list_transform=get(hhget_field.menu_coord,'String'); 2038 % val_list=get(hhget_field.menu_coord,'Value'); 2039 % transf=list_transform{val_list}; 2040 % if ~isempty(transf) 2041 % Field{2}=feval(transf,Field{2}); 2042 % end 2043 % end 2006 2044 2007 2045 %update the display on get_field … … 2135 2173 menu_transform=get(handles.menu_coord,'String'); 2136 2174 choice_value=get(handles.menu_coord,'Value'); 2137 transform=menu_transform{choice_value};%name of the transform fct given by the menu 'menu_coord' 2175 %transform=menu_transform{choice_value};%name of the transform fct given by the menu 'menu_coord' 2176 transform_list=get(handles.menu_coord,'UserData') 2177 transform=transform_list{choice_value}%selected function handles 2138 2178 2139 2179 % z index … … 2142 2182 end 2143 2183 %px to phys or other transform on field 2144 if ~ise qual(transform,'')2184 if ~isempty(transform) 2145 2185 if length(Field)>=2 2146 2186 Field{2}.ZIndex=mod(num_i1-1,nbslice)+1; 2147 [Field{1},Field{2}]= feval(transform,Field{1},XmlData,Field{2},XmlData_1);2187 [Field{1},Field{2}]=transform(Field{1},XmlData,Field{2},XmlData_1); 2148 2188 if isempty(Field{2}) 2149 2189 Field(2)=[]; 2150 2190 end 2151 2191 else 2152 Field{1}=feval(transform,Field{1},XmlData); 2192 'TESTrun' 2193 Field{1}=transform(Field{1},XmlData); 2194 Field{1} 2153 2195 end 2154 2196 end … … 2612 2654 nc=netcdf(filename,'write'); %open netcdf file 2613 2655 result=redef(nc); 2614 if isempty(result), warndlg_uvmat('##Bad redef operation.','ERROR'),end2656 if isempty(result), msgbox_uvmat('ERROR','##Bad redef operation.'),end 2615 2657 test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]); 2616 2658 if ~test_civ2 … … 3708 3750 imflag=flipdim(imflag,1); 3709 3751 % imflag=uint8(255*flag);% =0 for flag=0 (vectors=0 when 20<imflag<200) 3710 warndlg_uvmat([mask_name ' saved'],'CONFIRMATION')3752 msgbox_uvmat('CONFIRMATION',[mask_name ' saved']) 3711 3753 imwrite(imflag,mask_name,'BitDepth',8); 3712 3754 … … 3968 4010 ind_coord=get(handles.menu_coord,'Value'); 3969 4011 coord_option=menu{ind_coord}; 3970 list_ path=get(handles.menu_coord,'UserData');4012 list_transform=get(handles.menu_coord,'UserData'); 3971 4013 3972 4014 if isequal(coord_option,'more...'); … … 3995 4037 msgbox_uvmat('ERROR',['image procesing fct ' coord_fct ' not found']) 3996 4038 else 3997 transform=FileName(1:end-2);%4039 [ppp,transform]=fileparts(FileName);% removes extension .m 3998 4040 menu=update_menu(handles.menu_coord,transform);%add the selected fct to the menu 3999 4041 ind_coord=get(handles.menu_coord,'Value'); 4000 list_path{ind_coord}=PathName; 4001 set(handles.menu_coord,'UserData',list_path) 4042 addpath(PathName) 4043 list_transform{ind_coord}=str2func(transform);% create the function handle corresponding to the newly seleced function 4044 set(handles.menu_coord,'UserData',list_transform) 4045 rmpath(PathName) 4002 4046 if exist(profil_perso,'file') 4003 4047 save (profil_perso,'coord_fct','-append'); %store the root name for future opening of uvmat … … 4007 4051 4008 4052 %check the current path to the selected function 4009 PathName=list_path{ind_coord}; 4010 CurrentPath=fileparts(which(coord_option)); 4011 if ~isequal(PathName,CurrentPath)&&~isequal(CurrentPath,fullfile(PathName,'private')) 4012 addpath(PathName) 4013 errormsg=check_functions; 4014 msgbox_uvmat('WARNING',[['path ' PathName ' added to the current Matlab pathes'];errormsg]) 4015 end 4016 set(handles.path_transform,'String',fullfile(PathName,' ')); %show the path to the senlected function 4053 func=functions(list_transform{ind_coord}) 4054 set(handles.path_transform,'String',fileparts(func.file)); %show the path to the senlected function 4055 %CurrentPath=fileparts(which(coord_option)); 4056 % if ~isequal(PathName,CurrentPath) 4057 % addpath(PathName) 4058 % errormsg=check_functions; 4059 % msgbox_uvmat('WARNING',[['path ' PathName ' added to the current Matlab pathes'];errormsg]) 4060 % end 4061 %set(handles.path_transform,'String',fullfile(PathName,' ')); %show the path to the senlected function 4017 4062 set(handles.FixedLimits,'Value',0) 4018 4063 set(handles.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
Note: See TracChangeset
for help on using the changeset viewer.