Changeset 315 for trunk/src/uvmat.m
- Timestamp:
- Dec 3, 2011, 10:25:45 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r309 r315 932 932 %% view the field 933 933 run0_Callback(hObject, eventdata, handles); %view field 934 mask_test=get(handles. mask_test,'value');934 mask_test=get(handles.CheckMask,'value'); 935 935 if mask_test 936 MaskData=get(handles. mask_test,'UserData');936 MaskData=get(handles.CheckMask,'UserData'); 937 937 if isfield(MaskData,'maskhandle') && ishandle(MaskData.maskhandle) 938 938 delete(MaskData.maskhandle) %delete old mask 939 939 end 940 mask_test_Callback(hObject, eventdata, handles)940 CheckMask_Callback(hObject, eventdata, handles) 941 941 end 942 942 … … 1453 1453 1454 1454 %------------------------------------------------------------------------ 1455 % --- Executes on button press in mask_test.1456 function mask_test_Callback(hObject, eventdata, handles)1455 % --- Executes on button press in CheckMask. 1456 function CheckMask_Callback(hObject, eventdata, handles) 1457 1457 %------------------------------------------------------------------------ 1458 1458 %case of view mask selection 1459 if isequal(get(handles. mask_test,'Value'),1)1459 if isequal(get(handles.CheckMask,'Value'),1) 1460 1460 [FF,RootPath,FileBase]=read_file_boxes(handles); 1461 1461 num_i1=stra2num(get(handles.i1,'String')); … … 1499 1499 set(handles.nb_slice,'String',Name(i+1:ind_mask-1)); 1500 1500 set(handles.nb_slice,'BackgroundColor',[1 1 0]) 1501 set(handles. mask_test,'UserData',Mask);1502 set(handles. mask_test,'BackgroundColor',[1 1 0])1501 set(handles.CheckMask,'UserData',Mask); 1502 set(handles.CheckMask,'BackgroundColor',[1 1 0]) 1503 1503 if nbslice > 1 1504 1504 set(handles.slices,'value',1) … … 1522 1522 Mask.Base=fullfile(RootDir,RootFile); 1523 1523 Mask.NbSlice=1; 1524 set(handles. mask_test,'UserData',Mask);1525 set(handles. mask_test,'BackgroundColor',[1 1 0])1524 set(handles.CheckMask,'UserData',Mask); 1525 set(handles.CheckMask,'BackgroundColor',[1 1 0]) 1526 1526 end 1527 1527 if isempty(errormsg) … … 1529 1529 end 1530 1530 if ~isempty(errormsg) 1531 set(handles. mask_test,'Value',0)1532 set(handles. mask_test,'BackgroundColor',[0.7 0.7 0.7])1531 set(handles.CheckMask,'Value',0) 1532 set(handles.CheckMask,'BackgroundColor',[0.7 0.7 0.7]) 1533 1533 end 1534 else 1535 MaskData=get(handles. mask_test,'UserData');1534 else % desactivate mask display 1535 MaskData=get(handles.CheckMask,'UserData'); 1536 1536 if isfield(MaskData,'maskhandle') && ishandle(MaskData.maskhandle) 1537 1537 delete(MaskData.maskhandle) 1538 1538 end 1539 set(handles. mask_test,'UserData',[])1539 set(handles.CheckMask,'UserData',[]) 1540 1540 UvData=get(handles.uvmat,'UserData'); 1541 1541 if isfield(UvData,'MaskName') … … 1543 1543 set(handles.uvmat,'UserData',UvData) 1544 1544 end 1545 set(handles. mask_test,'BackgroundColor',[0.7 0.7 0.7])1545 set(handles.CheckMask,'BackgroundColor',[0.7 0.7 0.7]) 1546 1546 end 1547 1547 … … 1550 1550 %------------------------------------------------------------------------ 1551 1551 errormsg=[];%default 1552 MaskData=get(handles. mask_test,'UserData');1552 MaskData=get(handles.CheckMask,'UserData'); 1553 1553 if isfield(MaskData,'maskhandle')&& ishandle(MaskData.maskhandle) 1554 1554 uistack(MaskData.maskhandle,'top'); … … 1556 1556 num_i1_mask=mod(num_i1-1,MaskData.NbSlice)+1; 1557 1557 MaskName=name_generator(MaskData.Base,num_i1_mask,num_j1,'.png',MaskData.NomType); 1558 huvmat=get(handles. mask_test,'parent');1558 huvmat=get(handles.CheckMask,'parent'); 1559 1559 UvData=get(huvmat,'UserData'); 1560 1560 … … 1623 1623 MaskData.maskhandle=image(Mask.AX,Mask.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*flagmask); 1624 1624 % set(MaskData.maskhandle,'AlphaData',0.6*flagmask) 1625 set(handles. mask_test,'UserData',MaskData)1625 set(handles.CheckMask,'UserData',MaskData) 1626 1626 end 1627 1627 end … … 2556 2556 2557 2557 % second projection object (view_field display) 2558 % IndexObj_2=get(handles.list_object_2,'Value');%selected projection object for the second view 2559 % if IndexObj_2==0 2560 % IndexObj_2=1; 2561 % end 2562 %if isequal(get(handles.list_object_2,'Visible'),'on') && IndexObj_2 <= numel(UvData.Object)&& ~isempty(UvData.Object{IndexObj_2}) 2563 if length( IndexObj)>=2 2564 % IndexObj(2)=IndexObj_2; 2558 if length( IndexObj)>=2 2565 2559 view_field_handle=findobj(allchild(0),'tag','view_field');%handles of the view_field GUI 2566 2560 if ~isempty(view_field_handle) … … 2579 2573 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object 2580 2574 if testnewseries && isfield(ObjectData,'CoordUnit')&& isfield(PlotParam{imap},'Coordinates') 2581 PlotParam{imap} =rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field)2575 PlotParam{imap}.Coordinates=rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field) 2582 2576 end 2583 2577 if ~isempty(errormsg) … … 2651 2645 2652 2646 %% update the mask 2653 if isequal(get(handles. mask_test,'Value'),1)%if the mask option is on2647 if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on 2654 2648 update_mask(handles,num_i1,num_i2); 2655 2649 end … … 3818 3812 UvData.Object=UvData.Object(1); 3819 3813 end 3820 list_object=get(handles.ListObject,'String');3814 %list_object=get(handles.ListObject,'String'); 3821 3815 set(handles.ListObject,'Value',1) 3822 3816 set(handles.ListObject,'String',{''}) … … 3826 3820 3827 3821 %delete mask if it is displayed 3828 if isequal(get(handles. mask_test,'Value'),1)%if the mask option is on3822 if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on 3829 3823 UvData=rmfield(UvData,'MaskName'); %will impose mask refresh 3830 3824 end … … 3832 3826 run0_Callback(hObject, eventdata, handles) 3833 3827 3834 %-------------------------------------------- 3828 %------------------------------------------------------------------------ 3835 3829 function histo1_menu_Callback(hObject, eventdata, handles) 3836 3830 %-------------------------------------------- … … 3842 3836 update_histo(handles.histo_u,huvmat,FieldName) 3843 3837 3844 %---------------------------------------------- 3838 %------------------------------------------------------------------------ 3845 3839 function histo2_menu_Callback(hObject, eventdata, handles) 3846 %---------------------------------------------- 3840 %------------------------------------------------------------------------ 3847 3841 %plot second histo 3848 3842 huvmat=get(handles.histo2_menu,'parent'); … … 3852 3846 update_histo(handles.histo_v,huvmat,FieldName) 3853 3847 3854 3855 %-------------------------------------------- 3848 %------------------------------------------------------------------------ 3856 3849 %read the field .Fieldname stored in UvData and plot its histogram 3857 3850 function update_histo(haxes,huvmat,FieldName) 3851 %------------------------------------------------------------------------ 3858 3852 UvData=get(huvmat,'UserData'); 3859 3853 if ~isfield(UvData.Field,FieldName) … … 4108 4102 list=get(handles.ListColorCode,'String'); 4109 4103 ichoice=get(handles.ListColorCode,'Value'); 4110 colcode. ColorCode=list{ichoice};4111 colcode.Min C=str2num(get(handles.num_MinVec,'String'));4112 colcode.Max C=str2num(get(handles.num_MaxVec,'String'));4113 test3color=strcmp(colcode. ColorCode,'rgb') || strcmp(colcode.ColorCode,'bgr');4104 colcode.ListColorCode=list{ichoice}; 4105 colcode.MinVec=str2num(get(handles.num_MinVec,'String')); 4106 colcode.MaxVec=str2num(get(handles.num_MaxVec,'String')); 4107 test3color=strcmp(colcode.ListColorCode,'rgb') || strcmp(colcode.ListColorCode,'bgr'); 4114 4108 if test3color 4115 colcode. colcode1=str2num(get(handles.num_ColCode1,'String'));4116 colcode. colcode2=str2num(get(handles.num_ColCode2,'String'));4117 end 4118 colcode.FixedCbounds=0;4119 colcode.FixedCbounds=1;4120 vec_C=colcode.Min C+(colcode.MaxC-colcode.MinC)*(0.5:width-0.5)/width;%sample of vec_C values from min to max4109 colcode.ColCode1=str2num(get(handles.num_ColCode1,'String')); 4110 colcode.ColCode2=str2num(get(handles.num_ColCode2,'String')); 4111 end 4112 % colcode.FixedCbounds=0; 4113 %colcode.CheckFixVecColor=1; 4114 vec_C=colcode.MinVec+(colcode.MaxVec-colcode.MinVec)*(0.5:width-0.5)/width;%sample of vec_C values from min to max 4121 4115 [colorlist,col_vec]=set_col_vec(colcode,vec_C); 4122 4116 oneheight=ones(1,height); … … 4138 4132 write_plot_param(handles,PlotParamOut); %update the auto plot parameters 4139 4133 4140 % -------------------------------------------------------------------4141 % --- Executes on button press in grid.4142 function grid_Callback(hObject, eventdata, handles)4134 % %------------------------------------------------------------------- 4135 % % --- Executes on button press in grid. 4136 % function grid_Callback(hObject, eventdata, handles) 4143 4137 4144 4138
Note: See TracChangeset
for help on using the changeset viewer.