Home > vbmeg > demo > test_scripts > sbi > direction_cos.m

direction_cos

PURPOSE ^

SYNOPSIS ^

function dcm = direction_cos(d)

DESCRIPTION ^

 d = read_dicom(filename)


 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005