Hello,

I ran mris_preproc on 56 subjects and then graphed the concatenated image.  I also read this image into matlab and did the averaging using matlab, and then graphed the resulting image.  When I did this, the two average pictures were slightly different.  I thought that mris_preproc just simply averages all the subjects into common space.  I noticed that its vector in matlab keeps the thickness value for all vertex's for all 56 subjects.  I want to have the matlab capability for some custom processing I am doing, but the discrepancy leads me to think that mris_preproc is not a simple average.  Can anyone elucidate this for me?  Thank you!

Matlab script.  Only place I would suspect a wrong assumption is when I throw out the rest of the subjects at curv4=curv3(1,:,:,1)
%Select your input thickness file
path='/mnt/users/Jeff/fs/lc/HIV/pass2pics/416/diff/nc.rh.ave.mgh';

%Read the thickness file
curv=MRIread(path);

%Select the volume attribute
curv2=curv.vol;

%Create a duplicate thickness array for manipulation
curv3=curv2;

%Get the number of concatanated subjects
tmp=size(curv2);
m=tmp(4)
clear 'tmp'

%Sum each vertex for all your subjects
for im=2:m   
    for in=1:7
        curv3(1,:,in,1)=curv3(1,:,in,1)+curv2(1,:,in,im);
    end
end

%Select just the first frame
curv4=curv3(1,:,:,1);

%Compute the average thickness
curv.vol=curv4/m;

%Write to thickness file
MRIwrite(curv,'nc.rh.ave1.tmp.mgh');


Rediscover HotmailŪ: Get quick friend updates right in your inbox. Check it out.