Changeset 212 for trunk/src/proj_field.m
- Timestamp:
- Mar 2, 2011, 10:45:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/proj_field.m
r206 r212 949 949 sin_om=0; 950 950 if isfield(ObjectData,'Angle')&& isequal(size(ObjectData.Angle),[1 3])&& ~isequal(ObjectData.Angle,[0 0 0]) 951 PlaneAngle= ObjectData.Angle;951 PlaneAngle=(pi/180)*ObjectData.Angle; 952 952 om=norm(PlaneAngle);%norm of rotation angle in radians 953 953 OmAxis=PlaneAngle/om; %unit vector marking the rotation axis 954 cos_om=cos( pi*om/180);955 sin_om=sin( pi*om/180);954 cos_om=cos(om); 955 sin_om=sin(om); 956 956 coeff=OmAxis(3)*(1-cos_om); 957 957 %components of the unity vector norm_plane normal to the projection plane … … 1449 1449 if NbDim==2 %2D case 1450 1450 [X,Y]=meshgrid(coord_x_proj,coord_y_proj);%grid in the new coordinates 1451 XIMA=ObjectData.Coord(1,1)+(X)*cos(P hi)-Y*sin(Phi);%corresponding coordinates in the original image1452 YIMA=ObjectData.Coord(1,2)+(X)*sin(P hi)+Y*cos(Phi);1451 XIMA=ObjectData.Coord(1,1)+(X)*cos(PlaneAngle(3))-Y*sin(PlaneAngle(3));%corresponding coordinates in the original image 1452 YIMA=ObjectData.Coord(1,2)+(X)*sin(PlaneAngle(3))+Y*cos(PlaneAngle(3)); 1453 1453 XIMA=(XIMA-minAX)/DXinit+1;% image index along x 1454 1454 YIMA=(-YIMA+maxAY)/DYinit+1;% image index along y … … 1536 1536 UName=FieldData.ListVarName{ivar_U}; 1537 1537 VName=FieldData.ListVarName{ivar_V}; 1538 eval(['ProjData.' UName '=cos(P hi)*ProjData.' UName '+ sin(Phi)*ProjData.' VName ';'])1539 eval(['ProjData.' VName '=cos(Theta)*(-sin(P hi)*ProjData.' UName '+ cos(Phi)*ProjData.' VName ');'])1538 eval(['ProjData.' UName '=cos(PlaneAngle(3))*ProjData.' UName '+ sin(PlaneAngle(3))*ProjData.' VName ';']) 1539 eval(['ProjData.' VName '=cos(Theta)*(-sin(PlaneAngle(3))*ProjData.' UName '+ cos(PlaneAngle(3))*ProjData.' VName ');']) 1540 1540 if ~isempty(ivar_W) 1541 1541 WName=FieldData.ListVarName{ivar_W};
Note: See TracChangeset
for help on using the changeset viewer.