Changeset 1080


Ignore:
Timestamp:
Apr 17, 2020, 5:58:49 PM (4 years ago)
Author:
sommeria
Message:

ima2temperature.m added and various bug repairs

Location:
trunk/src
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/angle2normal.m

    r1078 r1080  
    33% this gives the equation of the plane as norm_plane(1)x + norm_plane(2)y + norm_plane(2)z = 0
    44
    5 function norm_plane=angle2normal(PlaneAngle)
     5function norm_plane=rotate(PlaneAngle)
     6
    67om=norm(PlaneAngle);%norm of rotation angle in degrees
    78OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
  • trunk/src/get_field.m

    r1072 r1080  
    136136end
    137137if isempty(CellInfo)
    138     Field.MaxDim=max(cellfun(@numel,Field.Display.VarDimName));
     138    [Field.MaxDim,imax]=max(cellfun(@numel,Field.Display.VarDimName));% maximum number of dimensions for the input fields
     139    ListDim=Field.Display.VarDimName{imax};
    139140    check_cellinfo=false;
    140141else
    141     [Field.MaxDim,imax]=max(NbDim);
     142    [Field.MaxDim,imax]=max(NbDim);% maximum number of dimensions for the input fields identified by attributes
    142143    check_cellinfo=true;
    143144end
     
    171172
    172173%% select the Time attribute from input
    173 if isfield(ParamIn,'TimeAttrName')
    174     time_index=find(strcmp(ParamIn.TimeAttrName,Field.Display.ListGlobalAttribute),1);
     174if Field.MaxDim >=2
     175    variable_index=find(strcmp('variable',ListSwitchVarIndexTime),1);
     176    set(handles.SwitchVarIndexTime,'Value',variable_index);
    175177else
    176     time_index=find(~cellfun('isempty',regexp(Field.Display.ListGlobalAttribute,'Time')),1);% look for global attribute containing name 'Time'
    177 end
    178 if isempty(time_index)
    179     set(handles.SwitchVarIndexTime,'Value',1);
    180 else
    181     set(handles.SwitchVarIndexTime,'Value',2);
    182     set(handles.TimeName,'UserData',time_index)
     178    if isfield(ParamIn,'TimeAttrName')
     179        time_index=find(strcmp(ParamIn.TimeAttrName,Field.Display.ListGlobalAttribute),1);
     180    else
     181        time_index=find(~cellfun('isempty',regexp(Field.Display.ListGlobalAttribute,'Time')),1);% look for global attribute containing name 'Time'
     182    end
     183    if isempty(time_index)
     184        set(handles.SwitchVarIndexTime,'Value',1);
     185    else
     186        set(handles.SwitchVarIndexTime,'Value',2);
     187        set(handles.TimeName,'UserData',time_index)
     188    end
    183189end
    184190set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)
     
    258264%% fill menus for coordinates and time
    259265FieldOption_Callback(handles.variables,[], handles)% list the global attributes
    260 
    261 %% Make choices of coordinates from input
    262 %     check_menu=false(1,numel(Data.ListVarName));
    263 %     ListCoordMenu=1:numel(Data.ListVarName);
    264 %     CoordIndex=CellInfo{icell}.CoordIndex(CellInfo{icell}.CoordIndex~=0);
    265 %
    266 %             for ivar=find(check_coord_names)
    267 %                 check_dim=strcmp(Data.VarDimName{ivar},DimCell_var);
    268 %                 if ~isempty(find(check_dim))
    269 %                     check_menu(ivar)=true;
    270 %                 end
    271 %             end
    272 %             CellInfo{icell}.CoordMenu=[CoordIndex find(check_menu)];
    273 %             ListCoordMenu(CoordIndex)=[];
    274 %             for ivar=ListCoordMenu
    275 %                 DimCell=Data.VarDimName{ivar};
    276 %                 if isequal(DimCell,DimCell_var)
    277 %                     check_menu(ivar)=true;
    278 %                 end
    279 %             end
    280 %             CellInfo{icell}.CoordMenu=[CellInfo{icell}.CoordMenu find(check_menu)];
    281 %
    282 % if isfield(CellInfo{imax},'CoordIndex')
    283 %     CoordIndex=CellInfo{imax}.CoordIndex;
    284 %     if numel(CoordIndex)==2
    285 %         if isfield(ParamIn,'Coord_x')&& isfield(ParamIn,'Coord_y')
    286 %             YName=ParamIn.Coord_y;
    287 %             XName=ParamIn.Coord_x;
    288 %         else
    289 %         YName=Field.ListVarName{CoordIndex(1)};
    290 %         XName=Field.ListVarName{CoordIndex(2)};
    291 %         end
    292 %         ListCoord=get(handles.Coord_x,'String');
    293 %         XIndex=find(strcmp(XName,ListCoord));
    294 %         if ~isempty(XIndex)
    295 %             set(handles.Coord_x,'Value',XIndex)
    296 %         end
    297 %         YIndex=find(strcmp(YName,ListCoord));
    298 %         if ~isempty(YIndex)
    299 %             set(handles.Coord_y,'Value',YIndex)
    300 %         end
    301 %     end
    302 % end
    303266
    304267%% put the GUI on the lower right of the sceen
     
    663626var_component(var_component==scalar_index)=[];
    664627ListCoord=Field.Display.ListVarName([var_coord var_component]);
    665 
    666 %% set default coord selection
     628coord_val=zeros(size(ListCoord));
     629
     630%% set default selection for grid coordinates
     631coord_val(1)=var_coord(end);
     632coord_val(2)=var_coord(end-1);
     633if numel(var_coord)>=3
     634    coord_val(3)=var_coord(end-2);
     635end
    667636% if numel(find(test_coord))>3
    668637%     SwitchVarIndexTime=get(handles.SwitchVarIndexTime,'String');
     
    675644% end
    676645
    677 coord_val=[0 0];
    678 % look for labelled unstructured coordinates
     646%% default selection for labelled unstructured coordinates
    679647for ilist=1:numel(var_component)
    680648    ivar=var_component(ilist);
     
    696664    coord_val([1 2])=[1 2];
    697665end
     666
     667%% set menu and default selection for coordinates
    698668set(handles.Coord_x,'Value',coord_val(1))
    699669set(handles.Coord_x,'String',ListCoord)
    700 
    701670set(handles.Coord_y,'Value',coord_val(2))
    702671set(handles.Coord_y,'String',ListCoord)
    703 
    704672if numel(coord_val)>=3
    705673    set(handles.Coord_z,'Value',coord_val(3))
     
    956924            if ~isempty(PreviousList)
    957925                PreviousAttr=PreviousList{get(handles.TimeName, 'Value')};
    958                 index=find(strcmp(PreviousAttr,Field.Display.ListGlobalAttributes),1);
     926                index=find(strcmp(PreviousAttr,Field.Display.ListGlobalAttribute),1);
    959927            end
    960928        end
     
    1011979VarIndex_y=[];
    1012980if ischar(cell_str)
    1013     for ivar=1:length(ListVarName)
    1014         varlist=ListVarName{ivar};
    1015         if isequal(varlist,cell_str)
    1016             VarIndex_y= ivar;
    1017             break
    1018         end
    1019     end
     981    VarIndex_y=find(strcmp(cell_str,ListVarName),1);
    1020982elseif iscell(cell_str)
    1021983    for isel=1:length(cell_str)
     
    1030992end
    1031993
    1032 % --- Executes on button press in CheckDimensionY.
    1033 % function CheckDimensionX_Callback(hObject, eventdata, handles)
    1034 % CheckDimensionX=get(handles.CheckDimensionX,'value')
    1035 % if CheckDimensionX
    1036 %     set(handles.Coordinates,'visible','off')
    1037 % else
    1038 %     set(handles.Coordinates,'visible','on')
    1039 % end
    1040 % FieldList=get(handles.FieldOption,'String');
    1041 % FieldOption=FieldList{get(handles.FieldOption,'Value')};
    1042 % switch FieldOption
    1043 %     case '1D plot'
    1044 %         
    1045 %     case {'scalar'}
    1046 %        scalar_Callback(hObject, eventdata, handles)
    1047 %     case 'vectors'
    1048 % end
     994
    1049995
    1050996% % --- Executes on button press in CheckDimensionY.
     
    11181064end
    11191065
    1120 
     1066%-----------------------------------------------------------------------
    11211067% --- Executes on button press in Check3D.
     1068%-----------------------------------------------------------------------
    11221069function Check3D_Callback(hObject, eventdata, handles)
    11231070if get(handles.Check3D,'Value')% 3D fields
     
    11321079set(handles.vector_z,'Visible',status)
    11331080set(handles.W_title,'Visible',status)
    1134 if strcmp(status,'on')% ask for 3D input   
    1135     Field=get(handles.get_field,'UserData');
     1081Field=get(handles.get_field,'UserData');
     1082if strcmp(status,'on')% ask for 3D input       
    11361083    if Field.MaxDim>3% for 4D fields, propose to use the fourth variable as time
    11371084        %set(handles.Time,'Visible','on')
     
    11431090    else
    11441091        set(handles.SwitchVarIndexTime,'Value',1)
    1145         set(handles.SwitchVarIndexTime,'String',{'file index'})
    1146     end
    1147 else
     1092        set(handles.SwitchVarIndexTime,'String',{'file index';'attribute'})
     1093    end
     1094else 
    11481095   set(handles.SwitchVarIndexTime,'String',get(handles.SwitchVarIndexTime,'UserData'))
     1096   if Field.MaxDim >=3
     1097       var_index=find(strcmp('variable',get(handles.SwitchVarIndexTime,'UserData')));
     1098       set(handles.SwitchVarIndexTime,'Value',var_index)
     1099   end
    11491100end
    11501101SwitchVarIndexTime_Callback(handles.SwitchVarIndexTime,[], handles)
  • trunk/src/mouse_down.m

    r1078 r1080  
    3737    return % no action if a calculation is running
    3838end
    39 hhCurrentGUI=guidata(hCurrentGUI);% tags of the children of the current GUI
     39hhCurrentGUI=guidata(hCurrentGUI);% tags of the children of the current GUI (uvmat or view_field)
    4040CheckZoom=0;
    4141if isfield(hhCurrentGUI,'CheckZoom') && get(hhCurrentGUI.CheckZoom,'Value');%test for zoom action, first priority
     
    4848
    4949%% determine the currently selected items
    50 hcurrentobject=gco;% current object handle (selected by the mouse)
     50hcurrentobject=gco;% current object handle (selected by the mouse: it can be a drawn object, a plot axis, ..;)
    5151CurrentGUI_tag=get(hCurrentGUI,'Tag');
    5252obj_tag=get(gco,'Tag');%tag of the currently selected object
     
    6060test_create=0;
    6161test_edit_vect=0;
    62 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls the option of  mouse action
     62huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls the option of mouse action
    6363if ~isempty(huvmat)
    6464    hhuvmat=guidata(huvmat);%handles of elements in uvmat
    65     UvData=get(huvmat,'UserData');
     65    UvData=get(huvmat,'UserData');% contains the input field as UvData.Field
    6666    test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler  action, second priority;
    6767    test_edit=get(hhuvmat.CheckEditObject,'Value');%&& (isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint'));%test for object editing, third priority
     
    209209    end
    210210end
    211     if ~strcmp(htype,'axes')
    212         currentaxes=get(hObject,'CurrentAxes');
    213         if ~isempty(currentaxes)
     211if ~strcmp(htype,'axes')
     212    currentaxes=get(hObject,'CurrentAxes');
     213    if ~isempty(currentaxes)
    214214        AxeData=get(currentaxes,'UserData');% data attached to the axis
    215215        AxeData.Enable='off';% desactivate current axes for mouse up action
    216216        set(currentaxes,'UserData',AxeData);
    217         end
    218     end
     217    end
     218end
    219219   
    220220%% zoom has first priority, stop here
     
    380380end
    381381
    382 %%  create  projection  object
     382%%  create  projection  object within the GUI uvmat
    383383if  test_create && ~isempty(xy) && ~strcmp(get(hCurrentGUI,'SelectionType'),'alt')
    384384    % activate this option if the GUI set_object is opened
     
    417417        if isempty(ObjectData.Coord)||(isfield(ObjectData,'RangeX') && size(ObjectData.RangeX,2)==2)% draw a new plane
    418418            ObjectData.Coord=xy(1,1:2);% record the coordinates marked by the mouse as origin of the new plane
     419           
     420            if isfield(FigData,'PlotAxes')
     421                Field=FigData.PlotAxes;% field represented on the plot (already projected)
     422                if isfield(Field,'ProjObjectType') && strcmp(Field.ProjObjectType,'plane') && isfield(Field,'ProjObjectCoord') && length(Field.ProjObjectCoord)>=3
     423                    zpos=Field.ProjObjectCoord(1,3);
     424                    if isfield(Field,'ProjObjectAngle')&&~isequal(Field.ProjObjectAngle,[0 0 0])
     425                        norm_plane=rotate_vector(Field.ProjObjectAngle,0,0,1);%angle2normal(Field.ProjObjectAngle);
     426                        zpos=zpos-(norm_plane(1)*(xy(1,1)-Field.ProjObjectCoord(1))+norm_plane(2)*(xy(1,2)-Field.ProjObjectCoord(2)))/norm_plane(3);
     427                    end
     428                    ObjectData.Coord(3)=zpos;
     429                end
     430            end
     431           
    419432            set(hh_set_object.Coord,'Data',ObjectData.Coord);%append the current mouse cordinates in the GUI set_object
    420433            set(hh_set_object.num_RangeX_2,'String','')
     
    422435            drawing_status='create';
    423436        else
     437
    424438            Delta_x=(xy(1,1)-ObjectData.Coord(1,1));%displacement along x
    425439            Delta_y=(xy(1,2)-ObjectData.Coord(1,2));%displacement along y
    426             ObjectData.Angle(1)=(180/pi)*angle(Delta_x+i*Delta_y);
    427             ObjectData.Angle(2)=90;
    428             ObjectData.RangeX(1)=0;
    429             ObjectData.RangeX(2)=abs(Delta_x+i*Delta_y);
    430             set(hh_set_object.num_Angle_1,'String',num2str(ObjectData.Angle(1)))
    431             set(hh_set_object.num_Angle_2,'String',num2str(ObjectData.Angle(2)))
    432             set(hh_set_object.num_RangeX_1,'String',num2str(ObjectData.RangeX(1)))
    433             set(hh_set_object.num_RangeX_2,'String',num2str(ObjectData.RangeX(2)))
     440            theta=angle(Delta_x+1i*Delta_y);
     441            M2=[cos(theta) -sin(theta) 0;sin(theta) cos(theta) 0;0 0 1];% rotation matrix around the vertical axis with angle theta
     442            M1=[1 0 0;0 0 -1; 0 1 0]; % rotation matrix around the x axis with angle pi/2
     443            Angle=rodrigues(M2*M1);
     444              [RangeX,RangeY]=set_plane_bounds(theta,ObjectData.Coord(1,:),UvData.Field);
     445            set(hh_set_object.num_Angle_1,'String',num2str(Angle(1)))
     446            set(hh_set_object.num_Angle_2,'String',num2str(Angle(2)))
     447             set(hh_set_object.num_Angle_3,'String',num2str(Angle(3)))
     448            set(hh_set_object.num_RangeX_1,'String',num2str(RangeX(1)))
     449            set(hh_set_object.num_RangeX_2,'String',num2str(RangeX(2)))
     450            set(hh_set_object.num_RangeY_1,'String',num2str(RangeY(1)))
     451            set(hh_set_object.num_RangeY_2,'String',num2str(RangeY(2)))
    434452            drawing_status='off';
    435453        end
     
    439457        drawing_status='create';
    440458    end
    441     drawing_status='create';
     459    %drawing_status='create';
    442460    %TODO replace 0 by z coord for 3D
    443461    hobject=UvData.ProjObject{IndexObj}.DisplayHandle.(CurrentGUI_tag);
     
    544562set(haxes,'UserData',AxeData);
    545563
     564function [RangeX,RangeY]=set_plane_bounds(theta,OriginCoord,Field)   
     565
     566iX=[1;0;0];
     567iY=[0;1;0];
     568iZ=[0;0;1];
     569% [iX_proj,iY_proj]=rotate_vector(-PlaneAngle,iX,iY,iZ);%initial coordinates of the new base vector along X and Y
     570maxnX=[];
     571minnX=[];
     572Max_vec=[Field.XMax Field.YMax Field.ZMax];
     573Min_vec=[Field.XMin Field.YMin Field.ZMin];
     574RangeY=[Field.ZMin Field.ZMax]-OriginCoord(3);% bound on Z become bound on the new z axis at 90 ?
     575iX_proj(1)=cos(theta);%cosine of the angle of the new axis with x
     576iX_proj(2)=sin(theta);
     577OriginCoord(3)=[];% work of the bounds in x, y
     578%bounds from the input field acting on the new X axis
     579ind_bound=find(iX_proj~=0);% dimensions for which the bound acts
     580Max_vec_X=(Max_vec(ind_bound)-OriginCoord(ind_bound))./iX_proj(ind_bound);%Abscissa of upper edge in the new coordinates
     581Min_vec_X=(Min_vec(ind_bound)-OriginCoord(ind_bound))./iX_proj(ind_bound);%Abscissa of lower edge in the new coordinates
     582%lower bound of X
     583RangeX(1)=max(min(Max_vec_X,Min_vec_X));
     584%upper bound of X
     585RangeX(2)=min(max(Max_vec_X,Min_vec_X));%must be with the field range along each coordinate x,y,z
     586
     587
     588
     589
     590
  • trunk/src/mouse_motion.m

    r1078 r1080  
    220220                pos=[xy(1,1) xy(1,2) 0];%coordinates on the graph
    221221                if isfield(Field,'ProjObjectAngle')&&~isequal(Field.ProjObjectAngle,[0 0 0])
    222                     norm_plane=angle2normal(Field.ProjObjectAngle);
     222                    norm_plane=rotate_vector(Field.ProjObjectAngle,0,0,1);%angle2normal(Field.ProjObjectAngle);
    223223                    pos(3)=-(norm_plane(1)*(pos(1)-Field.ProjObjectCoord(1))+norm_plane(2)*(pos(2)-Field.ProjObjectCoord(2)))/norm_plane(3);                               
    224224                end
     
    390390    end
    391391    XYData=AxeData.CurrentOrigin;
     392 
    392393    if isequal(AxeData.Drawing,'create') && isfield(AxeData,'CurrentOrigin') && ~isempty(AxeData.CurrentOrigin)
    393394        switch ObjectData.Type
    394395            case {'line','polyline','polygon','points'}
    395396                ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];
    396                 % ObjectData.Coord(end,:)=xy(1,:);
     397                plot_object(ObjectData,ProjObject,AxeData.CurrentObject,'m');
    397398            case {'rectangle','ellipse','volume'}
    398399                ObjectData.Coord=(AxeData.CurrentOrigin+xy(1,1:2))/2;% keep only the first point coordinate
    399400                ObjectData.RangeX=abs(ObjectData.Coord(1,1)-xy(1,1));%rectangle width
    400401                ObjectData.RangeY=abs(ObjectData.Coord(1,2)-xy(1,2));%rectangle height
     402                plot_object(ObjectData,ProjObject,AxeData.CurrentObject,'m');
    401403            case 'plane' %case of 'plane'
    402404                DX=(xy(1,1)-ObjectData.Coord(1,1));
     
    409411                    end
    410412                end
    411         end
    412         plot_object(ObjectData,ProjObject,AxeData.CurrentObject,'m');
     413                hline=findobj(hPlotAxes,'Tag','mouse_line');
     414                if isempty(hline)
     415                    hline=line([AxeData.CurrentOrigin(1) xy(1,1)],[AxeData.CurrentOrigin(2) xy(1,2)],'Tag','mouse_line');
     416                else
     417                    set(hline,'XData',[AxeData.CurrentOrigin(1) xy(1,1)])
     418                    set(hline,'YData',[AxeData.CurrentOrigin(2) xy(1,2)])
     419                end
     420        end
     421
    413422        pointershape='crosshair';
    414423    elseif test_edit_object && isequal(AxeData.Drawing,'translate')
  • trunk/src/mouse_up.m

    r1072 r1080  
    199199    hparentfig=hcurrentfig;
    200200    %open or update a new zoom figure if a rectangle has been drawn
    201     if ishandle(hcurrentaxes);
     201    if ishandle(hcurrentaxes)
    202202        if isfield(AxeData,'CurrentRectZoom') && ~isempty(AxeData.CurrentRectZoom) && ishandle(AxeData.CurrentRectZoom)
    203203            %PosRect=get(AxeData.CurrentRectZoom,'Position');
  • trunk/src/phys_XYZ.m

    r1078 r1080  
    8686    Ty=Calib.Tx_Ty_Tz(2);
    8787    Tz=Calib.Tx_Ty_Tz(3);
    88     f=Calib.fx_fy(1);%dpy=1; sx=1
    89     %dpx=Calib.fx_fy(2)/Calib.fx_fy(1);
    9088    Dx=R(5)*R(7)-R(4)*R(8);
    9189    Dy=R(1)*R(8)-R(2)*R(7);
     
    10199    A21=-R(7)*Ty+R(4)*Tz+Z21*Z0virt;
    102100    A22=-R(1)*Tz+R(7)*Tx+Z22*Z0virt;
    103     %     X0=Calib.fx_fy(1)*(R(5)*Tx-R(2)*Ty+Zx0*Z0virt);
    104     %     Y0=Calib.fx_fy(2)*(-R(4)*Tx+R(1)*Ty+Zy0*Z0virt);
    105101    X0=(R(5)*Tx-R(2)*Ty+Zx0*Z0virt);
    106102    Y0=(-R(4)*Tx+R(1)*Ty+Zy0*Z0virt);
    107103    %px to camera:
    108     %     Xd=dpx*(X-Calib.Cx_Cy(1)); % sensor coordinates
    109     %     Yd=(Y-Calib.Cx_Cy(2));
    110104    Xd=(X-Calib.Cx_Cy(1))/Calib.fx_fy(1); % sensor coordinates
    111105    Yd=(Y-Calib.Cx_Cy(2))/Calib.fx_fy(2);
    112     dist_fact=1+Calib.kc*(Xd.*Xd+Yd.*Yd);%/(f*f); %distortion factor
    113     Xu=Xd./dist_fact;%undistorted sensor coordinates
    114     Yu=Yd./dist_fact;
     106    dist_fact=1+Calib.kc*(Xd.*Xd+Yd.*Yd);% distortion factor, first approximation Xu,Yu=Xd,Yd
     107    test=0;
     108    niter=0;
     109    while test==0 && niter<10
     110        dist_fact_old=dist_fact;     
     111        Xu=Xd./dist_fact;%undistorted sensor coordinates, second iteration
     112        Yu=Yd./dist_fact;
     113        dist_fact=1+Calib.kc*(Xu.*Xu+Yu.*Yu);% distortion factor,next approximation
     114        test=max(max(abs(dist_fact-dist_fact_old)))<0.00001; % reducing the relative error to 10^-5 forthe inversion of the quadraticcorrection
     115        niter=niter+1;
     116    end
    115117    denom=Dx*Xu+Dy*Yu+D0;
    116118    Xphys=(A11.*Xu+A12.*Yu+X0)./denom;%world coordinates
  • trunk/src/plot_object.m

    r1071 r1080  
    150150            xline=[xline; ObjectData.Coord(1,1)];%closing the line
    151151            yline=[yline; ObjectData.Coord(1,2)];
    152         case {'plane','plane_z','volume'}
     152        case {'plane','volume'}
    153153            if ~isfield(ObjectData,'Angle')
    154                 ObjectData.Angle=[0 0];
    155             end
    156             cosphi=cos(ObjectData.Angle(1)*pi/180);%angle in radians
    157             sinphi=sin(ObjectData.Angle(1)*pi/180);%angle in radians
     154                ObjectData.Angle=[0 0 0];
     155            end
     156            cosphi=cos(ObjectData.Angle(3)*pi/180);%angle in radians
     157            sinphi=sin(ObjectData.Angle(3)*pi/180);%angle in radians
    158158            x0=xline(1); y0=yline(1);
    159159            xlim=get(haxes,'XLim');
     
    331331
    332332%% MODIFY AN EXISTING OBJECT PLOT
    333 if test_newobj==0;
     333if test_newobj==0
    334334    hh=hplot;
    335335    PlotData=get(hplot,'UserData');
     
    375375            NbDeformPoint=length(PlotData.DeformPoint);
    376376            if NbDeformPoint>nbpoints% fpoints in excess on the graph
    377                 for ii=nbpoints+1:NbDeformPoint;
     377                for ii=nbpoints+1:NbDeformPoint
    378378                    if ishandle(PlotData.DeformPoint(ii))
    379379                        delete(PlotData.DeformPoint(ii))
     
    472472                        col,'LineStyle','none','Marker','.','Tag','DeformPoint','SelectionHighlight','off','UserData',hh);
    473473                end
    474         case {'plane','volume','plane_z'}
     474        case {'plane','volume'}
    475475            hh=line(xline,yline,'Color',col);
    476476            PlotData.SubObject(1)=line(xsup,ysup,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');
  • trunk/src/proj_field.m

    r1078 r1080  
    807807           
    808808            if max(NbDim)==3 % 3D case
    809                 AZName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)};
    810                 AYName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
    811                 AXName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-2)};
    812                 AX=FieldData.(AXName);% set of x positions
    813                 AY=FieldData.(AYName);% set of y positions
    814                 AZ=FieldData.(AZName);% set of z positions
    815                 AName=FieldData.ListVarName{VarIndex(1)};
    816                 npxy=size(FieldData.(AName));
    817                 npz=npxy(1);
    818                 npy=npxy(2);
    819                 npx=npxy(1);
    820                 AXI=linspace(AX(1),AX(end), npx);%set of  x  positions for the interpolated input data
    821                 AYI=linspace(AY(1),AY(end), npy);%set of  x  positions for the interpolated input data
    822                 AZI=linspace(AZ(1),AZ(end), npy);%set of  x  positions for the interpolated input data
     809                AXName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(3)};
     810                Coord{1}=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(1)});%initial z coordinates
     811                Coord{2}=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(2)});%initial y coordinates
     812                Coord{3}=FieldData.(AXName);%initial x coordinates
     813                if size(ObjectData.Coord,2)<3
     814                    ObjectData.Coord(1,3)=0;
     815                end
     816                dline=ObjectData.Coord(2,:)-ObjectData.Coord(1,:);
     817                linelength=norm(dline);
     818                if isfield(FieldData,'RangeX')
     819                    XMin=min(FieldData.RangeX);%shift of the origin on the line
     820                else
     821                    XMin=0;
     822                end
     823                ProjData.(AXName)=XMin:ObjectData.DX:XMin+linelength;%abscissa of the projected data along the line
     824               
     825                XI_proj=ObjectData.Coord(1,1)*ones(size(ProjData.(AXName)));
     826                YI_proj=ObjectData.Coord(1,2)*ones(size(ProjData.(AXName)));
     827                ZI_proj=ObjectData.Coord(1,3)*ones(size(ProjData.(AXName)));
     828                if dline(1,1)~=0
     829                    XI_proj=XI_proj+ProjData.(AXName)/dline(1,1);
     830                end
     831                if dline(1,2)~=0
     832                    YI_proj=YI_proj+ProjData.(AXName)/dline(1,2);
     833                end
     834                if dline(1,3)~=0
     835                    ZI_proj=ZI_proj+ProjData.(AXName)/dline(1,3);
     836                end
    823837                for ivar=VarIndex
    824                     VarName=FieldData.ListVarName{ivar};
    825                     FieldData.(VarName)=interp3(FieldData.(AXName),FieldData.(AYName),FieldData.(AZName),FieldData.(VarName),AXI,AYI,AZI);
    826                    
    827                     %                     vec_A=reshape(squeeze(FieldData.(FieldData.ListVarName{ivar})),npx*npy,nbcolor); %put the original image in colum
    828                     %                     if nbcolor==1
    829                     %                         vec_B(ind_in)=vec_A(ICOMB);
    830                     %                         vec_B(ind_out)=zeros(size(ind_out));
    831                     %                         A_out=reshape(vec_B,npY,npX);
    832                     %                         ProjData.(FieldData.ListVarName{ivar}) =sum(A_out,1)/npY;
    833                     %                     elseif nbcolor==3
    834                     %                         vec_B(ind_in,1:3)=vec_A(ICOMB,:);
    835                     %                         vec_B(ind_out,1)=zeros(size(ind_out));
    836                     %                         vec_B(ind_out,2)=zeros(size(ind_out));
    837                     %                         vec_B(ind_out,3)=zeros(size(ind_out));
    838                     %                         A_out=reshape(vec_B,npY,npX,nbcolor);
    839                     %                         ProjData.(FieldData.ListVarName{ivar})=squeeze(sum(A_out,1)/npY);
    840                     %                     end
     838                                      VarName=FieldData.ListVarName{ivar};
     839                    %                         ListVarName=[ListVarName VarName];
     840                    %                         VarDimName=[VarDimName {{'coord_y','coord_x'}}];
     841                    %                         VarAttribute{length(ListVarName)}=FieldData.VarAttribute{ivar}; %reproduce the variable attributes
    841842                    ProjData.ListVarName=[ProjData.ListVarName FieldData.ListVarName{ivar}];
    842843                    ProjData.VarDimName=[ProjData.VarDimName {AXName}];%to generalize with the initial name of the x coordinate
    843844                    ProjData.VarAttribute{ivar}.Role='continuous';% for plot with continuous line
    844                 end
    845                
     845                   
     846                    FieldData.(VarName)=permute(FieldData.(VarName),[2 3 1]); %coordinate permutation needed to use interp3
     847                    indexnan=isnan(FieldData.(VarName));
     848                    FieldData.(VarName)(indexnan)=0;%set to zero the undefined values
     849                    ProjData.(VarName)=interp3(Coord{3},Coord{2},Coord{1},double(FieldData.(VarName)),XI_proj,YI_proj,ZI_proj,'*linear');
     850                    ProjData.(VarName)=squeeze(ProjData.(VarName));
     851                end           
     852           
    846853            else
    847854                AYName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
     
    959966                    ProjData.VarDimName{end}={AXName,'rgb'};
    960967                end
    961             end
    962            
    963     end
    964     % for vector fields, take the components longitudinal and tranverse to the projection line
    965     if ~isempty(ivar_U) && ~isempty(ivar_V)
    966         vector_x =ProjData.(ProjData.ListVarName{ivar_U});
    967         ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
    968         ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
    969     end
     968    end
     969   
     970end
     971% for vector fields, take the components longitudinal and tranverse to the projection line
     972if ~isempty(ivar_U) && ~isempty(ivar_V)
     973    vector_x =ProjData.(ProjData.ListVarName{ivar_U});
     974    ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
     975    ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
     976end
    970977end
    971978
     
    10021009
    10031010%% rotation matrix
    1004 PlaneAngle=[0 0];
     1011PlaneAngle=[0 0 0];
    10051012norm_plane=[0 0 1];
    1006 test90x=0;%=1 for 90 degree rotation alround x axis
    1007 test90y=0;%=1 for 90 degree rotation alround y axis
    1008 
    1009 if isfield(ObjectData,'Angle')
    1010     checkM2=0;
    1011     if numel(ObjectData.Angle)==2 && ~isequal(ObjectData.Angle,[0 0])
    1012         checkM2=1;
    1013         test90y=0;%isequal(ObjectData.Angle,[0 90 0]);
    1014     end
    1015     PlaneAngle=(pi/180)*ObjectData.Angle;
    1016     if PlaneAngle==0
    1017         PlaneAngle=[0 0];
    1018     end   
    1019     M1=[cos(PlaneAngle(1)) -sin(PlaneAngle(1)) 0;sin(PlaneAngle(1)) cos(PlaneAngle(1)) 0;0 0 1];
    1020     M=M1;
    1021     if checkM2
    1022         M2=[1 0 0;0 cos(PlaneAngle(2)) -sin(PlaneAngle(2));0 sin(PlaneAngle(2)) cos(PlaneAngle(2))];
    1023         M=M1*M2;% first rotate in the x,y plane with angle PlaneAngle(1), then slant around the new x axis0 with angle PlaneAngle(2)
    1024     end
     1013testangle=0;
     1014test90x=0;
     1015test90y=0;
     1016if isfield(ObjectData,'Angle') && size(ObjectData.Angle,2)==3
     1017    test90x=isequal(ObjectData.Angle,[90 0 0]);%=1 for 90 degree rotation alround x axis
     1018    test90y=isequal(ObjectData.Angle,[0 90 0]);%=1 for 90 degree rotation alround y axis
     1019    %test90z=isequal(PlaneAngle,[90 0 0]);%=1 for 90 degree rotation alround x axis
     1020    PlaneAngle=(pi/180)*ObjectData.Angle;
     1021    M=rodrigues(PlaneAngle);
    10251022    norm_plane=M*[0 0 1]'; 
    1026 end
    1027 testangle=~isequal(PlaneAngle,[0 0])||~isequal(ObjectData.Coord(1:2),[0 0 ]) ;% && ~test90y && ~test90x;%=1 for slanted plane
     1023    testangle= (~isequal(PlaneAngle,[0 0 0]) && ~test90x && ~test90y);%=1 for slanted plane
     1024end
    10281025
    10291026%% mesh sizes DX and DY
     
    12351232    VarAttribute={};% initiate coresponding list of var attributes  for cell # icell
    12361233    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1237     switch CellInfo{icell}.CoordType
    1238         
     1234    check3D=(numel(CellInfo{icell}.CoordIndex)==3);
     1235    switch CellInfo{icell}.CoordType   
    12391236        case 'scattered'
    12401237            %% case of input fields with unstructured coordinates (applies for projMode ='projection' or 'interp_lin')
     
    12441241            coord_x=FieldData.(CellInfo{icell}.XName);% initial x coordinates
    12451242            coord_y=FieldData.(CellInfo{icell}.YName);% initial y coordinates
    1246             check3D=(numel(CellInfo{icell}.CoordIndex)==3);
     1243     
    12471244            if check3D
    12481245                coord_z=FieldData.(CellInfo{icell}.ZName);
     
    12711268           
    12721269            %rotate coordinates if needed: coord_X,coord_Y= = coordinates in the new plane
    1273             Phi=PlaneAngle(1);
    1274             %             Theta=PlaneAngle(2);
    1275             % Phi=PlaneAngle(3);
    1276             if testangle && ~test90y && ~test90x;%=1 for slanted plane
    1277                 coord_X=coord_x *cos(Phi) + coord_y* sin(Phi);
    1278                 coord_Y=-coord_x *sin(Phi) + coord_y *cos(Phi);
    1279                 if checkM2
    1280                     coord_Y=coord_Y*cos(PlaneAngle(2));
    1281                     coord_Y=coord_Y+coord_z *sin(PlaneAngle(2));
    1282                     coord_X=(coord_X *cos(Psi) - coord_Y* sin(Psi));%A VERIFIER
    1283                     coord_Y=(coord_X *sin(Psi) + coord_Y* cos(Psi));
     1270           
     1271            Phi=PlaneAngle(3);
     1272            if testangle
     1273                if check3D
     1274                    [coord_X,coord_Y]=rotate_vector(PlaneAngle,coord_x,coord_y,coord_z);
     1275                else
     1276                    coord_X=coord_x *cos(Phi) + coord_y* sin(Phi);
     1277                    coord_Y=-coord_x *sin(Phi) + coord_y *cos(Phi);
    12841278                end
    12851279            else
     
    14151409               
    14161410                %rotate coordinates if needed: coord_X,coord_Y= = coordinates in the new plane
    1417                 Phi=PlaneAngle(1);
     1411                Phi=PlaneAngle(3);
    14181412                if testangle && ~test90y && ~test90x %=1 for slanted plane
    14191413                    new_XI=XI *cos(Phi) - YI* sin(Phi)+ObjectData.Coord(1);
     
    16881682                    % determine the boundaries of the projected field,
    16891683                    % first find the 8 summits of the initial volume in the
    1690                     PlaneAngle=[0 0 0];% default
    1691                     PlaneAngle(1:numel(ObjectData.Angle))=ObjectData.Angle*pi/180;
     1684%                     PlaneAngle=[0 0 0];% default
     1685%                     PlaneAngle(1:numel(ObjectData.Angle))=ObjectData.Angle*pi/180;
    16921686                    % new coordinates
    16931687                    Coord{1}=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(1)});%initial z coordinates
    16941688                    Coord{2}=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(2)});%initial y coordinates
    16951689                    Coord{3}=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(3)});%initial x coordinates
    1696 %                     summit=zeros(3,8);% initialize summit coordinates
    1697 %                     summit(1,1:4)=[Coord{3}(1) Coord{3}(end) Coord{3}(1) Coord{3}(end)];%square
    1698 %                     summit(2,1:4)=[Coord{2}(1) Coord{2}(1) Coord{2}(end) Coord{2}(end)];% square at z= Coord{1}(1)
    1699 %                     summit(1:2,5:8)=summit(1:2,1:4);
    1700 %                     summit(3,:)=[Coord{1}(1)*ones(1,4) Coord{1}(end)*ones(1,4)];
    1701 %                     %Mrot_inv=rodrigues(-PlaneAngle);
    1702 %                     newsummit=zeros(3,8);% initialize the rotated summit coordinates
    1703                     ObjectData.Coord=ObjectData.Coord';% set ObjectData.Coord as a vertical vector
    1704                     if size(ObjectData.Coord,1)<3
    1705                         ObjectData.Coord=[ObjectData.Coord; 0];%add z origin at z=0 by default
    1706                     end
     1690
     1691                    coord_x_proj=ObjectData.RangeX(1):InterpMesh:ObjectData.RangeX(2);% set of coordinates in the projection plane
     1692                    coord_y_proj=ObjectData.RangeY(1):InterpMesh:ObjectData.RangeY(2);
     1693                    %coord_z_proj=-floor(ObjectData.RangeInterp/InterpMesh):InterpMesh:floor(ObjectData.RangeInterp/InterpMesh);
     1694                    M=rodrigues(ObjectData.Angle);
     1695                    [XI,YI]=meshgrid(coord_x_proj,coord_y_proj);
     1696                    XI_proj=M(1,1)*XI+M(2,1)*YI+ObjectData.Coord(1,1);
     1697                    YI_proj=M(2,1)*XI+M(2,2)*YI+ObjectData.Coord(1,2);
     1698                    ZI_proj=M(3,1)*XI+M(3,2)*YI+ObjectData.Coord(1,3);
    17071699                   
    1708 %                     M1=[cos(PlaneAngle(1)) sin(PlaneAngle(1)) 0;-sin(PlaneAngle(1)) cos(PlaneAngle(1)) 0;0 0 1];
    1709 %                     M2=[1 0 0;0 cos(PlaneAngle(2)) sin(PlaneAngle(2));0 -sin(PlaneAngle(2)) cos(PlaneAngle(2))];
    1710 %                     M=M1*M2;
    1711                     M_inv=inv(M);
    1712                    
    1713 %                     for isummit=1:8% TODO: introduce a function for rotation of n points (to use also for scattered data)
    1714 %                         newsummit(:,isummit)=M*(summit(:,isummit)-(ObjectData.Coord));
    1715 %                     end
    1716 %                     coord_x_proj=min(newsummit(1,:)):InterpMesh: max(newsummit(1,:));% set of coordinqtes in the projection plane
    1717 %                     coord_y_proj=min(newsummit(2,:)):InterpMesh: max(newsummit(2,:));
    1718 %                     coord_z_proj=-width:width;
    1719                     coord_x_proj=ObjectData.RangeX(1):InterpMesh:ObjectData.RangeX(2);% set of coordinqtes in the projection plane
    1720                      coord_y_proj=ObjectData.RangeY(1):InterpMesh:ObjectData.RangeY(2);
    1721                     coord_z_proj=-floor(ObjectData.RangeInterp/InterpMesh):InterpMesh:floor(ObjectData.RangeInterp/InterpMesh);
    1722                     %Mrot=rodrigues(PlaneAngle);% inverse rotation matrix
    1723                     %Origin=M_inv*[coord_x_proj(1);coord_y_proj(1);coord_z_proj(1)]+ObjectData.Coord;
    1724                     npx=numel(coord_x_proj);
    1725                     npy=numel(coord_y_proj);
    1726                     npz=numel(coord_z_proj);
    1727                    
    1728                     %modangle=sqrt(PlaneAngle(1)*PlaneAngle(1)+PlaneAngle(2)*PlaneAngle(2));
    1729                     %                     cosphi=PlaneAngle(1)/modangle;
    1730                     %                     sinphi=PlaneAngle(2)/modangle;
    1731                     iX=[coord_x_proj(end)-coord_x_proj(1);0;0]/(npx-1);
    1732                     iY=[0;coord_y_proj(end)-coord_y_proj(1);0]/(npy-1);
    1733                     if npz==1
    1734                         iZ=[0;0;0];
    1735                     else
    1736                     iZ=[0;0;coord_z_proj(end)-coord_z_proj(1)]/(npz-1);
    1737                     end
    1738                     %                     iX(1:2)=[cosphi -sinphi;sinphi cosphi]*iX(1:2);
    1739                     %                     iY(1:2)=[-cosphi -sinphi;sinphi cosphi]*iY(1:2);
    1740                    
    1741                     ix=M_inv*iX;%  vector along the new x coordinates transformed into old coordinates
    1742                     iy=M_inv*iY;% vector along y coordinates
    1743                     iz=M_inv*iZ;% vector along z coordinates
    1744                    
    1745                     [Grid_x,Grid_y,Grid_z]=meshgrid(0:npx-1,0:npy-1,0:npz-1);
    1746                     %[Grid_x,Grid_y,Grid_z]=meshgrid(0:npz-1,0:npy-1,0:npx-1);
    1747                     if ismatrix(Grid_x)% add a singleton in case of a single z value
    1748                         Grid_x=shiftdim(Grid_x,-1);
    1749                         Grid_y=shiftdim(Grid_y,-1);
    1750                         Grid_z=shiftdim(Grid_z,-1);
    1751                     end
    1752                     XI=ObjectData.Coord(1)+ix(1)*Grid_x+iy(1)*Grid_y+iz(1)*Grid_z;
    1753                     YI=ObjectData.Coord(2)+ix(2)*Grid_x+iy(2)*Grid_y+iz(2)*Grid_z;
    1754                     ZI=ObjectData.Coord(3)+ix(3)*Grid_x+iy(3)*Grid_y+iz(3)*Grid_z;
    1755                   %  [X,Y,Z]=meshgrid(Coord{3},Coord{2},Coord{1});% grid of initial coordinates
     1700   
    17561701                    for ivar=VarIndex
    17571702                        VarName=FieldData.ListVarName{ivar};
     
    17641709                        ProjData.coord_x=coord_x_proj;
    17651710                        ProjData.coord_y=coord_y_proj;
    1766                         ProjData.(VarName)=interp3(Coord{3},Coord{2},Coord{1},double(FieldData.(VarName)),ZI,YI,XI,'*linear');
    1767                         ProjData.(VarName)=nanmean(ProjData.(VarName),1);
     1711                        ProjData.(VarName)=interp3(Coord{3},Coord{2},Coord{1},double(FieldData.(VarName)),XI_proj,YI_proj,ZI_proj,'*linear');
     1712                        ProjData.(VarName)=nanmean(ProjData.(VarName),3);
    17681713                        ProjData.(VarName)=squeeze(ProjData.(VarName));
    17691714                    end
     
    17971742                UName=ListVarName{ivar_U};
    17981743                VName=ListVarName{ivar_V};
    1799                 if checkM2
     1744                if check3D
    18001745                    UValue=cos(PlaneAngle(1))*ProjData.(UName)+ sin(PlaneAngle(1))*ProjData.(VName);
    18011746                    ProjData.(VName)=(-sin(PlaneAngle(1))*ProjData.(UName)+ cos(PlaneAngle(1))*ProjData.(VName));
  • trunk/src/series/LIF_series.m

    r1071 r1080  
    11%----------------------------------------------------------------------
    2 % -process LIF images
     2% -process LIF images:old function to update
    33%----------------------------------------------------------------------
    44
     
    2121%=======================================================================
    2222
    23 function GUI_input=LIF_series(num_i1,num_i2,num_j1,num_j2,Series);
     23function ParamOut=LIF_series(Param)
    2424
    2525%requests for the visibility of input windows in the GUI series  (activated directly by the selection in the menu ACTION)
    2626if ~exist('num_i1','var')
    27     GUI_input={'RootPath';'two';...%nbre of possible input series (options 'on'/'two'/'many', default:'one')
     27    ParamOut={'RootPath';'two';...%nbre of possible input series (options 'on'/'two'/'many', default:'one')
    2828        'SubDir';'on';... % subdirectory of derived files (PIV fields), ('on' by default)
    2929        'RootFile';'on';... %root input file name ('on' by default)
     
    4040    return %exit the function
    4141end
    42 
    43 %-------------------------------------------------
    44 hseries=guidata(Series.hseries);%handles of the GUI series
    45 WaitbarPos=get(hseries.waitbar_frame,'Position'); %positiopn of waitbar frame
    46 %-------------------------------------------------
    47 addpath '/fsnet/project/coriolis/2006/06ICEBOX/0_MATLAB_WORK/LIF'% define path for concentration.m
    48 % cpath=which('series');
    4942
    5043%mode=''; %default
  • trunk/src/set_object.m

    r1072 r1080  
    3838function varargout = set_object(varargin)
    3939
    40 % Last Modified by GUIDE v2.5 09-Nov-2016 15:46:04
     40% Last Modified by GUIDE v2.5 01-Apr-2020 22:25:49
    4141
    4242% Begin initialization code - DO NOT REFRESH
     
    9696    ZBounds=0; %default
    9797end
     98test3D=(ZBounds~=0); % =1 for 3D fleds
    9899set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function
    99100set(hObject,'DeleteFcn',{@closefcn})
     
    137138        end
    138139    end
    139     if isfield(data,'RangeX')&& ~strcmp(data.Type,'plane_z')%TODO: generalise
     140    if isfield(data,'RangeX')
    140141        if ischar(data.RangeX)
    141142            data.RangeX=str2num(data.RangeX);
     
    160161        end
    161162    end
    162     if ~isfield(data,'Angle')
    163         data.Angle=[0 0];
     163    if ~(isfield(data,'Angle') && size(data.Angle,2)==3)
     164        data.Angle=[0 0 0];
    164165    end
    165166    set(handles.num_Angle_1,'String',num2str(data.Angle(1)))
    166     if numel(data.Angle)==2
    167         set(handles.num_Angle_2,'Visible','on')
    168         set(handles.num_Angle_2,'String',num2str(data.Angle(2)))
     167    set(handles.num_Angle_2,'String',num2str(data.Angle(2)))
     168    set(handles.num_Angle_3,'String',num2str(data.Angle(3)))
     169    if test3D
     170        set(handles.num_Angle_1,'Visible','on')
     171    set(handles.num_Angle_2,'Visible','on')
    169172    end
    170173end
     
    286289value=get(handles.Type,'Value');
    287290ObjectStyle=menu{value};
    288 %%%%%%%%% TODO
    289 test3D=strcmp(ObjectStyle,'plane_z'); %TODO: generalize
    290 %%%%%%%%%
     291
    291292%default setting
    292 set(handles.num_Angle_1,'Visible','off')
    293 set(handles.num_Angle_2,'Visible','off')
    294 %set(handles.num_Angle_3,'Visible','off')
     293% set(handles.num_Angle_1,'Visible','off')
     294% set(handles.num_Angle_2,'Visible','off')
     295% set(handles.num_Angle_3,'Visible','off')
    295296set(handles.num_RangeX_1,'Visible','off')
    296297set(handles.num_RangeY_1,'Visible','off')
    297 % if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps')
    298 %     set(handles.num_RangeY_2,'Visible','off')
    299 % else
    300 %     set(handles.num_RangeY_2,'Visible','on')
    301298
    302299set(handles.num_RangeZ_1,'Visible','off')
     
    336333            set(handles.num_RangeInterp,'Visible','on')
    337334        end       
    338     case {'plane','plane_z'
    339         set(handles.num_Angle_1,'Visible','on')
     335    case {'plane'
     336        set(handles.num_Angle_3,'Visible','on')
    340337        set(handles.num_RangeX_1,'Visible','on')
    341338        set(handles.num_RangeX_2,'Visible','on')
     
    343340        set(handles.num_RangeY_2,'Visible','on')
    344341        set(handles.num_RangeZ_2,'TooltipString','num_ZMax: range of projection normal to the plane')
    345         if test3D
    346             set(handles.num_Angle_2,'Visible','on')
    347             set(handles.num_Angle_1,'Visible','on')
    348             set(handles.num_Angle_1,'String','90')
    349             %set(handles.Coord,'Data',[0 0 0])
    350             set(handles.num_RangeZ_2,'Visible','on')
    351         end
     342%         if test3D
     343%             set(handles.num_Angle_2,'Visible','on')
     344%             set(handles.num_Angle_1,'Visible','on')
     345%             %set(handles.num_Angle_1,'String','90')
     346%             %set(handles.Coord,'Data',[0 0 0])
     347%             set(handles.num_RangeZ_2,'Visible','on')
     348%         end
    352349        if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps')
    353350            set(handles.num_DX,'Visible','on')
     
    826823
    827824
    828 
    829825function num_RangeInterp_Callback(hObject, eventdata, handles)
    830 
    831 
    832 %
    833826
    834827
     
    836829function suggest_refresh(hObject, eventdata, handles)
    837830set(handles.REFRESH,'BackgroundColor',[1 0 1])
     831
     832
     833function num_Angle_3_Callback(hObject, eventdata, handles)
  • trunk/src/uvmat.m

    r1078 r1080  
    10241024                    return
    10251025                end
    1026                 data.Angle=[0 90];
     1026                data.Angle=[90 0 0];
    10271027                data.DX=UvData.Field.CoordMesh;
    10281028                data.DY=UvData.Field.CoordMesh;
     
    60996099        end
    61006100        for iobj=IndexObj+1:length(UvData.ProjObject)
    6101             hdisplay=UvData.ProjObject{iobj}.DisplayHandle.uvmat;
     6101            hdisplay=UvData.ProjObject{iobj}.DisplayHandle.uvmat;%handle of the object drawing
    61026102            for iview=1:length(hdisplay)
    61036103                if ishandle(hdisplay(iview)) && ~isequal(hdisplay(iview),0)
Note: See TracChangeset for help on using the changeset viewer.