source: trunk/src/script_test_phys.m @ 1129

Last change on this file since 1129 was 1116, checked in by sommeria, 3 years ago

bug coorected in proj_field, script_test_phys.m added

File size: 1.3 KB
Line 
1%XmlData=xml2struct('/home/users/sommeria/UVMAT_DEMO_SOURCES/UVMAT_DEMO07_GeometryCalibration/multiple_planes/Dalsa1.xml');
2GeometryCalib.CalibrationType='3D_quad';
3GeometryCalib.fx_fy=[4.0839e+03 4.0839e+03];
4GeometryCalib.Cx_Cy=[511.5000 512.5000];
5GeometryCalib.kc=0.5;
6GeometryCalib.CoordUnit='cm';
7GeometryCalib.Tx_Ty_Tz=[-47.9957 -48.4644 476.6510];
8GeometryCalib.R=[0.9713    0.0518   -0.2320; -0.0813    0.9895   -0.1198; -0.2233   -0.1352   -0.9653];
9%GeometryCalib.R=[0.9983    0.0485   -0.0332;-0.0500    0.9976   -0.0470;-0.0308   -0.0485   -0.9983]
10Slice.SliceCoord=[50 30 100];
11Slice.SliceAngle=[10 20 0];
12 
13% Xpx=1000
14% Ypx=1000
15Xpx=1000
16Ypx=1000
17[Xphys,Yphys,Zphys]=phys_XYZ(GeometryCalib,Slice,Xpx,Ypx,1)
18[NewXpx,NewYpx]=px_XYZ(GeometryCalib,[],Xphys,Yphys,Zphys);
19disp(['error= '])
20disp([NewXpx-Xpx NewYpx-Ypx])
21
22%
23%
24% om=norm(GeometryCalib.SliceAngle);%norm of rotation angle in radians
25%         OmAxis=GeometryCalib.SliceAngle/om; %unit vector marking the rotation axis
26%         cos_om=cos(pi*om/180);
27%         sin_om=sin(pi*om/180);
28%         coeff=OmAxis(3)*(1-cos_om);
29%         norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
30%         norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
31%         norm_plane(3)=OmAxis(3)*coeff+cos_om
32%         
33%         M=rodrigues(XmlData.GeometryCalib.SliceAngle*pi/180);
34%         norm_plane=M*[0 0 1]'
Note: See TracBrowser for help on using the repository browser.