d = read_dicom(filename) Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function dcm = direction_cos(d) 0002 % 0003 % d = read_dicom(filename) 0004 % 0005 % 0006 % Copyright (C) 2011, ATR All Rights Reserved. 0007 % License : New BSD License(see VBMEG_LICENSE.txt) 0008 0009 X=getfield(d,'image_orientation'); 0010 0011 Ax=X(1); 0012 Ay=X(2); 0013 Az=X(3); 0014 0015 Bx=X(4); 0016 By=X(5); 0017 Bz=X(6); 0018 0019 Cx=Ay*Bz-Az*By; 0020 Cy=Az*Bx-Ax*Bz; 0021 Cz=Ax*By-Ay*Bx; 0022 0023 dcm=[Ax,Bx,Cx;Ay,By,Cy;Az,Bz,Cz;]; 0024 0025 clear X Ax Ay Az Bx By Bz Cx Cy Cz