Changeset 748 for trunk/src/uvmat.m
- Timestamp:
- Apr 23, 2014, 4:57:58 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r747 r748 83 83 % velocity vectors. The scalar values in the first case is represented by 84 84 % UvData.Field.A, and by UvData.Field.C in the second case. The corresponding set of X 85 % and Y coordinates are represented by UvData.Field.AX and UvData.Field.AY, and .X and85 % and Y axes are represented by UvData.Field.AX and UvData.Field.AY, and .X and 86 86 % .Y for C (the same as velocity vectors). If A is a nxxny matrix (scalar 87 87 % on a regtular grid), then .AX andf.AY contains only two elements, represneting the 88 % coordinates of the four image corners. The scalar name is represented by88 % axes of the four image corners. The scalar name is represented by 89 89 % the strings .AName and/or .CName. 90 90 % If the scalar exists in an input open (image or scalar stored under its … … 95 95 % Properties attached to plotting figures (standard Matlab properties): 96 96 % 'CurrentAxes'= gca or get(gcf,'CurrentAxes'); 97 % 'CurrentPoint'=get(gcf,'CurrentPoint'): figure coordinates of the point over which the mouse is positioned97 % 'CurrentPoint'=get(gcf,'CurrentPoint'): figure axes of the point over which the mouse is positioned 98 98 % 'CurrentCharacter'=get(gcf,'CurrentCharacter'): last character typed over the figure where the mouse is positioned 99 99 % 'WindowButtonMotionFcn': function permanently called by mouse motion over the figure … … 103 103 104 104 % Properties attached to plotting axes: 105 % 'CurrentPoint'=get(gca,'CurrentPoint'); (standard Matlab) same as for the figure, but position in plot coordinates.105 % 'CurrentPoint'=get(gca,'CurrentPoint'); (standard Matlab) same as for the figure, but position in plot axes. 106 106 % AxeData:=get(gca,'UserData'); 107 107 % AxeData.Drawing = create: create a new object … … 120 120 % ObjectData.Type=...: style of projection object: 121 121 % .ProjMode 122 % .Coord : defines the position of the object122 % .Coordinates: defines the position of the object 123 123 % .XMin,YMin.... 124 124 % .XMax,YMax.... … … 191 191 set(hObject,'Position',[LeftX LowY Width Height]) 192 192 UvData.OpenParam.PosColorbar=[0.80 0.02 0.018 0.445]; 193 % UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib194 193 AxeData.LimEditBox=1; %initialise AxeData 195 194 set(handles.PlotAxes,'UserData',AxeData) … … 396 395 % set(handles.CheckHold,'Position',pos_CheckHold) 397 396 398 %% reset position of Coordinates 397 %% reset position of Coordinates panel 399 398 set(handles.Coordinates,'Units','pixels') 400 399 pos_2=get(handles.Coordinates,'Position');% [lower x lower y width height] for frame 'Coordinates' … … 404 403 set(handles.Coordinates,'Position',pos_2) 405 404 405 %% reset position of Axes panel 406 set(handles.Axes,'Units','pixels') 407 pos_3=get(handles.Axes,'Position');% [lower x lower y width height] for frame 'Coordinates' 408 pos_3(3)=ColumnWidth; 409 pos_3(1)=size_fig(3)-pos_3(3); % set 'Coordinates' to the right of the fig 410 pos_3(2)=pos_2(2)-pos_3(4); % set 'Coordinates' to the lower edge of text display, allowing a margin for CheckHold 411 set(handles.Axes,'Position',pos_3) 412 406 413 %% reset position of Scalar 407 414 set(handles.Scalar,'Units','pixels') 408 pos_ 3=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar'409 pos_ 3(3)=ColumnWidth;410 pos_ 3(1)=size_fig(3)-pos_3(3); % set 'Scalar' to the right of the fig415 pos_4=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar' 416 pos_4(3)=ColumnWidth; 417 pos_4(1)=size_fig(3)-pos_4(3); % set 'Scalar' to the right of the fig 411 418 if strcmp(get(handles.Scalar,'Visible'),'on') 412 pos_ 3(2)=pos_2(2)-pos_3(4); % set 'Scalar' to the lower edge of frame 'Coordinates' if visible413 else 414 pos_ 3(2)=pos_2(2);% set 'Scalar' to the lower edge of frame 'text display' if unvisible415 end 416 set(handles.Scalar,'Position',pos_ 3)419 pos_4(2)=pos_3(2)-pos_4(4); % set 'Scalar' to the lower edge of frame 'Coordinates' if visible 420 else 421 pos_4(2)=pos_3(2);% set 'Scalar' to the lower edge of frame 'text display' if unvisible 422 end 423 set(handles.Scalar,'Position',pos_4) 417 424 418 425 %% reset position of Vectors 419 426 set(handles.Vectors,'Units','pixels') 420 pos_ 4=get(handles.Vectors,'Position');421 pos_ 4(3)=ColumnWidth;422 pos_ 4(1)=size_fig(3)-pos_4(3);427 pos_5=get(handles.Vectors,'Position'); 428 pos_5(3)=ColumnWidth; 429 pos_5(1)=size_fig(3)-pos_5(3); 423 430 if strcmp(get(handles.Vectors,'visible'),'on') 424 pos_ 4(2)=pos_3(2)-pos_4(4);425 else 426 pos_ 4(2)=pos_3(2);427 end 428 set(handles.Vectors,'Position',pos_ 4)431 pos_5(2)=pos_4(2)-pos_5(4); 432 else 433 pos_5(2)=pos_4(2); 434 end 435 set(handles.Vectors,'Position',pos_5) 429 436 430 437 %% reset position and scale of axis … … 2626 2633 break 2627 2634 end 2628 if UvData.Field.NbDim==3 % TO GENERALISE2635 if UvData.Field.NbDim==3 2629 2636 UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects 2637 if ~isfield(UvData.ProjObject{iobj},'RangeZ') 2630 2638 UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane 2631 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 2632 UvData.ProjObject{iobj}.Angle=[0 0 0]; 2639 end 2640 if ~(isfield(UvData.ProjObject{iobj},'Coord') && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin) 2641 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 2642 end 2633 2643 end 2634 2644 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.ProjObject{iobj});% project field on the object … … 2639 2649 PlotParam{imap}.Scalar.CheckBW=[]; %B/W option depends on the input field (image or scalar) 2640 2650 if isfield(ObjectData,'CoordUnit') 2641 PlotParam{imap}. Coordinates.CheckFixAspectRatio=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y)2642 PlotParam{imap}. Coordinates.AspectRatio=1; %set aspect ratio to 12651 PlotParam{imap}.Axes.CheckFixAspectRatio=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y) 2652 PlotParam{imap}.Axes.AspectRatio=1; %set aspect ratio to 1 2643 2653 end 2644 2654 end … … 2706 2716 Ustring=''; 2707 2717 Vstring=''; 2708 % suppress coordinates from the histogram menu2718 % suppress axes from the histogram menu 2709 2719 for ivar=1:numel(menu_histo)%l loop on field variables: 2710 2720 if isfield(UvData.Field,'VarAttribute') && numel(UvData.Field.VarAttribute)>=ivar && isfield(UvData.Field.VarAttribute{ivar},'Role') … … 2748 2758 2749 2759 if UvData.Field.NbDim==3 2760 set(handles.CheckEditObject,'Value',1) 2750 2761 CheckEditObject_Callback(handles.uvmat, [], handles) 2751 2762 end … … 2809 2820 else 2810 2821 nxy=size(FieldHisto); 2811 Amin=double(min(min(min( FieldHisto))));%min of field value2812 Amax=double(max(max(max( FieldHisto))));%max of field value2822 Amin=double(min(min(min(min(FieldHisto)))));%min of field value 2823 Amax=double(max(max(max(max(FieldHisto)))));%max of field value 2813 2824 if isequal(Amin,Amax) 2814 2825 cla(handles.HistoAxes) … … 3110 3121 switch field 3111 3122 case 'get_field...' 3112 %% fill the coordinates and variables from selections in get_field3123 %% fill the axes and variables from selections in get_field 3113 3124 ParamIn=[]; 3114 3125 % in case of civ data, we use the civ choice as default input for the GUI get_field … … 3274 3285 switch field_1 3275 3286 case 'get_field...' 3276 %% fill the coordinates and variables from selections in get_field3287 %% fill the axes and variables from selections in get_field 3277 3288 ParamIn=[]; 3278 3289 % in case of civ data, we use the civ choice as default input for the GUI get_field … … 3867 3878 %------------------------------------------------- 3868 3879 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3869 % Plot coordinates3880 % Plot axes 3870 3881 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3871 3882 %------------------------------------------------------------------------ … … 4303 4314 haxes=findobj(hview_field,'tag','axes3'); 4304 4315 pos=get(hview_field,'Position'); 4305 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam. Coordinates)% case of no plot display (pure text table)4316 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Axes)% case of no plot display (pure text table) 4306 4317 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4307 4318 pos_table=get(h_TableDisplay,'Position'); … … 4480 4491 haxes=findobj(hview_field,'tag','axes3'); 4481 4492 pos=get(hview_field,'Position'); 4482 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam. Coordinates)% case of no plot display (pure text table)4493 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Axes)% case of no plot display (pure text table) 4483 4494 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4484 4495 pos_table=get(h_TableDisplay,'Position'); … … 5232 5243 XmlData.PolarCentre=[x0 y0]; 5233 5244 5234 %% display the current image in polar coordinates with origin at the illumination source5245 %% display the current image in polar axes with origin at the illumination source 5235 5246 currentdir=pwd; 5236 5247 uvmatpath=fileparts(which('uvmat')); … … 5558 5569 %'write_plot_param': update the plotting parameters on the uvmat or view_field interface after a plotting operation 5559 5570 function write_plot_param(handles,PlotParam) 5560 %% coordinates5561 if isempty(PlotParam. Coordinates)5562 set(handles. Coordinates,'Visible','off')5571 %% axes 5572 if isempty(PlotParam.Axes) 5573 set(handles.Axes,'Visible','off') 5563 5574 set(handles.PlotAxes,'Visible','off') 5564 5575 set(handles.text_display,'Visible','off') 5565 5576 set(handles.TableDisplay,'Visible','on') 5566 5577 else 5567 set(handles. Coordinates,'Visible','on')5578 set(handles.Axes,'Visible','on') 5568 5579 set(handles.PlotAxes,'Visible','on') 5569 5580 set(handles.text_display,'Visible','on') … … 5571 5582 set(handles.TableDisplay,'Visible','off') 5572 5583 end 5573 Coordinates=PlotParam. Coordinates;5584 Coordinates=PlotParam.Axes; 5574 5585 if isfield(Coordinates,'CheckFixAspectRatio') 5575 5586 if Coordinates.CheckFixAspectRatio … … 5666 5677 5667 5678 5668 5669 function Coord_z_Callback(hObject, eventdata, handles)5670 % hObject handle to Coord_z(see GCBO)5679 % --- Executes on selection change in SwitchCoordIndex. 5680 function SwitchCoordIndex_Callback(hObject, eventdata, handles) 5681 % hObject handle to SwitchCoordIndex (see GCBO) 5671 5682 % eventdata reserved - to be defined in a future version of MATLAB 5672 5683 % handles structure with handles and user data (see GUIDATA) 5673 5684 5674 % Hints: get(hObject,'String') returns contents of Coord_z as text 5675 % str2double(get(hObject,'String')) returns contents of Coord_z as a double 5676 5677 5678 % --- Executes during object creation, after setting all properties. 5679 function Coord_z_CreateFcn(hObject, eventdata, handles) 5680 % hObject handle to Coord_z (see GCBO) 5681 % eventdata reserved - to be defined in a future version of MATLAB 5682 % handles empty - handles not created until after all CreateFcns called 5683 5684 % Hint: edit controls usually have a white background on Windows. 5685 % See ISPC and COMPUTER. 5686 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 5687 set(hObject,'BackgroundColor','white'); 5688 end 5685 % Hints: contents = cellstr(get(hObject,'String')) returns SwitchCoordIndex contents as cell array 5686 % contents{get(hObject,'Value')} returns selected item from SwitchCoordIndex
Note: See TracChangeset
for help on using the changeset viewer.