Changeset 62
- Timestamp:
- Mar 24, 2010, 12:36:53 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r61 r62 929 929 data=read_geometry_calib(Coord_cell); 930 930 nbpoints=size(data.Coord,1); %nbre of calibration points 931 if nbpoints <4932 msgbox_uvmat('ERROR','four points must be selected by the mouse to delimitate the detectionarea')931 if nbpoints~=4 932 msgbox_uvmat('ERROR','four points must be selected by the mouse, beginning by the new x axis, to delimitate the phs grid area') 933 933 end 934 934 corners_X=(data.Coord(end-3:end,4)); %pixel absissa of the four corners 935 935 corners_Y=(data.Coord(end-3:end,5)); 936 937 %reorder the last two points if needed 938 angles=angle((corners_X-corners_X(1))+i*(corners_Y-corners_Y(1)); 939 if abs(angles(4)-angles(2))>abs(angles(3)-angles(2)) 940 X_end=corners_X(4); 941 Y_end=corners_Y(4); 942 corners_X(4)=corners_X(3); 943 corners_Y(4)=corners_Y(3); 944 corners_X(3)=X_end; 945 corners_Y(3)=Y_end; 946 end 936 947 937 948 %read the current image -
trunk/src/mouse_down.m
r61 r62 53 53 hcurrentobject=gco;% current object handle (selected by the mouse) 54 54 hcurrentfig=gcbo;% current figure handle 55 fig_tag=get(hcurrentfig,'Tag'); 55 56 tag_obj=get(gco,'Tag'); 56 57 xy=[];%default … … 211 212 end 212 213 set(hhuvmat.list_object_1,'String',list_str) 213 set(hhuvmat.list_object_1,'Value',IndexObj)214 214 set(hhuvmat.list_object_2,'String',list_str) 215 set(hhuvmat.list_object_2,'Value',IndexObj) 215 if strcmp(fig_tag,'view_field')%we are in view_field plot 216 set(hhuvmat.list_object_1,'Value',IndexObj) 217 else%we are in uvmat plot 218 set(hhuvmat.list_object_2,'Value',IndexObj) 219 end 216 220 PlotData=get(AxeData.CurrentObject,'UserData'); 217 221 PlotData.IndexObj=IndexObj; -
trunk/src/uvmat.m
r61 r62 3395 3395 end 3396 3396 3397 % %------------------------------------------------3398 % function create_Callback(hObject,eventdata,handles)3399 % %------------------------------------------------3400 % if ishandle(handles.UVMAT_title)3401 % delete(handles.UVMAT_title)3402 % end3403 % huvmat=get(handles.create,'parent');3404 % UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface (handles huvmat)3405 % if isequal(get(handles.create,'Value'),1)3406 % set(handles.zoom,'Value',0)3407 % zoom_Callback(hObject, eventdata, handles)3408 % set(handles.create,'BackgroundColor',[1 1 0]) %visualise in yellow3409 % set(handles.edit_vect,'Value',0)3410 % edit_vect_Callback(hObject, eventdata, handles)3411 % set(handles.edit,'Value',0)3412 % set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])3413 % list_object_1=get(handles.list_object_1,'String');3414 % if ~isempty(list_object_1)3415 % set(handles.list_object_1,'Value',length(list_object_1))3416 % end3417 % MouseAction='create_object';3418 % hset_object=findobj(allchild(0),'Name','set_object');3419 % uistack(hset_object,'top')3420 % else3421 % set(handles.create,'BackgroundColor',[0 1 0])3422 % set(handles.edit,'Value',1)3423 % set(handles.edit,'BackgroundColor',[1 1 0])3424 % MouseAction='none';3425 % end3426 %3427 % UvData.MouseAction=MouseAction;3428 % set(huvmat,'UserData',UvData);3429 %3430 % %------------------------------------------------3431 % function POINTS_Callback(hObject,eventdata,handles)3432 % %------------------------------------------------3433 % if ishandle(handles.UVMAT_title)3434 % delete(handles.UVMAT_title)3435 % end3436 % huvmat=get(handles.create,'parent');3437 % UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface (handles huvmat)3438 % if isequal(get(handles.create,'Value'),1)3439 % set(handles.zoom,'Value',0)3440 % zoom_Callback(hObject, eventdata, handles)3441 % set(handles.edit_vect,'Value',0)3442 % edit_vect_Callback(hObject, eventdata, handles)3443 % set(handles.edit,'Value',0)3444 % set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])3445 % %set(handles.grid,'Value',0)3446 % %set(handles.grid,'BackgroundColor',[0 1 0])3447 % % initiate set_object GUI3448 % data.TITLE='POINTS';3449 % if isfield(UvData,'CoordType')3450 % data.CoordType=UvData.CoordType;3451 % end3452 % if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)3453 % data.RangeY=UvData.Mesh;3454 % elseif isfield(UvData,'AX')&isfield(UvData,'AY')& isfield(UvData,'A')%only image3455 % np=size(UvData.Field.A);3456 % meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2);3457 % meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1);3458 % data.RangeY=max(meshx,meshy);3459 % data.DX=max(meshx,meshy);3460 % end3461 % data.Coord=[0 0 0]; %default3462 % data.ParentButton=handles.create;3463 % PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters3464 % [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface3465 % if isfield(UvData,'SetObjectOrigin')3466 % pos_uvmat=get(huvmat,'Position');3467 % pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);3468 % pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);3469 % set(hset_object,'Position',pos_set_object)3470 % end3471 % %set(hset_object,'Position',[pos_uvmat(1) pos_uvmat(2)-0.05*pos_uvmat(4) 0.2*pos_uvmat(3) 0.5*pos_uvmat(4)]);3472 % list_object_1=get(handles.list_object_1,'String');3473 % if ~isempty(list_object_1)3474 % set(handles.list_object_1,'Value',length(list_object_1))3475 % end3476 % MouseAction='create_object';3477 % %UvData.ZoomOn=0;3478 % else3479 % set(handles.create,'BackgroundColor',[0 1 0])3480 % set(handles.edit,'Value',1)3481 % set(handles.edit,'BackgroundColor',[1 1 0])3482 % MouseAction='none';3483 % end3484 %3485 % UvData.MouseAction=MouseAction;3486 % set(huvmat,'UserData',UvData);3487 3488 % %-----------------------------------------------------------3489 % function LINE_Callback(hObject, eventdata, handles)3490 % %-------------------------------------------------3491 % if ishandle(handles.UVMAT_title)3492 % delete(handles.UVMAT_title)3493 % end3494 % % handles.uvmat3495 % huvmat=get(handles.create,'parent');3496 % UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface3497 % set(handles.zoom,'Value',0)3498 % zoom_Callback(hObject, eventdata, handles)3499 % set(handles.edit_vect,'BackgroundColor',[0.7 0.7 0.7])3500 % set(handles.edit_vect,'Value',0)3501 % edit_vect_Callback(hObject, eventdata, handles)3502 % set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])3503 % set(handles.edit,'Value',0)3504 % set(handles.list_object_1,'Value',1);3505 % edit_vect_Callback(hObject, eventdata, handles)3506 % set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])3507 % set(handles.cal,'Value',0)3508 % set(handles.cal,'BackgroundColor',[0 1 0])3509 % % initiate the set_object GUI3510 % data.TITLE='LINE';3511 % if isfield(UvData,'CoordType')3512 % data.CoordType=UvData.CoordType;3513 % end3514 % if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)3515 % data.RangeX=UvData.Mesh;3516 % data.RangeY=UvData.Mesh;3517 % data.DX=UvData.Mesh;3518 % data.DY=UvData.Mesh;3519 % elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image3520 % np=size(UvData.Field.A);3521 % meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2);3522 % meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1);3523 % data.RangeY=max(meshx,meshy);3524 % data.RangeX=max(meshx,meshy);3525 % data.DX=max(meshx,meshy);3526 % end3527 % if isfield(data,'DX')3528 % data.Coord=[[0 0 0];[data.DX 0 0]]; %default3529 % else3530 % data.Coord=[[0 0 0];[1 0 0]]; %default3531 % end3532 % data.ParentButton=handles.create;3533 % PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters3534 % [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes,3535 % % associate the set_edit interface handle to the plotting axes3536 % pos_uvmat=get(huvmat,'Position');3537 % if isfield(UvData,'SetObjectOrigin')3538 % pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);3539 % pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);3540 % set(hset_object,'Position',pos_set_object)3541 % end3542 % list_object_1=get(handles.list_object_1,'String');3543 % if ~isempty(list_object_1)3544 % set(handles.list_object_1,'Value',length(list_object_1))3545 % end3546 % MouseAction='create_object';3547 % UvData.MouseAction=MouseAction;3548 % set(huvmat,'UserData',UvData)3549 3550 % %-----------------------------------------------------------3551 % function PATCH_Callback(hObject, eventdata, handles)3552 % %-----------------------------------------------------------3553 % if ishandle(handles.UVMAT_title)3554 % delete(handles.UVMAT_title)3555 % end3556 % huvmat=get(handles.create,'parent');3557 % UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface3558 % % if isequal(get(handles.PATCH,'Value'),1)3559 % set(handles.zoom,'Value',0)3560 % set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])3561 % % set(handles.create,'Value',0)%suppress the other options if LINE is chosen3562 % % set(handles.create,'BackgroundColor',[0 1 0])3563 % % set(handles.LINE,'Value',0)3564 % % set(handles.LINE,'BackgroundColor',[0 1 0])3565 % % set(handles.PATCH,'Value',1)3566 % % set(handles.PATCH,'BackgroundColor',[1 1 0])3567 % % set(handles.PLANE,'Value',0)3568 % % set(handles.PLANE,'BackgroundColor',[0 1 0])%put activated buttons to yellow3569 % % set(handles.VOLUME,'Value',0)3570 % % set(handles.VOLUME,'BackgroundColor',[0 1 0])3571 % %set(handles.makemask,'Value',0)3572 % %makemask_Callback(hObject, eventdata, handles)3573 % set(handles.edit_vect,'Value',0)3574 % edit_vect_Callback(hObject, eventdata, handles)3575 % set(handles.edit,'Value',0)3576 % set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])3577 % set(handles.edit_vect,'Value',0)3578 % edit_vect_Callback(hObject, eventdata, handles)3579 % set(handles.cal,'Value',0)3580 % set(handles.cal,'BackgroundColor',[0 1 0])3581 % %set(handles.grid,'Value',0)3582 % %set(handles.grid,'BackgroundColor',[0 1 0])3583 % %initiate set_object GUI3584 % data.TITLE='PATCH';3585 % if isfield(UvData,'CoordType')3586 % data.CoordType=UvData.CoordType;3587 % end3588 % if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)3589 % data.YMax=UvData.Mesh;3590 % elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image3591 % np=size(UvData.Field.A);3592 % meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/(np(2)-1);3593 % meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/(np(1)-1);3594 % data.YMax=max(meshx,meshy);3595 % data.DX=max(meshx,meshy);3596 % end3597 % data.Coord=[0 0 0]; %default3598 % data.ParentButton=handles.create;3599 % PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters3600 % [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface3601 % pos_uvmat=get(huvmat,'Position');3602 % if isfield(UvData,'SetObjectOrigin')3603 % pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);3604 % pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);3605 % set(hset_object,'Position',pos_set_object)3606 % end3607 % list_object_1=get(handles.list_object_1,'String');3608 % if ~isempty(list_object_1)3609 % set(handles.list_object_1,'Value',length(list_object_1))3610 % end3611 % UvData.MouseAction='create_object';3612 % set(huvmat,'UserData',UvData);3613 % %-------------------------------------------------------3614 % function PLANE_Callback(hObject, eventdata, handles)3615 % %-------------------------------------------------------3616 % if ishandle(handles.UVMAT_title)3617 % delete(handles.UVMAT_title)3618 % end3619 % huvmat=get(handles.create,'parent');3620 % UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface3621 % set(handles.zoom,'Value',0)3622 % set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])3623 % set(handles.edit_vect,'Value',0)3624 % edit_vect_Callback(hObject, eventdata, handles)3625 % set(handles.edit,'Value',0)3626 % set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])3627 % set(handles.cal,'Value',0)3628 % set(handles.cal,'BackgroundColor',[0 1 0])3629 % %set(handles.grid,'Value',0)3630 % %set(handles.grid,'BackgroundColor',[0 1 0])3631 % %initiate set_object GUI3632 % data.TITLE='PLANE';3633 % if isfield(UvData,'CoordType')3634 % data.CoordType=UvData.CoordType;3635 % end3636 % %Si 3D data.nbdim=3;3637 % %Si 2D3638 % if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)3639 % data.ZMax=UvData.Mesh;3640 % data.DX=UvData.Mesh;3641 % data.DY=UvData.Mesh;3642 % elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image3643 % np=size(UvData.Field.A);3644 % meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/(np(2)-1);3645 % meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/(np(1)-1);3646 % data.DX=max(meshx,meshy);3647 % end3648 % if isfield(UvData,'DX')3649 % data.DX=UvData.DX;3650 % end3651 % if isfield(UvData,'DY')3652 % data.DY=UvData.DY;3653 % elseif isfield(UvData,'Mesh')3654 % data.DY=UvData.Mesh;3655 % end3656 % if isfield(UvData.Field,'X')& isfield(UvData.Field,'Y')3657 % data.Coord=[0 0 0];3658 % data.Style='plane';3659 % data.Phi=0;3660 % data.IndexObj=1; %act on the first reference plane by default3661 % haxes= handles.axes3;%GENERALISER3662 % plot_object(data,[],haxes,'m'); %plot the axes of the default plane3663 % end3664 % data.ParentButton=handles.create;3665 % PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters3666 % ZBounds=0; % default3667 % if isfield(UvData,'ZMin') && isfield(UvData,'ZMax')3668 % ZBounds(1)=UvData.ZMin; %minimum for the Z slider3669 % ZBounds(2)=UvData.ZMax;%maximum for the Z slider3670 % end3671 % [hset_object,UvData.sethandles]=set_object(data,PlotHandles,ZBounds);% call the set_object interface with action on haxes,3672 % if isfield(UvData,'SetObjectOrigin')3673 % pos_uvmat=get(huvmat,'Position');3674 % pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);3675 % pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);3676 % set(hset_object,'Position',pos_set_object)3677 % end3678 % list_object_1=get(handles.list_object_1,'String');3679 % nbobject=length(list_object_1);3680 % set(handles.list_object_1,'Value',nbobject)3681 % UvData.MouseAction='create_object';3682 % set(huvmat,'UserData',UvData)3683 3684 3397 %------------------------------------------------------- 3685 3398 % --- Executes on button press in MENUVOLUME. … … 4409 4122 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7]) 4410 4123 set(handles.list_object_1,'Value',1) 4411 set(handles.cal,'Value',0)4412 set(handles.cal,'BackgroundColor',[0 1 0])4124 % set(handles.cal,'Value',0) 4125 % set(handles.cal,'BackgroundColor',[0 1 0]) 4413 4126 4414 4127 %prepare display of the set_grid GUI … … 4456 4169 IndexObj=get(handles.list_object_1,'Value'); 4457 4170 str_1=list_str{IndexObj}; 4458 set(handles.list_object_1,'BackgroundColor',[1 1 0])4459 set(handles.list_object_2,'BackgroundColor',[1 1 1])4171 % set(handles.list_object_1,'BackgroundColor',[1 1 0]) 4172 % set(handles.list_object_2,'BackgroundColor',[1 1 1]) 4460 4173 val_2=get(handles.list_object_2,'Value'); 4461 4174 str_2=get(handles.list_object_2,'String'); … … 4487 4200 set(hset_object,'name',list_str{IndexObj}); 4488 4201 end 4489 set(handles.list_object_2,'BackgroundColor',[1 1 0])4490 set(handles.list_object_1,'BackgroundColor',[1 1 1])4202 % set(handles.list_object_2,'BackgroundColor',[1 1 0]) 4203 % set(handles.list_object_1,'BackgroundColor',[1 1 1]) 4491 4204 update_object(handles,IndexObj,2) 4492 4205 end
Note: See TracChangeset
for help on using the changeset viewer.