Home > fmri > utils > QA.m

QA

PURPOSE ^

SYNOPSIS ^

function status = QA(inDir)

DESCRIPTION ^

 QA(inDir)

 Souheil J. Inati  
 Dartmouth College 2000

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function status = QA(inDir)
0002 %
0003 % QA(inDir)
0004 %
0005 % Souheil J. Inati
0006 % Dartmouth College 2000
0007 
0008 % Create the name of the first file in inDir
0009 firstfile = fullfile(inDir,'I.001');
0010 
0011 % Read the header
0012 [su_hdr,ex_hdr,se_hdr,im_hdr,pix_hdr,im_offset] = GE_readHeader(firstfile);
0013 
0014 nX =  im_hdr.imatrix_X; % X Voxels
0015 nY =  im_hdr.imatrix_Y; % Y Voxels
0016 nZ =  im_hdr.slquant;   % Z Voxels
0017 volSize = [nX nY nZ];
0018 adwcount = im_hdr.user9;
0019 
0020 % Loop over the volumes until there is no more looping to be done.
0021 
0022 % Loop over the passes (volumes)
0023 % Initialize
0024 done = 0;
0025 imageVol = zeros(nX,nY,nZ);
0026 vec = zeros(adwcount,1);
0027 
0028 xa = floor(nX/2-15);
0029 xb = ceil(nX/2+15);
0030 ya = floor(nY/2-15);
0031 yb = ceil(nY/2+15);
0032 za = floor(nZ/2-2);
0033 zb = ceil(nZ/2+2);
0034 nx = xb-xa+1;
0035 ny = yb-ya+1;
0036 nz = zb-za+1;
0037 subVol = zeros(nx,ny,nz);
0038 
0039 for i = 1:adwcount
0040   % Read in the volume
0041   [imageVol, lastfile] = GE_readVolume(inDir, i+1, volSize, 16, ...
0042                        im_offset);
0043   subVol = imageVol(xa:xb,ya:yb,za:zb);
0044 vec(i) = mean(subVol(:));
0045   % Done with vol
0046   fprintf('volnum = %d\tread %s\n',i,lastfile);
0047 
0048 end % Run loop
0049 
0050 figure
0051 plot(im_hdr.tr*1E-6*(1:adwcount),vec/mean(vec))
0052 r = axis;
0053 text((r(2)+r(1))/2, (r(3)+r(4))/2+0.2*(r(4)-r(3)), sprintf('Mean Signal = %f\nStandard Dev = %f',mean(vec(75:adwcount)),std(vec(75:adwcount)/mean(vec(75:adwcount)))));
0054 title(inDir)
0055 
0056 return
0057 
0058 
0059 
0060 
0061 
0062 
0063 
0064

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003