Hi

You can do something like this (assuming your seed masks are called mask<n>.nii.gz and you used them in order 1-12):

addpath([getenv('FSLDIR') '/etc/matlab']);
M1=full(spconvert(load('fdt_matrix1.dot')));
M=zeros(12);

fi=1;
for i=1:12
ni=length(find(read_avw(['mask' num2str(i)])));
fj=1;
for j=1:12
nj=length(find(read_avw(['mask' num2str(j)])));
M(i,j) = sum(sum(M1(fi:fi+ni-1,fj:fj+nj-1)));
fj=fj+nj;
end
fi=fi+ni;
end


Cheers,
Saad


On 31 Jul 2013, at 20:10, avner meoded <[log in to unmask]> wrote:

Hi FSL listmemebers

I am currently applying the probtrackx network mode with matrix 1.
 I have multiple masks- 12; when I load the matrix file in matlab the marrix is 1046x1046. My question is how can I arrange this matrix so I can obtain the 12x12 dimensions like the number of the masks
Thanks
Avner

--
Saad Jbabdi
University of Oxford, FMRIB Centre

JR Hospital, Headington, OX3 9DU, UK
(+44)1865-222466  (fax 717)
www.ndcn.ox.ac.uk/team/researchers/saad-jbabdi