Changeset 622 for trunk/src/uvmat.m
- Timestamp:
- Apr 29, 2013, 11:35:27 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r620 r622 34 34 % .PosGeometryCalib: size of set_object 35 35 % .NbBuiltin: nbre of functions always displayed in TransformName menu 36 % . Object: cell array of structures representing the current projection objects, as produced by 'set_object.m'={[]} by default36 % .ProjObject: cell array of structures representing the current projection objects, as produced by 'set_object.m'={[]} by default 37 37 % .NewSeries: =0/1 flag telling whether a new field series has been opened 38 38 % .FileName_1: name of the current second field (used to detect a constant field during file scanning) … … 126 126 % .Phi, .Theta, .Psi : Euler angles 127 127 % .X,.Y,.U,.V.... : field data projected on the object 128 % .IndexObj: index in the list of UvData. Object128 % .IndexObj: index in the list of UvData.ProjObject 129 129 %during plotting 130 130 % .plotaxes: handles of the current axes used to plot the result of field projection on the object … … 214 214 set(handles.FieldName,'Value',1) 215 215 set(handles.FieldName,'string',{''}) 216 UvData. Object={[]};216 UvData.ProjObject={[]}; 217 217 218 218 %% TRANSFORM menu: builtin fcts … … 1809 1809 function movie_pair_Callback(hObject, eventdata, handles) 1810 1810 %------------------------------------------------------------------------ 1811 1811 1812 %% stop movie action if the movie_pair button is off 1812 1813 if ~get(handles.movie_pair,'value') … … 2065 2066 check_proj_tps=0; 2066 2067 if (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx')) 2067 for iobj=1:numel(UvData. Object)2068 if isfield(UvData. Object{iobj},'ProjMode')&& strcmp(UvData.Object{iobj}.ProjMode,'interp_tps')2068 for iobj=1:numel(UvData.ProjObject) 2069 if isfield(UvData.ProjObject{iobj},'ProjMode')&& strcmp(UvData.ProjObject{iobj}.ProjMode,'interp_tps') 2069 2070 check_proj_tps=1; 2070 2071 break … … 2547 2548 end 2548 2549 % default projection plane 2549 if isempty(UvData. Object{1})2550 UvData. Object{1}.Type='plane';%main plotting plane2551 UvData. Object{1}.ProjMode='projection';%main plotting plane2552 UvData. Object{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat2553 UvData. Object{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat2550 if isempty(UvData.ProjObject{1}) 2551 UvData.ProjObject{1}.Type='plane';%main plotting plane 2552 UvData.ProjObject{1}.ProjMode='projection';%main plotting plane 2553 UvData.ProjObject{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat 2554 UvData.ProjObject{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat 2554 2555 end 2555 2556 %% 3D case (menuvolume) … … 2563 2564 end 2564 2565 if test_set_object% reinitiate the GUI set_object 2565 delete_object(1);% delete the current projection object in the list UvData. Object, delete its graphic representations and update the list displayed in handles.ListObject and 22566 UvData. Object{1}.NbDim=NbDim;%test for 3D objects2567 UvData. Object{1}.RangeZ=UvData.Field.CoordMesh;%main plotting plane2568 UvData. Object{1}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen2569 UvData. Object{1}.Angle=[0 0 0];2570 UvData. Object{1}.HandlesDisplay=plot(0,0,'Tag','proj_object');% A REVOIR2571 UvData. Object{1}.Name='1-PLANE';2572 UvData. Object{1}.enable_plot=1;2573 set_object(UvData. Object{1},handles,ZBounds);2566 delete_object(1);% delete the current projection object in the list UvData.ProjObject, delete its graphic representations and update the list displayed in handles.ListObject and 2 2567 UvData.ProjObject{1}.NbDim=NbDim;%test for 3D objects 2568 UvData.ProjObject{1}.RangeZ=UvData.Field.CoordMesh;%main plotting plane 2569 UvData.ProjObject{1}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 2570 UvData.ProjObject{1}.Angle=[0 0 0]; 2571 UvData.ProjObject{1}.HandlesDisplay=plot(0,0,'Tag','proj_object');% A REVOIR 2572 UvData.ProjObject{1}.Name='1-PLANE'; 2573 UvData.ProjObject{1}.enable_plot=1; 2574 set_object(UvData.ProjObject{1},handles,ZBounds); 2574 2575 set(handles.ListObject,'Value',1); 2575 2576 set(handles.ListObject,'String',{'1-PLANE'}); … … 2582 2583 XmlData=UvData.XmlData{1}; 2583 2584 if isfield(XmlData,'PlanePos') 2584 UvData. Object{1}.Coord=XmlData.PlanePos(UvData.ZIndex,:);2585 UvData.ProjObject{1}.Coord=XmlData.PlanePos(UvData.ZIndex,:); 2585 2586 end 2586 2587 if isfield(XmlData,'PlaneAngle') 2587 2588 siz=size(XmlData.PlaneAngle); 2588 2589 indangle=min(siz(1),UvData.ZIndex);%take first angle if a single angle is defined (translating scanning) 2589 UvData. Object{1}.PlaneAngle=XmlData.PlaneAngle(indangle,:);2590 UvData.ProjObject{1}.PlaneAngle=XmlData.PlaneAngle(indangle,:); 2590 2591 end 2591 2592 elseif isfield(UvData,'ZIndex') 2592 UvData. Object{1}.ZObject=UvData.ZIndex;2593 UvData.ProjObject{1}.ZObject=UvData.ZIndex; 2593 2594 end 2594 2595 end … … 2631 2632 set(handles.ListObject,'Value',1) 2632 2633 set(handles.ListObject,'String',{'plane'}) 2633 UvData. Object{1}.Type='plane';%main plotting plane2634 UvData. Object{1}.ProjMode='projection';%main plotting plane2635 UvData. Object{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat2636 UvData. Object{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat2634 UvData.ProjObject{1}.Type='plane';%main plotting plane 2635 UvData.ProjObject{1}.ProjMode='projection';%main plotting plane 2636 UvData.ProjObject{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat 2637 UvData.ProjObject{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat 2637 2638 set(handles.ListObject_1,'Value',1) 2638 2639 set(handles.ListObject_1,'String',{'plane'}) 2639 2640 end 2640 2641 IndexObj(1)=get(handles.ListObject_1,'Value');%selected projection object for main view 2641 if IndexObj(1)> numel(UvData. Object)2642 if IndexObj(1)> numel(UvData.ProjObject) 2642 2643 IndexObj(1)=1;%select the first object if the selected one does not exist 2643 2644 set(handles.ListObject_1,'Value',1) … … 2682 2683 for imap=1:numel(IndexObj) 2683 2684 iobj=IndexObj(imap); 2684 if numel(UvData. Object)<iobj2685 if numel(UvData.ProjObject)<iobj 2685 2686 break 2686 2687 end 2687 [ObjectData,errormsg]=proj_field(UvData.Field,UvData. Object{iobj});% project field on the object2688 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.ProjObject{iobj});% project field on the object 2688 2689 if ~isempty(errormsg) 2689 2690 return … … 2879 2880 end 2880 2881 2881 %------------------------------------------------------------------- 2882 %------------------------------------------------------------------------ 2882 2883 % --- translate coordinate to matrix index 2883 %------------------------------------------------------------------- 2884 %------------------------------------------------------------------------ 2884 2885 function [indx,indy]=pos2ind(x0,rangx0,nxy) 2885 2886 indx=1+round((nxy(2)-1)*(x0-rangx0(1))/(rangx0(2)-rangx0(1)));% index x of pixel 2886 2887 indy=1+round((nxy(1)-1)*(y12-rangy0(1))/(rangy0(2)-rangy0(1)));% index y of pixel 2887 2888 2888 2889 %------------------------------------------------------------------- 2889 %------------------------------------------------------------------------ 2890 2890 % --- Executes on button press in 'CheckZoom'. 2891 %------------------------------------------------------------------- 2891 %------------------------------------------------------------------------ 2892 2892 function CheckZoom_Callback(hObject, eventdata, handles) 2893 2893 2894 if (get(handles.CheckZoom,'Value') == 1); 2895 set(handles.CheckZoom,'BackgroundColor',[1 1 0]) 2894 if get(handles.CheckZoom,'Value') 2896 2895 set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes 2897 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 2898 else 2899 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 2900 end 2901 2902 %------------------------------------------------------------------- 2896 set(handles.CheckZoomFig,'Value',0)%desactivate zoom fig 2897 end 2898 2899 %------------------------------------------------------------------------ 2900 % --- Executes on button press in CheckZoomFig. 2901 %------------------------------------------------------------------------ 2902 function CheckZoomFig_Callback(hObject, eventdata, handles) 2903 2904 if get(handles.CheckZoomFig,'Value') 2905 set(handles.CheckZoom,'value',0) 2906 end 2907 2908 %------------------------------------------------------------------------ 2903 2909 % --- Executes on button press in 'CheckFixLimits'. 2904 %------------------------------------------------------------------- 2910 %------------------------------------------------------------------------ 2905 2911 function CheckFixLimits_Callback(hObject, eventdata, handles) 2906 test=get(handles.CheckFixLimits,'Value'); 2907 if test 2908 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 2909 else 2910 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 2912 2913 if ~get(handles.CheckFixLimits,'Value') 2911 2914 update_plot(handles); 2912 2915 end 2913 2916 2914 %------------------------------------------------------------------- 2917 %------------------------------------------------------------------------ 2915 2918 % --- Executes on button press in CheckFixAspectRatio. 2916 2919 function CheckFixAspectRatio_Callback(hObject, eventdata, handles) 2917 %------------------------------------------------------------------- 2920 %------------------------------------------------------------------------ 2921 2918 2922 if get(handles.CheckFixAspectRatio,'Value') 2919 % set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])2920 2923 update_plot(handles); 2921 2924 else 2922 % set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])2923 2925 update_plot(handles); 2924 2926 end 2925 2927 2926 %------------------------------------------------------------------- 2928 %------------------------------------------------------------------------ 2927 2929 function num_AspectRatio_Callback(hObject, eventdata, handles) 2928 %------------------------------------------------------------------- 2930 %------------------------------------------------------------------------ 2929 2931 set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button 2930 % set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow2931 2932 update_plot(handles); 2932 %------------------------------------------------------------------- 2933 2934 %------------------------------------------------------------------- 2935 2936 2937 2938 %------------------------------------------------------------------- 2933 2934 %------------------------------------------------------------------------ 2939 2935 %----Executes on button press in 'record': records the current flags of manual correction. 2940 %------------------------------------------------------------------- 2936 %------------------------------------------------------------------------ 2941 2937 function record_Callback(hObject, eventdata, handles) 2942 % [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles); 2938 2943 2939 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 2944 2940 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 2945 %FileName=read_file_boxes(handles);2946 2941 [erread,message]=fileattrib(FileName); 2947 2942 if ~isempty(message) && ~isequal(message.UserWrite,1) … … 3233 3228 end 3234 3229 3235 %--------------------------------------------------- 3230 %---------------------------------------------------------------- 3236 3231 % --- Executes on menu selection FieldName 3237 3232 function FieldName_1_Callback(hObject, eventdata, handles) … … 3452 3447 3453 3448 3454 %----------------------------------------------------------------------- 3449 %------------------------------------------------------------------------ 3455 3450 % --- reset civ buttons 3456 3451 function reset_vel_type(handles_civ0,handle1) 3457 %----------------------------------------------------------------------- 3452 %------------------------------------------------------------------------ 3458 3453 for ibutton=1:length(handles_civ0) 3459 3454 set(handles_civ0(ibutton),'BackgroundColor',[0.831 0.816 0.784]) … … 3546 3541 yi=0.5:npy-0.5; 3547 3542 [Xi,Yi]=meshgrid(xi,yi); 3548 if isfield(UvData,' Object')3549 for iobj=1:length(UvData. Object)3550 ObjectData=UvData. Object{iobj};3543 if isfield(UvData,'ProjObject') 3544 for iobj=1:length(UvData.ProjObject) 3545 ObjectData=UvData.ProjObject{iobj}; 3551 3546 if isfield(ObjectData,'ProjMode') &&(isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside')); 3552 3547 flagobj=1; … … 3618 3613 image(imflag); 3619 3614 3620 %------------------------------------------------------------------- 3621 %------------------------------------------------------------------- 3615 %------------------------------------------------------------------------ 3616 %------------------------------------------------------------------------ 3622 3617 % - FUNCTIONS FOR SETTING PLOTTING PARAMETERS 3623 3618 3624 %------------------------------------------------------------------ 3625 %------------------------------------------------------------- 3619 %------------------------------------------------------------------------ 3620 %------------------------------------------------------------------------ 3626 3621 % --- Executes on selection change in TransformName. 3627 3622 3628 3623 function TransformName_Callback(hObject, eventdata, handles) 3629 %------------------------------------------------------------- 3624 %------------------------------------------------------------------------ 3630 3625 UvData=get(handles.uvmat,'UserData'); 3631 3626 menu=get(handles.TransformName,'String');refresh … … 3749 3744 delete(hhh) 3750 3745 end 3751 % if isfield(UvData,'Object')3752 % UvData.Object=UvData.Object(1);3753 % end3754 3746 set(handles.ListObject,'Value',1) 3755 3747 set(handles.ListObject,'String',{''}) … … 3762 3754 set(handles.edit_object,'Value',0) 3763 3755 edit_object_Callback(hObject, eventdata, handles) 3764 UvData. Object={[]};3756 UvData.ProjObject={[]}; 3765 3757 end 3766 3758 set(handles.uvmat,'UserData',UvData) … … 3917 3909 %------------------------------------------------------------------------ 3918 3910 % --- Executes on selection change in CheckDecimate4 (nb_vec/4). 3911 %------------------------------------------------------------------------ 3919 3912 function CheckDecimate4_Callback(hObject, eventdata, handles) 3920 %------------------------------------------------------------------------ 3913 3921 3914 if isequal(get(handles.CheckDecimate4,'Value'),1) 3922 3915 set(handles.CheckDecimate16,'Value',0) … … 3926 3919 %------------------------------------------------------------------------ 3927 3920 % --- Executes on selection change in CheckDecimate16 (nb_vec/16). 3921 %------------------------------------------------------------------------ 3928 3922 function CheckDecimate16_Callback(hObject, eventdata, handles) 3929 %------------------------------------------------------------------------ 3923 3930 3924 if isequal(get(handles.CheckDecimate16,'Value'),1) 3931 3925 set(handles.CheckDecimate4,'Value',0) … … 4132 4126 list_str=get(handles.ListObject,'String'); 4133 4127 UvData=get(handles.uvmat,'UserData'); 4134 ObjectData=UvData. Object{get(handles.ListObject_1,'Value')};4128 ObjectData=UvData.ProjObject{get(handles.ListObject_1,'Value')}; 4135 4129 4136 4130 %% update the projection plot on uvmat … … 4139 4133 %replot all the objects within the new projected field 4140 4134 for IndexObj=1:numel(list_str) 4141 hobject=UvData. Object{IndexObj}.DisplayHandle.uvmat;4135 hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat; 4142 4136 if isempty(hobject) || ~ishandle(hobject) 4143 4137 hobject=handles.PlotAxes; … … 4148 4142 objectcolor='b'; 4149 4143 end 4150 UvData. Object{IndexObj}.DisplayHandle.uvmat=plot_object(UvData.Object{IndexObj},ObjectData,hobject,objectcolor);%draw the object in uvmat4144 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=plot_object(UvData.ProjObject{IndexObj},ObjectData,hobject,objectcolor);%draw the object in uvmat 4151 4145 end 4152 4146 set(handles.uvmat,'UserData',UvData) … … 4177 4171 %% The object is displayed in set_object if this GUI is already opened 4178 4172 UvData=get(handles.uvmat,'UserData'); 4179 ObjectData=UvData. Object{IndexObj};4173 ObjectData=UvData.ProjObject{IndexObj}; 4180 4174 hset_object=findobj(allchild(0),'tag','set_object'); 4181 4175 if ~isempty(hset_object) … … 4219 4213 4220 4214 %% update the color of the graphic object representation: the selected object in magenta, others in blue 4221 update_object_color(handles.PlotAxes,hhview_field.PlotAxes,UvData. Object{IndexObj}.DisplayHandle.uvmat)4215 update_object_color(handles.PlotAxes,hhview_field.PlotAxes,UvData.ProjObject{IndexObj}.DisplayHandle.uvmat) 4222 4216 4223 4217 %------------------------------------------------------------------------ … … 4313 4307 list_object=get(handles.ListObject,'String'); 4314 4308 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4315 UvData. Object{IndexObj}.Name=list_object{IndexObj};4316 if numel(UvData. Object)<IndexObj;% error in UvData4309 UvData.ProjObject{IndexObj}.Name=list_object{IndexObj}; 4310 if numel(UvData.ProjObject)<IndexObj;% error in UvData 4317 4311 msgbox_uvmat('ERROR','invalid object list') 4318 4312 return … … 4324 4318 end 4325 4319 % set(handles.ListObject_1,'Value',IndexObj);%restore ListObject selection after set_object deletion 4326 data=UvData. Object{IndexObj};4320 data=UvData.ProjObject{IndexObj}; 4327 4321 if ~isfield(data,'Type')% default plane 4328 4322 data.Type='plane'; … … 4374 4368 IndexObj=get(handles.ListObject,'Value'); 4375 4369 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4376 if numel(UvData. Object)<IndexObj(end);% error in UvData4370 if numel(UvData.ProjObject)<IndexObj(end);% error in UvData 4377 4371 msgbox_uvmat('ERROR','invalid object list') 4378 4372 return … … 4384 4378 end 4385 4379 set(handles.ListObject,'Value',IndexObj);%restore ListObject selection after set_object deletion 4386 if ~isfield(UvData. Object{IndexObj(1)},'Type')% default plane4387 UvData. Object{IndexObj(1)}.Type='plane';4380 if ~isfield(UvData.ProjObject{IndexObj(1)},'Type')% default plane 4381 UvData.ProjObject{IndexObj(1)}.Type='plane'; 4388 4382 end 4389 4383 list_object=get(handles.ListObject,'String'); 4390 UvData. Object{IndexObj(end)}.Name=list_object{IndexObj(end)};4384 UvData.ProjObject{IndexObj(end)}.Name=list_object{IndexObj(end)}; 4391 4385 4392 4386 %% show the projection of the selected object on view_field 4393 ProjData= proj_field(UvData.Field,UvData. Object{IndexObj});%project the current field on ObjectData4387 ProjData= proj_field(UvData.Field,UvData.ProjObject{IndexObj});%project the current field on ObjectData 4394 4388 hview_field=findobj(allchild(0),'tag','view_field'); 4395 4389 if isempty(hview_field) … … 4425 4419 %------------------------------------------------------------------------ 4426 4420 % --- Executes on button press in delete_object. 4421 %------------------------------------------------------------------------ 4427 4422 function delete_object_Callback(hObject, eventdata, handles) 4428 %------------------------------------------------------------------------ 4423 4429 4424 IndexObj=get(handles.ListObject,'Value');%projection object selected for view_field 4430 4425 IndexObj_1=get(handles.ListObject_1,'Value');%projection object selected for uvmat plot 4431 4426 if IndexObj>1 && ~isequal(IndexObj,IndexObj_1) % do not delete the object used for the uvmat plot 4432 4427 delete_object(IndexObj) 4428 end 4429 4430 %'delete_object': delete a projection object, defined by its index in the Uvmat list or by its graphic handle 4431 %------------------------------------------------------------------------ 4432 % function delete_object(hObject) 4433 % 4434 % INPUT: 4435 % hObject: object index (if integer) or handle of the graphic object. If 4436 % hObject is a subobject, the parent object is detected and deleted. 4437 4438 function delete_object(IndexObj) 4439 4440 huvmat=findobj('tag','uvmat');%handles of the uvmat interface 4441 UvData=get(huvmat,'UserData'); 4442 hlist_object=findobj(huvmat,'Tag','ListObject');%handles of the object list in the uvmat interface 4443 list_str=get(hlist_object,'String');%objet list 4444 % if isequal(floor(hObject),hObject) %case of an index 4445 if ~isempty(UvData) && isfield(UvData, 'ProjObject') && length(UvData.ProjObject)>=IndexObj 4446 if isfield(UvData.ProjObject{IndexObj},'DisplayHandle') && isfield(UvData.ProjObject{IndexObj}.DisplayHandle,'uvmat') 4447 hdisplay=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat; 4448 for iview=1:length(hdisplay) 4449 if ishandle(hdisplay(iview)) && ~isequal(hdisplay(iview),0) 4450 ObjectData=get(hdisplay(iview),'UserData'); 4451 if isfield(ObjectData,'SubObject') & ishandle(ObjectData.SubObject) 4452 delete(ObjectData.SubObject); 4453 end 4454 if isfield(ObjectData,'DeformPoint') & ishandle(ObjectData.DeformPoint) 4455 delete(ObjectData.DeformPoint); 4456 end 4457 delete(hdisplay(iview)) 4458 end 4459 ishandle(hdisplay(iview)) 4460 end 4461 for iobj=IndexObj+1:length(UvData.ProjObject) 4462 hdisplay=UvData.ProjObject{iobj}.DisplayHandle.uvmat; 4463 for iview=1:length(hdisplay) 4464 if ishandle(hdisplay(iview)) && ~isequal(hdisplay(iview),0) 4465 PlotData=get(hdisplay(iview),'UserData'); 4466 PlotData.IndexObj=iobj-1; 4467 set(hdisplay(iview),'UserData',PlotData); 4468 end 4469 end 4470 end 4471 end 4472 UvData.ProjObject(IndexObj)=[]; 4473 if ~isempty(list_str) 4474 list_str(IndexObj)=[]; 4475 end 4476 end 4477 % elseif ishandle(hObject)%object handle 4478 % userdata=get(hObject,'UserData'); 4479 % if ishandle(userdata)%the selected line depends on a parent line 4480 % hdisplay=userdata;% the parent object becomes the current one 4481 % else 4482 % hdisplay=hObject;% the selected object becomes the current one 4483 % end 4484 % PlotData=get(hdisplay,'UserData'); 4485 % if isfield(PlotData,'SubObject') & ishandle(PlotData.SubObject) 4486 % delete(PlotData.SubObject); 4487 % end 4488 % if isfield(PlotData,'DeformPoint') & ishandle(PlotData.DeformPoint) 4489 % delete(PlotData.DeformPoint); 4490 % end 4491 % delete(hdisplay); 4492 % if isfield(PlotData,'IndexObj') 4493 % IndexObj=PlotData.IndexObj; 4494 % if isequal(round(IndexObj),IndexObj) & IndexObj>=1 & length(list_str) > IndexObj 4495 % if isfield(UvData,'ProjObject')& length(UvData.ProjObject) > IndexObj 4496 % UvData.ProjObject(IndexObj)=[]; 4497 % end 4498 % list_str(IndexObj)=[]; 4499 % end 4500 % end 4501 % end 4502 set(huvmat,'UserData',UvData); 4503 set(hlist_object,'String',list_str) 4504 set(hlist_object,'Value',length(list_str)) 4505 hlist_object_1=findobj(huvmat,'Tag','ListObject_1');%handles of the first object list in the uvmat interface 4506 old_index=get(hlist_object_1,'Value'); 4507 set(hlist_object_1,'String',list_str) 4508 if IndexObj<=old_index 4509 set(hlist_object_1,'Value',old_index-1) 4433 4510 end 4434 4511 … … 4599 4676 aviobj=close(aviobj); 4600 4677 UvData=rmfield(UvData,'plotaxes'); 4601 %UvData.Object{1}.plotaxes=handles.PlotAxes;4602 4678 set(huvmat,'UserData',UvData); 4603 4679 msgbox_uvmat('CONFIRMATION',{['movie ' aviname ' created '];['with ' num2str(imax) ' frames']}) … … 4688 4764 function create_object(data,handles) 4689 4765 %------------------------------------------------------------------------ 4690 % desactivate geometric calibration if opened4691 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib'); 4766 %% desactivate concurrent tools 4767 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');% search the GUI geometric calibration 4692 4768 if ishandle(hgeometry_calib) 4693 4769 hhgeometry_calib=guidata(hgeometry_calib); 4694 4770 set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib 4695 set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7]) 4696 end 4697 set(handles.edit_object,'Value',0); %suppress the object edit mode 4698 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4771 end 4772 set(handles.edit_object,'Value',0) %desactivate the object edit mode 4773 set(handles.CheckZoomFig,'Value',0) %desactivate zoom sub fig 4774 set(handles.CheckZoom,'Value',0) %desactivate the zoom action 4775 if ishandle(handles.UVMAT_title) 4776 delete(handles.UVMAT_title) %delete the initial display of uvmat if no field has been entered yet 4777 end 4778 4779 %% append a new line to the list of projection objects 4699 4780 ListObject=get(handles.ListObject,'String'); 4700 4781 if isempty(ListObject) … … 4708 4789 set(handles.ListObject,'Value',IndexObj) 4709 4790 UvData=get(handles.uvmat,'UserData'); 4710 UvData.Object{IndexObj}=[]; %create a new empty object 4711 UvData.Object{IndexObj}.DisplayHandle.uvmat=handles.PlotAxes; % axes for plot_object 4712 UvData.Object{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation 4791 UvData.ProjObject{IndexObj}=[]; %create a new empty object 4792 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=handles.PlotAxes; % axes for plot_object 4793 UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation 4794 set(handles.uvmat,'UserData',UvData) 4795 4796 %% initiate the new projection object 4713 4797 data.Name=data.Type;% default name=type 4714 4798 data.Coord=[0 0]; %default … … 4724 4808 data.DX=UvData.Field.CoordMesh; 4725 4809 data.DY=UvData.Field.CoordMesh; 4810 if strcmp(data.Type,'rectangle')||strcmp(data.Type,'ellipse') 4811 data.RangeX=UvData.Field.CoordMesh; 4812 data.RangeY=UvData.Field.CoordMesh; 4813 end 4726 4814 end 4727 4815 if isfield(Field,'NbDim')&& isequal(Field.NbDim,3) … … 4732 4820 end 4733 4821 end 4734 if ishandle(handles.UVMAT_title) 4735 delete(handles.UVMAT_title)%delete the initial display of uvmat if no field has been entered 4736 end 4737 hset_object=set_object(data,handles);% call the set_object interface 4738 hhset_object=guidata(hset_object); 4822 hset_object=set_object(data,handles);% call the GUI set_object 4739 4823 hchild=get(hset_object,'children'); 4740 4824 set(hchild,'enable','on') 4741 set(handles.uvmat,'UserData',UvData) 4742 set(handles.CheckZoom,'Value',0) %desactivate the zoom for object creation by the mouse 4743 CheckZoom_Callback(handles.uvmat, [], handles) 4825 4826 4744 4827 set(handles.delete_object,'Visible','on') 4745 4828 … … 4771 4854 4772 4855 UvData=get(handles.uvmat,'UserData'); 4773 UvData. Object{IndexObj}=[]; %create a new empty object4774 UvData. Object{IndexObj}.DisplayHandle.uvmat=[]; %no plot handle before plot_field operation4775 UvData. Object{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation4856 UvData.ProjObject{IndexObj}=[]; %create a new empty object 4857 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=[]; %no plot handle before plot_field operation 4858 UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation 4776 4859 set(handles.uvmat,'UserData',UvData) 4777 4860 set(handles.ListObject,'Value',IndexObj) … … 4842 4925 4843 4926 %% read lines currently drawn 4844 ListObj=UvData. Object;4927 ListObj=UvData.ProjObject; 4845 4928 select=zeros(1,numel(ListObj)); 4846 4929 for iobj=1:numel(ListObj); … … 4855 4938 else 4856 4939 set(handles.ListObject,'Value',val);% show the selected lines on the list 4857 ObjectData=UvData. Object(val);4940 ObjectData=UvData.ProjObject(val); 4858 4941 for iobj=1:length(ObjectData) 4859 4942 % if isfield(ObjectData{iobj},'Coord') … … 4962 5045 %------------------------------------------------------------------------ 4963 5046 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4964 ListObj=UvData. Object;5047 ListObj=UvData.ProjObject; 4965 5048 select=zeros(1,numel(ListObj)); 4966 5049 for iobj=1:numel(ListObj); … … 4981 5064 yi=0.5:npy-0.5; 4982 5065 [Xi,Yi]=meshgrid(xi,yi); 4983 % if isfield(UvData,'Object') 4984 for iobj=1:length(UvData.Object) 4985 ObjectData=UvData.Object{iobj}; 5066 for iobj=1:length(UvData.ProjObject) 5067 ObjectData=UvData.ProjObject{iobj}; 4986 5068 if isfield(ObjectData,'ProjMode') &&(isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside')); 4987 5069 flagobj=1; … … 5307 5389 5308 5390 5309 % --- Executes on button press in CheckZoomFig.5310 function CheckZoomFig_Callback(hObject, eventdata, handles)5311 % hObject handle to CheckZoomFig (see GCBO)5312 % eventdata reserved - to be defined in a future version of MATLAB5313 % handles structure with handles and user data (see GUIDATA)5314 5315 % Hint: get(hObject,'Value') returns toggle state of CheckZoomFig
Note: See TracChangeset
for help on using the changeset viewer.