[11] | 1 | %'mouse_down': function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn' |
---|
| 2 | %-------------------------------------------------------------- |
---|
| 3 | % xy=mouse_down(hObject,eventdata) |
---|
| 4 | % activated by the command: |
---|
| 5 | % set(hObject,'WindowButtonDownFcn',{'mouse_down'}), |
---|
| 6 | % where hObject is the handle of the figure |
---|
| 7 | % |
---|
| 8 | %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
---|
| 9 | % Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org. |
---|
| 10 | %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
---|
| 11 | % This file is part of the toolbox UVMAT. |
---|
| 12 | % |
---|
| 13 | % UVMAT is free software; you can redistribute it and/or modify |
---|
| 14 | % it under the terms of the GNU General Public License as published by |
---|
| 15 | % the Free Software Foundation; either version 2 of the License, or |
---|
| 16 | % (at your option) any later version. |
---|
| 17 | % |
---|
| 18 | % UVMAT is distributed in the hope that it will be useful, |
---|
| 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 21 | % GNU General Public License (file UVMAT/COPYING.txt) for more details. |
---|
| 22 | %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
---|
| 23 | |
---|
| 24 | function xy=mouse_down(hObject,eventdata) |
---|
[67] | 25 | |
---|
[11] | 26 | MouseAction='none'; %default |
---|
[71] | 27 | huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls theoption of mouse action |
---|
[60] | 28 | if isempty(huvmat) |
---|
| 29 | return |
---|
[11] | 30 | end |
---|
[60] | 31 | hhuvmat=guidata(huvmat);%handles of elements in uvmat |
---|
[87] | 32 | guihandles=guidata(hObject); |
---|
[60] | 33 | UvData=get(huvmat,'UserData'); |
---|
[67] | 34 | MouseAction='none'; %default |
---|
[87] | 35 | testzoom=get(guihandles.zoom,'Value');% get the mouse action from the uvmat GUI: options: |
---|
[60] | 36 | if isfield(UvData,'MouseAction') |
---|
| 37 | MouseAction=UvData.MouseAction;% get the mouse action from the uvmat GUI: options: |
---|
| 38 | end |
---|
| 39 | |
---|
[11] | 40 | test_create=~testzoom && (isequal(MouseAction,'create_object') || isequal(MouseAction,'create_mask')); |
---|
| 41 | %test_cal=get(handles.cal,'Value'); |
---|
[65] | 42 | test_cal=strcmp(MouseAction,'calib'); |
---|
| 43 | test_ruler=strcmp(MouseAction,'ruler'); |
---|
| 44 | test_edit=strcmp(MouseAction,'edit_object'); |
---|
| 45 | test_edit_vect=strcmp(MouseAction,'edit_vect'); |
---|
[11] | 46 | xdisplay=[];%default |
---|
| 47 | ydisplay=[];%default |
---|
| 48 | AxeData=[];%default |
---|
| 49 | |
---|
| 50 | %edit an existing point or line if found |
---|
| 51 | hcurrentobject=gco;% current object handle (selected by the mouse) |
---|
[71] | 52 | hcurrentfig=hObject;% current figure handle |
---|
[62] | 53 | fig_tag=get(hcurrentfig,'Tag'); |
---|
[11] | 54 | tag_obj=get(gco,'Tag'); |
---|
| 55 | xy=[];%default |
---|
| 56 | xy_fig=get(hcurrentfig,'CurrentPoint');% current point of the current figure (gcbo) |
---|
| 57 | hchild=get(hcurrentfig,'Children');%handles of all objects in the current figure |
---|
[67] | 58 | haxes=[]; |
---|
[11] | 59 | % loop on all the objects in the current figure (selected by the last mouse click) |
---|
| 60 | for ichild=1:length(hchild) |
---|
| 61 | obj_pos=get(hchild(ichild),'Position');%position of the object |
---|
| 62 | if xy_fig(1) >=obj_pos(1) & xy_fig(2) >= obj_pos(2)& xy_fig(1) <=obj_pos(1)+obj_pos(3) & xy_fig(2) <= obj_pos(2)+obj_pos(4); |
---|
| 63 | htype=get(hchild(ichild),'Type');%type of object child of the current figure |
---|
| 64 | %if the mouse is over an axis, look at the data |
---|
| 65 | if isequal(htype,'axes') |
---|
[78] | 66 | y_lim=get(hchild(ichild),'YLim'); |
---|
| 67 | x_lim=get(hchild(ichild),'XLim'); |
---|
[11] | 68 | haxes=hchild(ichild); |
---|
| 69 | xy=get(haxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates |
---|
[78] | 70 | if xy(1,1)>x_lim(1) && xy(1,1)<x_lim(2) && xy(1,2)>y_lim(1) && xy(1,2)<y_lim(2) |
---|
| 71 | AxeData=get(haxes,'UserData');% data attached to the axis |
---|
| 72 | AxeData.CurrentOrigin=[xy(1,1) xy(1,2)];% The current point set by the mouse becomes the current origin |
---|
| 73 | if ~isequal(tag_obj,'proj_object') & ~test_create |
---|
| 74 | x_mouse=xy(1,1);%default |
---|
| 75 | y_mouse=xy(1,2);%default |
---|
| 76 | u_mouse=[]; |
---|
| 77 | v_mouse=[]; |
---|
| 78 | w_mouse=[]; |
---|
| 79 | A_mouse=[]; |
---|
| 80 | c_text=[]; |
---|
| 81 | f_text=[]; |
---|
| 82 | ff_text=[]; |
---|
| 83 | ivec=[]; |
---|
| 84 | if isfield(AxeData,'X') & isfield(AxeData,'Y') & isfield(AxeData,'Mesh')% test on the existence of a vector field in the current axis |
---|
| 85 | flag_vec=(AxeData.X<(xy(1,1)+AxeData.Mesh/4) & AxeData.X>(xy(1,1)-AxeData.Mesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse |
---|
| 86 | (AxeData.Y<(xy(1,2)+AxeData.Mesh/4) & AxeData.Y>(xy(1,2)-AxeData.Mesh/4));%f |
---|
| 87 | ivec=find(flag_vec,1);% search the (first) selected vector index ivec |
---|
| 88 | end |
---|
[11] | 89 | end |
---|
[78] | 90 | else |
---|
| 91 | haxes=[];%mouse out of axes |
---|
[11] | 92 | end |
---|
| 93 | end |
---|
| 94 | end |
---|
| 95 | end |
---|
| 96 | test2D=0; |
---|
| 97 | if isfield(AxeData,'NbDim') |
---|
| 98 | if isequal(AxeData.NbDim,2) |
---|
| 99 | test2D=1; |
---|
| 100 | end |
---|
| 101 | end |
---|
| 102 | if ~test2D %desable object creation and vector editing if NbDim different from 2 |
---|
| 103 | test_create=0; |
---|
| 104 | test_edit_vect=0; |
---|
| 105 | end |
---|
| 106 | %delete the current zoom rectangle |
---|
| 107 | if isfield(AxeData,'CurrentRectZoom') & ishandle(AxeData.CurrentRectZoom) |
---|
| 108 | delete(AxeData.CurrentRectZoom) |
---|
| 109 | AxeData.CurrentRectZoom=[]; |
---|
| 110 | end |
---|
| 111 | |
---|
[71] | 112 | % zoom has first priority |
---|
[11] | 113 | if testzoom %&& ~test_create && ~test_edit && ~test_edit_vect && exist('xy','var') |
---|
| 114 | AxeData.Drawing='zoom'; %initiate drawing mode |
---|
| 115 | AxeData.CurrentObject=[];%unselect objects |
---|
[71] | 116 | set(haxes,'UserData',AxeData); |
---|
[67] | 117 | return |
---|
| 118 | end |
---|
| 119 | if isempty(huvmat) |
---|
| 120 | return |
---|
| 121 | end |
---|
| 122 | |
---|
[71] | 123 | %ruler has second priority |
---|
| 124 | if test_ruler |
---|
| 125 | UvData.RulerCoord(1,1)=xy(1,1); |
---|
| 126 | UvData.RulerCoord(1,2)=xy(1,2); |
---|
| 127 | UvData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','ruler'); |
---|
| 128 | set(huvmat,'UserData',UvData) |
---|
| 129 | AxeData.Drawing='ruler'; |
---|
| 130 | set(haxes,'UserData',AxeData); |
---|
| 131 | return |
---|
| 132 | end |
---|
| 133 | |
---|
[67] | 134 | %selection of an existing projection object |
---|
| 135 | if test_edit && (isequal(tag_obj,'proj_object')||isequal(tag_obj,'DeformPoint')) |
---|
| 136 | if ~(isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'create')) |
---|
| 137 | userdata=get(hcurrentobject,'UserData'); |
---|
| 138 | if ishandle(userdata)%the selected line depends on a parent line |
---|
| 139 | AxeData.CurrentObject=userdata;% the parent object becomes the current one |
---|
| 140 | else |
---|
| 141 | AxeData.CurrentObject=hcurrentobject;% the selected object becomes the current one |
---|
| 142 | end |
---|
| 143 | ObjectData=get(AxeData.CurrentObject,'UserData'); |
---|
| 144 | if test_edit & isfield(ObjectData,'IndexObj') |
---|
| 145 | hother=findobj('Tag','proj_object','Type','line');%find all the proj objects |
---|
| 146 | set(hother,'Color','b');%reset all the proj objects in 'blue' by default |
---|
| 147 | set(hother,'Selected','off') |
---|
| 148 | hother=findobj('Tag','proj_object','Type','rectangle'); |
---|
| 149 | set(hother,'EdgeColor','b'); |
---|
| 150 | set(hother,'Selected','off'); |
---|
| 151 | hother=findobj('Tag','proj_object','Type','image'); |
---|
| 152 | for iobj=1:length(hother) |
---|
| 153 | Acolor=get(hother(iobj),'CData'); |
---|
| 154 | Acolor(:,:,1)=zeros(size(Acolor,1),size(Acolor,2)); |
---|
| 155 | set(hother(iobj),'CData',Acolor); |
---|
[11] | 156 | end |
---|
[67] | 157 | hother=findobj('Tag','DeformPoint'); |
---|
| 158 | set(hother,'Color','b'); |
---|
| 159 | set(hother,'Selected','off') |
---|
| 160 | if isequal(get(AxeData.CurrentObject,'Type'),'line') |
---|
| 161 | set(AxeData.CurrentObject,'Color','m'); %set the selected object to magenta color |
---|
| 162 | elseif isequal(get(AxeData.CurrentObject,'Type'),'rectangle') |
---|
| 163 | set(AxeData.CurrentObject,'EdgeColor','m'); %set the selected object to magenta color |
---|
| 164 | end |
---|
| 165 | if isfield(ObjectData,'SubObject')& ishandle(ObjectData.SubObject) |
---|
| 166 | for iobj=1:length(ObjectData.SubObject) |
---|
| 167 | hsub=ObjectData.SubObject(iobj); |
---|
| 168 | if isequal(get(hsub,'Type'),'rectangle') |
---|
| 169 | set(hsub,'EdgeColor','m'); %set the selected object to magenta color |
---|
| 170 | elseif isequal(get(hsub,'Type'),'image') |
---|
| 171 | Acolor=get(hsub,'CData'); |
---|
| 172 | Acolor(:,:,1)=Acolor(:,:,3); |
---|
| 173 | set(hsub,'CData',Acolor); |
---|
| 174 | else |
---|
| 175 | set(hsub,'Color','m') |
---|
[11] | 176 | end |
---|
| 177 | end |
---|
[67] | 178 | end |
---|
| 179 | if isequal(tag_obj,'DeformPoint') |
---|
| 180 | set(hcurrentobject,'Color','m'); %set the selected DeformPoint to magenta color |
---|
| 181 | end |
---|
| 182 | IndexObj=ObjectData.IndexObj; |
---|
[71] | 183 | %indicate on the list of the GUI uvmat which object has been selected |
---|
| 184 | if strcmp(get(hcurrentfig,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field |
---|
| 185 | set(hhuvmat.list_object_2,'Value',IndexObj); |
---|
| 186 | else |
---|
| 187 | set(hhuvmat.list_object_1,'Value',IndexObj); |
---|
| 188 | end |
---|
[67] | 189 | testdeform=0; |
---|
| 190 | set(gcbo,'Pointer','circle'); |
---|
| 191 | AxeData.Drawing='deform'; |
---|
| 192 | if isequal(tag_obj,'DeformPoint') |
---|
| 193 | if isfield(ObjectData,'DeformPoint') |
---|
| 194 | set(hcurrentobject,'Selected','on') |
---|
| 195 | for ipt=1:length(ObjectData.DeformPoint) |
---|
| 196 | if isequal(ObjectData.DeformPoint(ipt),hcurrentobject) |
---|
| 197 | AxeData.CurrentIndex=ipt; |
---|
| 198 | testdeform=1; |
---|
[11] | 199 | end |
---|
| 200 | end |
---|
[67] | 201 | end |
---|
[11] | 202 | end |
---|
[67] | 203 | if testdeform==0 |
---|
| 204 | AxeData.Drawing='translate'; |
---|
| 205 | set(AxeData.CurrentObject,'Selected','on') |
---|
| 206 | set(gcbo,'Pointer','fleur'); |
---|
| 207 | end |
---|
[11] | 208 | end |
---|
| 209 | end |
---|
[67] | 210 | end |
---|
| 211 | % create new projection object |
---|
| 212 | if test_create && ~isempty(xy) && ~(isfield(AxeData,'Drawing')&& isequal(AxeData.Drawing,'create')) |
---|
| 213 | ObjectData=read_set_object(UvData.sethandles); |
---|
| 214 | ObjectData.Coord=[]; %reset previous object coordinates |
---|
| 215 | ObjectData.Coord(1,1)=xy(1,1); |
---|
| 216 | ObjectData.Coord(1,2)=xy(1,2); |
---|
| 217 | ObjectData.Coord(1,3)=0; |
---|
| 218 | if isfield(AxeData,'ObjectCoord') & size(AxeData.ObjectCoord,2)==3 |
---|
| 219 | ObjectData.Coord(1,3)=AxeData.ObjectCoord(1,3); %generaliser au cas avec angle |
---|
[11] | 220 | end |
---|
[67] | 221 | AxeData.CurrentObject=plot_object(ObjectData,[],haxes,'m');%draw the object and its handle becomes AxeData.CurrentObject |
---|
| 222 | if isfield(UvData,'Object') |
---|
| 223 | IndexObj=length(UvData.Object)+1;% add the object as index IndexObj on the list of the interface |
---|
| 224 | else |
---|
| 225 | IndexObj=2; |
---|
| 226 | end |
---|
| 227 | UvData.Object{IndexObj}=ObjectData; |
---|
| 228 | UvData.Object{IndexObj}.HandlesDisplay(1)=AxeData.CurrentObject; |
---|
| 229 | set(huvmat,'UserData',UvData) |
---|
| 230 | list_str=get(hhuvmat.list_object_1,'String'); |
---|
[71] | 231 | list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Style]; |
---|
[67] | 232 | set(hhuvmat.list_object_1,'String',list_str) |
---|
[71] | 233 | list_str{end+1}='...'; |
---|
[67] | 234 | set(hhuvmat.list_object_2,'String',list_str) |
---|
| 235 | if strcmp(fig_tag,'view_field')%we are in view_field plot |
---|
[71] | 236 | set(hhuvmat.list_object_1,'Value',IndexObj)% the projection field will be plotted in uvmat frame |
---|
[67] | 237 | else%we are in uvmat plot |
---|
| 238 | set(hhuvmat.list_object_2,'Value',IndexObj) |
---|
| 239 | end |
---|
| 240 | PlotData=get(AxeData.CurrentObject,'UserData'); |
---|
| 241 | PlotData.IndexObj=IndexObj; |
---|
| 242 | set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph |
---|
| 243 | AxeData.Drawing='create'; |
---|
| 244 | end |
---|
[11] | 245 | |
---|
[67] | 246 | % create calibration points if the GUI geometry_calib is opened, if the main axes axes3 of uvmat has ben selected |
---|
[78] | 247 | if ~testzoom && test_cal && ~isempty(haxes) && strcmp(get(haxes,'tag'),'axes3') |
---|
[67] | 248 | h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI |
---|
| 249 | hh_geometry_calib=guidata(h_geometry_calib); |
---|
| 250 | h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord'); |
---|
| 251 | h_edit_append=hh_geometry_calib.edit_append;%findobj(h_geometry_calib,'Tag','edit_append'); |
---|
[78] | 252 | if isequal(get(h_edit_append,'Value'),1) && ~isempty(haxes) |
---|
[67] | 253 | coord_value=get(hhuvmat.transform_fct,'Value');% set uvmat to pixel coordinates, run it again if not |
---|
| 254 | if ~(isequal(coord_value,1)||isequal(coord_value,3)); %active only with no transform or px (no phys) |
---|
| 255 | set(hhuvmat.transform_fct,'Value',1) |
---|
[71] | 256 | uvmat('transform_fct_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat |
---|
[67] | 257 | set(hhuvmat.FixedLimits,'Value',0)% put FixedLimits option to 'off' |
---|
| 258 | set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7]) |
---|
| 259 | return |
---|
[11] | 260 | end |
---|
[67] | 261 | Coord=get(h_ListCoord,'String'); |
---|
[71] | 262 | data=read_geometry_calib(Coord);%transform char cell to numbers |
---|
[78] | 263 | xlim=get(haxes,'XLim'); |
---|
| 264 | ind_range_x=abs((xlim(2)-xlim(1))/50); |
---|
| 265 | ylim=get(haxes,'YLim'); |
---|
| 266 | ind_range_y=abs((ylim(2)-ylim(1))/50); |
---|
| 267 | ind_range=sqrt(ind_range_x*ind_range_y); |
---|
[67] | 268 | test_newpoint=1; |
---|
| 269 | if size(data.Coord,2)>=5 %if calibration points already exist |
---|
| 270 | XCoord=(data.Coord(:,4)); |
---|
| 271 | YCoord=(data.Coord(:,5)); |
---|
| 272 | index_point=find((XCoord<xy(1,1)+ind_range) & (XCoord>xy(1,1)-ind_range) & ...%flagx=1 for the vectors with x position selected by the mouse |
---|
| 273 | (YCoord<xy(1,2)+ind_range) & (YCoord>xy(1,2)-ind_range),1);%find the first calibration point in the neighborhood of the mouse |
---|
| 274 | test_newpoint=isempty(index_point);%test for no existing calibration point near the mouse position |
---|
| 275 | end |
---|
[78] | 276 | val=get(h_ListCoord,'Value'); |
---|
[67] | 277 | %create a new calib point if we are not close to an existing one |
---|
| 278 | if test_newpoint |
---|
| 279 | strline=[ ' | ' ' | ' ' | ' num2str(xy(1,1),4) ' | ' num2str(xy(1,2),4)]; |
---|
[78] | 280 | |
---|
[67] | 281 | if length(Coord)>=val |
---|
[71] | 282 | Coord(val+1:length(Coord)+1)=Coord(val:length(Coord));% push the list forward beyond the current point |
---|
[67] | 283 | end |
---|
| 284 | Coord{val}=strline; |
---|
| 285 | set(h_ListCoord,'String',Coord) |
---|
[71] | 286 | % set(h_ListCoord,'Value',val+1) |
---|
[67] | 287 | data=read_geometry_calib(Coord);%transform char cell to numbers |
---|
| 288 | XCoord=data.Coord(:,4); |
---|
| 289 | YCoord=data.Coord(:,5); |
---|
| 290 | end |
---|
| 291 | hh=findobj('Tag','calib_points');%look for handle of calibration points |
---|
| 292 | if isempty(hh) |
---|
| 293 | hh=line(XCoord,YCoord,'Color','m','Tag','calib_points','LineStyle','.','Marker','+'); |
---|
[11] | 294 | else |
---|
[67] | 295 | set(hh,'XData',XCoord) |
---|
| 296 | set(hh,'YData',YCoord) |
---|
[11] | 297 | end |
---|
[78] | 298 | set(hh,'UserData',val)% flag the points to edit mode |
---|
[67] | 299 | hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle) |
---|
| 300 | if ~isempty(hhh) |
---|
[71] | 301 | set(hhh,'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range]) |
---|
[67] | 302 | else |
---|
[71] | 303 | rectangle('Curvature',[1 1],... |
---|
| 304 | 'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range],'EdgeColor','m',... |
---|
| 305 | 'LineStyle','-','Tag','calib_marker'); |
---|
| 306 | % line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','calib_marker','LineStyle','.','Marker','o','MarkerSize',ind_range); |
---|
[67] | 307 | end |
---|
[71] | 308 | AxeData.Drawing='calibration'; |
---|
[60] | 309 | end |
---|
[11] | 310 | end |
---|
[67] | 311 | |
---|
| 312 | % edit vectors |
---|
| 313 | if test_edit_vect & ~isempty(ivec) |
---|
| 314 | if ~(isfield(AxeData,'FF')&& ~isempty(AxeData.FF)) |
---|
| 315 | AxeData.FF=zeros(size(AxeData.X)); |
---|
| 316 | end |
---|
| 317 | if isequal(AxeData.FF(ivec),0) |
---|
| 318 | AxeData.FF(ivec)=100; %mark vector #ivec as false |
---|
| 319 | else |
---|
| 320 | AxeData.FF(ivec)=0; |
---|
| 321 | end |
---|
| 322 | PlotParam=read_plot_param(hhuvmat); |
---|
| 323 | [PlotType,ScalOut]= plot_field(AxeData,haxes,PlotParam,1); |
---|
| 324 | end |
---|
| 325 | |
---|
[71] | 326 | |
---|
[11] | 327 | set(haxes,'UserData',AxeData); |
---|
| 328 | |
---|
| 329 | %------------------------------------------------------ |
---|
[35] | 330 | function update_plot(AxeData,haxes) |
---|
[11] | 331 | %-------------------------------------------- |
---|
| 332 | |
---|
| 333 | |
---|
[35] | 334 | % %determine the axes of action of the set_edit interface |
---|
| 335 | % % haxes= findobj(huvmat,'Tag','axes3'); %main plotting axes as default |
---|
| 336 | % % AxeData=get(haxes,'UserData') |
---|
| 337 | % %For vector field representation |
---|
| 338 | % PlotHandles.auto_xy=findobj(huvmat,'Tag','auto_xy'); |
---|
| 339 | % PlotHandles.VecScale=findobj(huvmat,'Tag','VecScale'); |
---|
| 340 | % PlotHandles.AutoVec=findobj(huvmat,'Tag','AutoVec'); |
---|
| 341 | % PlotHandles.checkyellow=findobj(huvmat,'Tag','checkyellow'); |
---|
| 342 | % PlotHandles.checkblack=findobj(huvmat,'Tag','checkblack'); |
---|
| 343 | % PlotHandles.col_vec=findobj(huvmat,'Tag','col_vec'); |
---|
| 344 | % PlotHandles.colcode1=findobj(huvmat,'Tag','colcode1'); |
---|
| 345 | % PlotHandles.colcode2=findobj(huvmat,'Tag','colcode2'); |
---|
| 346 | % PlotHandles.vec_col_bar=findobj(huvmat,'Tag','vec_col_bar'); |
---|
| 347 | % PlotHandles.slider1=findobj(huvmat,'Tag','slider1'); |
---|
| 348 | % PlotHandles.slider2=findobj(huvmat,'Tag','slider2'); |
---|
| 349 | % PlotHandles.max_vec=findobj(huvmat,'Tag','max_vec'); |
---|
| 350 | % PlotHandles.min_vec=findobj(huvmat,'Tag','min_vec'); |
---|
| 351 | % PlotHandles.AutoVecColor=findobj(huvmat,'Tag','AutoVecColor'); |
---|
| 352 | % PlotHandles.decimate4=findobj(huvmat,'Tag','decimate4'); |
---|
| 353 | % |
---|
| 354 | % %vectors |
---|
| 355 | % Vectors.VecScale=str2num(get(PlotHandles.VecScale,'String')); |
---|
| 356 | % Vectors.AutoVec=get(PlotHandles.AutoVec,'Value');%automatic vector length |
---|
| 357 | % Vectors.checkyellow=get(PlotHandles.checkyellow,'Value'); |
---|
| 358 | % Vectors.checkblack=get(PlotHandles.checkblack,'Value'); |
---|
| 359 | % Vectors.decimate4=get(PlotHandles.decimate4,'Value');% =1; for reducing the nbre of vectors |
---|
| 360 | % menu_col=get(PlotHandles.col_vec,'String'); |
---|
| 361 | % menu_val=get(PlotHandles.col_vec,'Value'); |
---|
| 362 | % Vectors.CName=menu_col{menu_val}; %'ima_cor','black','white',... |
---|
| 363 | % Vectors.colcode1=str2num(get(PlotHandles.colcode1,'String'));% first threshold for rgb, first value for'continuous' |
---|
| 364 | % Vectors.colcode2=str2num(get(PlotHandles.colcode2,'String'));% second threshold for rgb, last value (saturation) for 'continuous' |
---|
| 365 | % Vectors.option=get(PlotHandles.vec_col_bar,'Value'); % =1 (64 colors), =0 (3 colors) |
---|
| 366 | % Vectors.min=get(PlotHandles.slider1,'Min'); |
---|
| 367 | % Vectors.max=get(PlotHandles.slider1,'Max'); |
---|
| 368 | % Vectors.auto=get(PlotHandles.AutoVecColor,'Value');% =1; thresholds scaling relative to min and max, =0 fixed thresholds |
---|
| 369 | % PlotParam.Vectors=Vectors; |
---|
| 370 | |
---|