% Demo
%load the data matrix 'A', durations vector 'dur'  and frame time vector 'tm'. An example for  one slice. the first frame is remove because it is
%too noisy.

dim=size(A);
dur=dur(2:end); % remove first frame
tm=tm(2:end);   % remove first frame
grpnum=6;
distopt='timeL1';
cen_avg='avg';
swfast=1;

[B,centTAC,numflag]=petcluster(A,dim,dur,tm,grpnum,distopt,cen_avg,swfast);
numflag
figure, F=imagesc(reshape(B,128,128))
numflag =

         356           2
         517           3
         359           4
        1154           5
        2706           6
         115           7


F =

  643.0032