Changeset 1001
- Timestamp:
- Feb 27, 2017, 9:28:27 AM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r993 r1001 168 168 % --- Executes on button press APPLY (used to launch the calibration). 169 169 function APPLY_Callback(hObject, eventdata, handles) 170 set(handles.CheckEnableMouse,'Value',0)% desactivate mouse (to avoid spurious creation of new points) 171 170 172 %------------------------------------------------------------------------ 171 173 %% look for the GUI uvmat and check for an image as input … … 173 175 huvmat=findobj(allchild(0),'Name','uvmat');% look for the GUI uvmat 174 176 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 177 if ~strcmp(get(hhuvmat.Scalar,'Visible'),'on') 178 msgbox_uvmat('ERROR','An image needs to be opened in uvmat for calibration') 179 return 180 end 175 181 176 182 RootPath=''; … … 186 192 outputfile=answer{1}; 187 193 end 188 [GeometryCalib,index]=calibrate(handles,hhuvmat);% apply calibration 194 195 %% read coordinates of the calibration poinnts: Coord(:,1-3) in phys, Coord(:,4-5) image 196 Coord=get(handles.ListCoord,'Data'); 197 198 199 %% read the type of calibration 200 calib_cell=get(handles.calib_type,'String'); 201 val=get(handles.calib_type,'Value'); 202 CalibFcn=['calib_' calib_cell{val}]; 203 204 %% read the intrinsic parameters 205 Intrinsic.Npx=str2num(get(hhuvmat.num_Npx,'String')); 206 Intrinsic.Npy=str2num(get(hhuvmat.num_Npy,'String')); 207 Intrinsic.coord_files=get(handles.ListCoordFiles,'String'); 208 Intrinsic.f1=str2num(get(handles.fx,'String')); 209 Intrinsic.f2=str2num(get(handles.fy,'String')); 210 Intrinsic.k=str2num(get(handles.kc,'String')); 211 Intrinsic.Cx=str2num(get(handles.Cx,'String')); 212 Intrinsic.Cy=str2num(get(handles.Cy,'String')); 213 if isempty(Intrinsic.k) 214 Intrinsic.k=0; 215 end 216 if isempty(Intrinsic.Cx)||isempty(Intrinsic.Cy) 217 Intrinsic.Cx=Intrinsic.Npx/2; 218 Intrinsic.Cy=Intrinsic.Npy/2; 219 end 220 221 %% Apply calibration 222 [GeometryCalib,index,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration 223 224 %% record the coordinate unit 225 unitlist=get(handles.CoordUnit,'String'); 226 unit=unitlist{get(handles.CoordUnit,'value')}; 227 GeometryCalib.CoordUnit=unit; 228 229 %% record the coordinates of the calibration points 230 GeometryCalib.SourceCalib.PointCoord=Coord; 231 232 %% display calibration results on the GUI geometry_calib 233 display_intrinsic(GeometryCalib,handles)%display calibration intrinsic parameters 234 display_extrinsic(GeometryCalib,handles)%display calibration extrinsic parameters 235 % (rotation and translation of camera with respect to the phys coordinates) 236 237 %% store the calibration data, by default in the xml file of the currently displayed image 238 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 239 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 240 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']}); 241 if strcmp(answer,'Yes') %store the calibration data 242 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 243 msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'}) 244 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 245 end 246 else 247 GeometryCalib=[]; 248 index=1; 249 end 189 250 190 251 if isempty(GeometryCalib) % if calibration cancelled … … 228 289 function REPLICATE_Callback(hObject, eventdata, handles) 229 290 %------------------------------------------------------------------------ 291 set(handles.CheckEnableMouse,'Value',0)% desactivate mouse (to avoid spurious creation of new points) 230 292 231 293 %% look for the GUI uvmat and check for an image as input 232 294 huvmat=findobj(allchild(0),'Name','uvmat'); 233 295 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 234 GeometryCalib=calibrate(handles,hhuvmat);% apply calibration 296 297 %% read coordinates of the calibration poinnts: Coord(:,1-3) in phys, Coord(:,4-5) image 298 Coord=get(handles.ListCoord,'Data'); 299 300 %% read the type of calibration 301 calib_cell=get(handles.calib_type,'String'); 302 val=get(handles.calib_type,'Value'); 303 CalibFcn=['calib_' calib_cell{val}]; 304 305 %% read the intrinsic parameters 306 Intrinsic.Npx=str2num(get(hhuvmat.num_Npx,'String')); 307 Intrinsic.Npy=str2num(get(hhuvmat.num_Npy,'String')); 308 Intrinsic.coord_files=get(handles.ListCoordFiles,'String'); 309 Intrinsic.f1=str2num(get(handles.fx,'String')); 310 Intrinsic.f2=str2num(get(handles.fy,'String')); 311 Intrinsic.k=str2num(get(handles.kc,'String')); 312 Intrinsic.Cx=str2num(get(handles.Cx,'String')); 313 Intrinsic.Cy=str2num(get(handles.Cy,'String')); 314 if isempty(Intrinsic.k) 315 Intrinsic.k=0; 316 end 317 if isempty(Intrinsic.Cx)||isempty(Intrinsic.Cy) 318 Intrinsic.Cx=Intrinsic.Npx/2; 319 Intrinsic.Cy=Intrinsic.Npy/2; 320 end 321 322 %% apply to cropped images if requested 323 answer=msgbox_uvmat('INPUT_Y-N','apply to cropped images?'); 324 if strcmp(answer,'Yes') 325 prompt = {'npy_lower'}; 326 dlg_title = 'remove image the npy_lower image lines (removal of the upper linedoes not change calibration)'; 327 num_lines= 1; 328 def = {'0'}; 329 answer = inputdlg(prompt,dlg_title,num_lines,def); 330 npy_crop=str2num(answer{1}); 331 Intrinsic.Npy=Intrinsic.Npy-npy_crop; %size of the filtering window 332 Coord(:,5)=Coord(:,5)-npy_crop;% shift the image ordinates of the calibration points by removing the lower band 333 end 334 335 %% Apply calibration 336 [GeometryCalib,index,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration 337 338 339 %% record the coordinate unit 340 unitlist=get(handles.CoordUnit,'String'); 341 unit=unitlist{get(handles.CoordUnit,'value')}; 342 GeometryCalib.CoordUnit=unit; 343 344 %% record the coordinates of the calibration points 345 GeometryCalib.SourceCalib.PointCoord=Coord; 346 347 %% display calibration results on the GUI geometry_calib 348 display_intrinsic(GeometryCalib,handles)%display calibration intrinsic parameters 349 display_extrinsic(GeometryCalib,handles)%display calibration extrinsic parameters 350 % (rotation and translation of camera with respect to the phys coordinates) 351 352 %% store the calibration data, by default in the xml file of the currently displayed image 353 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 354 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 355 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']}); 356 if strcmp(answer,'Yes') %store the calibration data 357 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 358 msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'}) 359 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 360 end 361 else 362 GeometryCalib=[]; 363 index=1; 364 end 235 365 236 366 %% open the GUI browse_data … … 265 395 %------------------------------------------------------------------------ 266 396 % --- activate calibration and store parameters in ouputfile . 267 function [GeometryCalib,index]=calibrate(handles,hhuvmat) 268 %------------------------------------------------------------------------ 269 set(handles.CheckEnableMouse,'Value',0)% desactivate mouse (to avoid spurious creation of new points) 270 %% read the current calibration points 397 function [GeometryCalib,index,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic) 398 %------------------------------------------------------------------------ 399 271 400 index=[]; 272 Coord=get(handles.ListCoord,'Data'); 273 Coord(:,6)=[]; 401 274 402 % apply the calibration, whose type is selected in handles.calib_type 275 GeometryCalib=[];276 403 if ~isempty(Coord) 277 calib_cell=get(handles.calib_type,'String'); 278 val=get(handles.calib_type,'Value'); 279 GeometryCalib=feval(['calib_' calib_cell{val}],Coord,handles); 404 GeometryCalib=feval(CalibFcn,Coord,Intrinsic); 280 405 else 406 GeometryCalib=[]; 281 407 msgbox_uvmat('ERROR','No calibration points, abort') 282 408 end … … 306 432 end 307 433 end 308 %set the coordinate unit309 unitlist=get(handles.CoordUnit,'String');310 unit=unitlist{get(handles.CoordUnit,'value')};311 GeometryCalib.CoordUnit=unit;312 %record the points313 GeometryCalib.SourceCalib.PointCoord=Coord;314 display_intrinsic(GeometryCalib,handles)%display calibration intrinsic parameters315 316 % Display extrinsinc parameters (rotation and translation of camera with respect to the phys coordiantes)317 set(handles.Tx,'String',num2str(GeometryCalib.Tx_Ty_Tz(1),4))318 set(handles.Ty,'String',num2str(GeometryCalib.Tx_Ty_Tz(2),4))319 set(handles.Tz,'String',num2str(GeometryCalib.Tx_Ty_Tz(3),4))320 set(handles.Phi,'String',num2str(GeometryCalib.omc(1),4))321 set(handles.Theta,'String',num2str(GeometryCalib.omc(2),4))322 set(handles.Psi,'String',num2str(GeometryCalib.omc(3),4))323 324 %% store the calibration data, by default in the xml file of the currently displayed image325 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';...326 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];...327 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']});328 if strcmp(answer,'Yes') %store the calibration data329 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration330 msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'})331 GeometryCalib.SliceCoord=Z_plane'*[0 0 1];332 end333 334 else335 GeometryCalib=[];336 index=1;337 end338 434 339 435 340 436 %------------------------------------------------------------------------ 341 437 % --- determine the parameters for a calibration by an affine function (rescaling and offset, no rotation) 342 function GeometryCalib=calib_rescale(Coord, handles)438 function GeometryCalib=calib_rescale(Coord,Intrinsic) 343 439 %------------------------------------------------------------------------ 344 440 X=Coord(:,1); … … 358 454 %------------------------------------------------------------------------ 359 455 % --- determine the parameters for a calibration by a linear transform matrix (rescale and rotation) 360 function GeometryCalib=calib_linear(Coord, handles)456 function GeometryCalib=calib_linear(Coord,Intrinsic) 361 457 %------------------------------------------------------------------------ 362 458 X=Coord(:,1); … … 388 484 % --- determine the tsai parameters for a view normal to the grid plane 389 485 % NOT USED 390 function GeometryCalib=calib_normal(Coord, handles)486 function GeometryCalib=calib_normal(Coord,Intrinsic) 391 487 %------------------------------------------------------------------------ 392 488 Calib.f1=str2num(get(handles.fx,'String')); … … 451 547 452 548 %------------------------------------------------------------------------ 453 function GeometryCalib=calib_3D_linear(Coord,handles) 454 %------------------------------------------------------------------------ 455 path_uvmat=which('uvmat');% check the path detected for source file uvmat 456 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 457 huvmat=findobj(allchild(0),'Tag','uvmat'); 458 hhuvmat=guidata(huvmat); 459 coord_files=get(handles.ListCoordFiles,'String'); 460 if ischar(coord_files) 549 function GeometryCalib=calib_3D_linear(Coord,Intrinsic) 550 %------------------------------------------------------------------------ 551 coord_files=Intrinsic.coord_files; 552 if ischar(Intrinsic.coord_files) 461 553 coord_files={coord_files}; 462 554 end … … 466 558 %retrieve the calibration points stored in the files listed in the popup list ListCoordFiles 467 559 x_1=Coord(:,4:5)';%px coordinates of the ref points 468 if ~strcmp(get(hhuvmat.Scalar,'Visible'),'on') 469 msgbox_uvmat('ERROR','An image needs to be opened in uvmat for calibration') 470 return 471 end 472 nx=str2num(get(hhuvmat.num_Npx,'String')); 473 ny=str2num(get(hhuvmat.num_Npy,'String')); 560 561 nx=Intrinsic.Npx; 562 ny=Intrinsic.Npy; 474 563 x_1(2,:)=ny-x_1(2,:);%reverse the y image coordinates 475 564 X_1=Coord(:,1:3)';%phys coordinates of the ref points … … 1221 1310 set(handles.kc,'String',num2str(kc,'%1.4f')) 1222 1311 1223 1224 % --- Executes when user attempts to close geometry_calib. 1312 %------------------------------------------------------------------------ 1313 % ---display calibration extrinsic parameters 1314 function display_extrinsic(GeometryCalib,handles) 1315 %------------------------------------------------------------------------ 1316 set(handles.Tx,'String',num2str(GeometryCalib.Tx_Ty_Tz(1),4)) 1317 set(handles.Ty,'String',num2str(GeometryCalib.Tx_Ty_Tz(2),4)) 1318 set(handles.Tz,'String',num2str(GeometryCalib.Tx_Ty_Tz(3),4)) 1319 set(handles.Phi,'String',num2str(GeometryCalib.omc(1),4)) 1320 set(handles.Theta,'String',num2str(GeometryCalib.omc(2),4)) 1321 set(handles.Psi,'String',num2str(GeometryCalib.omc(3),4)) 1322 1323 %------------------------------------------------------------------------ 1324 % --- executes when user attempts to close geometry_calib. 1225 1325 function geometry_calib_CloseRequestFcn(hObject, eventdata, handles) 1226 1326 %------------------------------------------------------------------------ 1227 1327 delete(hObject); % closes the figure 1228 1328 1229 1329 %------------------------------------------------------------------------ 1230 % --- Executes on button press in PLOT.1330 % --- executes on button press in PLOT. 1231 1331 %------------------------------------------------------------------------ 1232 1332 function PLOT_Callback(hObject, eventdata, handles) -
trunk/src/nc2struct.m
r977 r1001 1 1 2 %'nc2struct': transform a NetCDF file in a corresponding matlab structure 2 3 % it reads all the global attributes and all variables, or a selected list. -
trunk/src/plot_field.m
r977 r1001 696 696 vec_U=Data.(Data.ListVarName{CellInfo{icell}.VarIndex_vector_x}); 697 697 vec_V=Data.(Data.ListVarName{CellInfo{icell}.VarIndex_vector_y}); 698 XName=Data.ListVarName{CellInfo{icell}.CoordIndex(end)}; 699 YName=Data.ListVarName{CellInfo{icell}.CoordIndex(end-1)}; 698 700 if strcmp(CellInfo{icell}.CoordType,'scattered')%2D field with unstructured coordinates 699 XName=Data.ListVarName{CellInfo{icell}.CoordIndex(end)};700 YName=Data.ListVarName{CellInfo{icell}.CoordIndex(end-1)};701 701 vec_X=reshape(Data.(XName),[],1); %transform vectors in column matlab vectors 702 702 vec_Y=reshape(Data.(YName),[],1); 703 703 elseif strcmp(CellInfo{icell}.CoordType,'grid')%2D field with structured coordinates 704 y=Data.( Data.ListVarName{CellInfo{icell}.CoordIndex(end-1)});705 x=Data.( Data.ListVarName{CellInfo{icell}.CoordIndex(end)});704 y=Data.(YName); 705 x=Data.(XName); 706 706 if numel(y)==2 % y defined by first and last values on aregular mesh 707 707 y=linspace(y(1),y(2),size(vec_U,1)); … … 744 744 XName=Data.ListVarName{ivar_X}; 745 745 YName=Data.ListVarName{ivar_Y}; 746 eval(['Coord_x=reshape(Data.' XName ',1,[]);'])747 eval(['Coord_y=reshape(Data.' YName ',1,[]);'])746 Coord_x=reshape(Data.(XName),1,[]); 747 Coord_y=reshape(Data.(YName),1,[]); 748 748 [A,Coord_x,Coord_y]=proj_grid(Coord_x',Coord_y',A',[],[],'np>256'); % interpolate on a grid 749 749 if isfield(Data,'VarAttribute') … … 757 757 elseif strcmp(CellInfo{icell}.CoordType,'grid')%2D field with structured coordinates 758 758 YName=Data.ListVarName{CellInfo{icell}.CoordIndex(end-1)}; 759 XName=Data.ListVarName{CellInfo{icell}.CoordIndex(end)}; 759 760 Coord_y=Data.(YName); 760 Coord_x=Data.( Data.ListVarName{CellInfo{icell}.CoordIndex(end)});761 Coord_x=Data.(XName); 761 762 test_interp_X=0; %default, regularly meshed X coordinate 762 763 test_interp_Y=0; %default, regularly meshed Y coordinate … … 774 775 DCoord_y_max=max(DCoord_y); 775 776 if sign(DCoord_y_min)~=sign(DCoord_y_max);% =1 for increasing values, 0 otherwise 776 errormsg=['errror in plot_field.m: non monotonic dimension variable ' Data.ListVarName{VarRole.coord(1)}];777 errormsg=['errror in plot_field.m: non monotonic dimension variable ' YName ]; 777 778 return 778 779 end -
trunk/src/read_field.m
r980 r1001 152 152 [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,'TimeVarName',ParamIn.TimeVarName,num,[ParamIn.Coord_x ParamIn.Coord_y ParamIn.Coord_z ListVar]); 153 153 if numel(num)~=1 154 NbCoord=NbCoord+1;% adds time coordinate, except if q single time hqs been selected154 NbCoord=NbCoord+1;% adds time coordinate, except if a single time has been selected 155 155 end 156 156 else … … 160 160 return 161 161 end 162 %scan all the variables beyond the two first ones, ParamIn.Coord_x and ParamIn.Coord_y. 162 CheckStructured=1; 163 %scan all the variables beyond the two first NbCoord ones describing the coordinates. 163 164 for ilist=NbCoord+1:numel(Field.VarDimName) 164 165 if isequal(Field.VarDimName{1},Field.VarDimName{ilist}) % if a variable has the same dimension as the coordinate, it denotes a field with unstructured coordinates … … 168 169 Field.VarAttribute{3}.Role='coord_z'; 169 170 end 171 CheckUnstructured=0; 170 172 break 171 173 end 172 174 end 175 if CheckStructured 176 for ilist=NbCoord+1:numel(Field.VarDimName) 177 rank(1)=find(strcmp(ParamIn.Coord_x,Field.VarDimName{ilist})); 178 rank(2)=find(strcmp(ParamIn.Coord_y,Field.VarDimName{ilist})); 179 if NbCoord==3 180 rank(3)=find(strcmp(ParamIn.Coord_z,Field.VarDimName{ilist})); 181 end 182 rank=flip(rank); 183 VarName=Field.ListVarName{ilist}; 184 Field.(VarName)=permute(Field.(VarName),rank); 185 Field.VarDimName{ilist}=Field.VarDimName{ilist}(rank);% permute the order of dimensions 186 end 187 end 173 188 NormName=''; 174 189 UName=''; … … 225 240 Field.VarAttribute=[cell(1,numel(Field.ListDimName)) Field.VarAttribute]; 226 241 end 242 227 243 end 228 244 case 'video' -
trunk/src/series.m
r998 r1001 1 2 3 1 4 %'series': master function associated to the GUI series.m for analysis field series 2 5 %------------------------------------------------------------------------ … … 185 188 TransformPathList=cell(NbBuiltinTransform,1); % initiate the cell matrix of Action fct paths 186 189 TransformPathList(:)={path_transform_fct}; % set the default path to series fcts to all list members 190 SeriesData.TransformPath=path_transform_fct;% store the standard path for trqnsform functions (needed for compilation) 187 191 188 192 %% get the user defined functions stored in the personal file uvmat_perso.mat … … 1526 1530 if strcmp(ActionExt,'.sh') 1527 1531 TransformPath=''; 1528 if ~isempty(get(handles.ActionExt,'UserData')) 1529 TransformPath=get(handles.ActionExt,'UserData'); 1532 if isfield(SeriesData,'TransformPath') 1533 TransformPath=SeriesData.TransformPath; 1534 if isfield(SeriesData,'TransformList') 1535 TransformList=get(handles.TransformName,'String'); 1536 TransformIndex=get(handles.TransformName,'Value'); 1537 TransformName=TransformList{TransformIndex}; 1538 if ~ismember(TransformName,SeriesData.TransformList) 1539 TransformPath=''; 1540 end 1541 end 1542 end 1543 if ~isempty(TransformPath)&&... 1544 ~strcmp(TransformPath,get(handles.TransformPath,'String'))% if the transform is not in paths set for compilation 1545 msgbox_uvmat('ERROR', 'compilation not available for this transform function, select .m') 1546 return 1530 1547 end 1531 1548 set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch' … … 2552 2569 FieldTransformVisible='off'; %hidden by default 2553 2570 if isfield(ParamOut,'FieldTransform') 2554 FieldTransformVisible=ParamOut.FieldTransform; 2571 if ~strcmp(ParamOut.FieldTransform,'off') 2572 FieldTransformVisible='on'; 2573 end 2574 if iscell(ParamOut.FieldTransform) 2575 SeriesData.TransformList=ParamOut.FieldTransform; 2576 end 2555 2577 TransformName_Callback([],[], handles) 2556 2578 end 2557 2579 set(handles.FieldTransform,'Visible',FieldTransformVisible) 2558 if isfield(ParamOut,'TransformPath') 2559 set(handles. ActionExt,'UserData',ParamOut.TransformPath)2580 if isfield(ParamOut,'TransformPath');% record the path of transform function requested for compilation 2581 set(handles.TransformPath,'UserData',ParamOut.TransformPath) 2560 2582 else 2561 set(handles. ActionExt,'UserData',[])2583 set(handles.TransformPath,'UserData',[]) 2562 2584 end 2563 2585 -
trunk/src/series/time_series.m
r984 r1001 67 67 ParamOut.VelType='two';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 68 68 ParamOut.FieldName='two';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) 69 ParamOut.FieldTransform = 'on';%can use a transform function 70 ParamOut.TransformPath=fullfile(fileparts(which('uvmat')),'transform_field');% path to transform functions (needed for compilation only) 69 ParamOut.FieldTransform = {'phys','phys_polar'};%can use a transform function, proposed list (needed for compilation) 70 ParamOut.TransformPath=fullfile(fileparts(which('uvmat')),'transform_field');% path to transform functions (needed for compilation only) 71 if 1==2 % loop used to enforce compilation of transform fct, never entered. 72 phys 73 phys_polar 74 end 71 75 ParamOut.ProjObject='on';%can use projection object(option 'off'/'on', 72 76 ParamOut.Mask='off';%can use mask option (option 'off'/'on', 'off' by default) … … 217 221 transform_fct=[];%default 218 222 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 219 addpath(Param.FieldTransform.TransformPath)223 %addpath(Param.FieldTransform.TransformPath) 220 224 transform_fct=str2func(Param.FieldTransform.TransformName); 221 rmpath(Param.FieldTransform.TransformPath)225 %rmpath(Param.FieldTransform.TransformPath) 222 226 if isfield(Param,'TransformInput') 223 227 XmlData{1}.TransformInput=Param.TransformInput; -
trunk/src/set_object.m
r987 r1001 380 380 % set default values read in the plot of uvmat to initiate the mesh 381 381 if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') 382 huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle 382 huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle 383 if ~isempty(huvmat) 383 384 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface 384 if isempty(str2num(get(handles.num_DX,'String')))||isempty(str2num(get(handles.num_DY,'String'))); 385 % Field=UvData.Field; 386 if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh) 387 set(handles.num_DX,'String',num2str(UvData.Field.CoordMesh)) 388 set(handles.num_DY,'String',num2str(UvData.Field.CoordMesh)) 389 set(handles.num_RangeX_1,'String',num2str(UvData.Field.XMin)) 390 set(handles.num_RangeX_2,'String',num2str(UvData.Field.XMax)) 391 set(handles.num_RangeY_1,'String',num2str(UvData.Field.YMin)) 392 set(handles.num_RangeY_2,'String',num2str(UvData.Field.YMax)) 393 end 394 if isempty(get(handles.CoordUnit,'String'))&& isfield(UvData.Field,'CoordUnit') 395 set(handles.CoordUnit,'String',UvData.Field.CoordUnit) 396 end 385 if isempty(str2num(get(handles.num_DX,'String')))||isempty(str2num(get(handles.num_DY,'String'))); 386 % Field=UvData.Field; 387 if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh) 388 set(handles.num_DX,'String',num2str(UvData.Field.CoordMesh)) 389 set(handles.num_DY,'String',num2str(UvData.Field.CoordMesh)) 390 set(handles.num_RangeX_1,'String',num2str(UvData.Field.XMin)) 391 set(handles.num_RangeX_2,'String',num2str(UvData.Field.XMax)) 392 set(handles.num_RangeY_1,'String',num2str(UvData.Field.YMin)) 393 set(handles.num_RangeY_2,'String',num2str(UvData.Field.YMax)) 394 end 395 if isempty(get(handles.CoordUnit,'String'))&& isfield(UvData.Field,'CoordUnit') 396 set(handles.CoordUnit,'String',UvData.Field.CoordUnit) 397 end 398 end 397 399 end 398 400 if isempty(str2num(get(handles.num_RangeInterp,'String'))) && isfield(UvData,'Field') 399 set(handles.num_RangeInterp,'String',num2str(3*UvData.Field.CoordMesh))% default interpolationlength= 3 meshes401 set(handles.num_RangeInterp,'String',num2str(3*UvData.Field.CoordMesh))% default interpolationlength= 3 meshes 400 402 end 401 403 end -
trunk/src/uvmat.m
r998 r1001 422 422 %% reset position and scale of axis 423 423 pos(1)=0.2*size_fig(3)+35; 424 pos(2)= 35;424 pos(2)=50; 425 425 pos(3)=0.77*size_fig(3)-1.2*ColumnWidth; 426 pos(4)=size_fig(4)- 60;426 pos(4)=size_fig(4)-100; 427 427 set(handles.PlotAxes,'Units','pixels') 428 428 set(handles.PlotAxes,'Position',pos)
Note: See TracChangeset
for help on using the changeset viewer.