0001 function [A,n1]=bat_read_DICOM_description(filename,dx,dy,dz,A,n0)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 d=read_dicom(filename);
0015
0016
0017 dcm = direction_cos(d);
0018
0019 ip=getfield(d,'image_position');
0020 ps=getfield(d,'pixel_spacing');
0021 st=getfield(d,'slice_thickness');
0022
0023
0024 A(:,1)=A(:,1)+dx-1;
0025 A(:,2)=A(:,2)+dy-1;
0026 A(:,3)=A(:,3)+dz-1;
0027
0028
0029 A(:,1)=A(:,1).*ps(1);
0030 A(:,2)=A(:,2).*ps(2);
0031 A(:,3)=A(:,3).*st;
0032 n0(:,1)=n0(:,1).*ps(1);
0033 n0(:,2)=n0(:,2).*ps(2);
0034 n0(:,3)=n0(:,3).*st;
0035
0036
0037 A=dcm*A';
0038 A=A';
0039 n1=dcm*n0';
0040 n1=n1';
0041
0042
0043 A(:,1)=A(:,1)+ip(1);
0044 A(:,2)=A(:,2)+ip(2);
0045 A(:,3)=A(:,3)+ip(3);
0046
0047 clear d