Changeset 964


Ignore:
Timestamp:
Jun 29, 2016, 8:36:44 PM (8 years ago)
Author:
sommeria
Message:

level + 3D projection

Location:
trunk/src
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r961 r964  
    5656if isfield(FileInfo,'FileIndexing') && strcmp(FileInfo.FileIndexing,'on')
    5757    [RootPath,SubDir,RootFile,i1_input,i2_input,j1_input,j2_input,FileExt,NomType]=fileparts_uvmat(fullfileinput);
     58    if ~isempty(regexp(SubDir,'^level\d+$')) && exist([RootPath '.xml'],'file')
     59        NomType='level';
     60    end
    5861    i1_series=zeros(1,1,1);
    5962    i2_series=zeros(1,1,1);
     
    176179            cd (FilePath)% move to the local dir to save time in the operation dir.
    177180            dirpair=dir(star_string);% look for relevant files in the file directory
    178             cd(wd)
     181            cd(wd)% back to the working directory
    179182            nbpair=numel(dirpair);
    180183            i1_series=zeros(1,nbpair);
     
    190193            end
    191194            % look for the list of subfolders level#
    192             cd (fullfile(RootPath,SubDir))% move to the local dir to save time in the operation dir.
    193             dirpair=dir('level*');% look for relevant files in the file directory
     195            cd (RootPath)% move to the local dir to save time in the operation dir.
     196            dirpair=dir('level*');% look for relevant subfolders named with leve#
    194197            cd(wd)
     198            [RootPath,SubDir]=fileparts(RootPath);
    195199            nbpair=numel(dirpair);
    196200            jfile=0;
     
    202206                end
    203207            end
    204             [i1_series,j1_series]=meshgrid(i1_series,j1_series);
    205             i1_series=reshape(i1_series,1,[]);
    206             j1_series=reshape(j1_series,1,[]);
     208            [j1_series,i1_series]=meshgrid(j1_series,i1_series);
     209%             i1_series=reshape(i1_series,1,[]);
     210%             j1_series=reshape(j1_series,1,[]);
    207211        else
    208212            detect_string=['^' RootFile sep1 i1_str i2_str sep2 j1_str j2_str FileExt '$'];%string used in regexp to detect file indices
  • trunk/src/proj_field.m

    r961 r964  
    964964% end   
    965965if isfield(ObjectData,'Angle')&& isequal(size(ObjectData.Angle),[1 3])&& ~isequal(ObjectData.Angle,[0 0 0])
    966     test90y=isequal(ObjectData.Angle,[0 90 0]);
     966    test90y=0;%isequal(ObjectData.Angle,[0 90 0]);
    967967    PlaneAngle=(pi/180)*ObjectData.Angle;
    968     om=norm(PlaneAngle);%norm of rotation angle in radians
    969     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
    970     cos_om=cos(om);
    971     sin_om=sin(om);
    972     coeff=OmAxis(3)*(1-cos_om);
    973     %components of the unity vector norm_plane normal to the projection plane
    974     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
    975     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
    976     norm_plane(3)=OmAxis(3)*coeff+cos_om;
    977 end
    978 testangle=~isequal(PlaneAngle,[0 0 0])||~isequal(ObjectData.Coord(1:2),[0 0 ]) ;% && ~test90y && ~test90x;%=1 for slanted plane
     968%     om=norm(PlaneAngle);%norm of rotation angle in radians
     969%     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
     970%     cos_om=cos(om);
     971%     sin_om=sin(om);
     972%     coeff=OmAxis(3)*(1-cos_om);
     973%     %components of the unity vector norm_plane normal to the projection plane
     974%     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
     975%     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
     976%     norm_plane(3)=OmAxis(3)*coeff+cos_om;
     977   
     978M2=[cos(PlaneAngle(2)) sin(PlaneAngle(2)) 0;-sin(PlaneAngle(2)) cos(PlaneAngle(2)) 0;0 0 1];
     979M1=[1 0 0;0 cos(PlaneAngle(1)) sin(PlaneAngle(1));0 -sin(PlaneAngle(1)) cos(PlaneAngle(1))];
     980M=M1*M2;
     981norm_plane=M*[0 0 1]';
     982   
     983end
     984testangle=~isequal(PlaneAngle,[0 0])||~isequal(ObjectData.Coord(1:2),[0 0 ]) ;% && ~test90y && ~test90x;%=1 for slanted plane
    979985
    980986%% mesh sizes DX and DY
     
    12241230            Psi=PlaneAngle(1);
    12251231            Theta=PlaneAngle(2);
    1226             Phi=PlaneAngle(3);
     1232           % Phi=PlaneAngle(3);
    12271233            if testangle && ~test90y && ~test90x;%=1 for slanted plane
    12281234                coord_X=(coord_x *cos(Phi) + coord_y* sin(Phi));
     
    13651371                Psi=PlaneAngle(1);
    13661372                Theta=PlaneAngle(2);
    1367                 Phi=PlaneAngle(3);
     1373               % Phi=PlaneAngle(3);
    13681374                if testangle && ~test90y && ~test90x;%=1 for slanted plane
    13691375                    new_XI=XI*cos(Phi) - YI*sin(Phi)+ObjectData.Coord(1);
  • trunk/src/set_object.m

    r961 r964  
    721721PlaneAngle(1)=str2double(get(handles.num_Angle_1,'String'));%first  angle in degrees
    722722PlaneAngle(2)=str2double(get(handles.num_Angle_2,'String'));%second  angle in degrees
    723 PlaneAngle(3)=str2double(get(handles.num_Angle_3,'String'));%second  angle in degrees
     723%PlaneAngle(3)=str2double(get(handles.num_Angle_3,'String'));%second  angle in degrees
    724724PlaneAngle=(pi/180)*PlaneAngle;
    725 om=norm(PlaneAngle);%norm of rotation angle in radians
    726 if isequal(om,0)
    727     norm_plane=[0 0 1];
    728 else
    729     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
    730     cos_om=cos(om);
    731     sin_om=sin(om);
    732     coeff=OmAxis(3)*(1-cos_om);
    733     %components of the unity vector norm_plane normal to the projection plane
    734     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
    735     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
    736     norm_plane(3)=OmAxis(3)*coeff+cos_om;
    737 end
     725M2=[cos(PlaneAngle(2)) sin(PlaneAngle(2)) 0;-sin(PlaneAngle(2)) cos(PlaneAngle(2)) 0;0 0 1];
     726M1=[1 0 0;0 cos(PlaneAngle(1)) sin(PlaneAngle(1));0 -sin(PlaneAngle(1)) cos(PlaneAngle(1))];
     727M=M1*M2;
     728norm_plane=M*[0 0 1]';
     729
     730% om=norm(PlaneAngle);%norm of rotation angle in radians
     731% if isequal(om,0)
     732%     norm_plane=[0 0 1];
     733% else
     734%     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
     735%     cos_om=cos(om);
     736%     sin_om=sin(om);
     737%     coeff=OmAxis(3)*(1-cos_om);
     738%     %components of the unity vector norm_plane normal to the projection plane
     739%     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
     740%     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
     741%     norm_plane(3)=OmAxis(3)*coeff+cos_om;
     742% end
    738743Coord=get(handles.Coord,'Data');
    739744Coord(3)=Z_value;
Note: See TracChangeset for help on using the changeset viewer.