
if strcmp(action,'init_old')

   P = spm_get([Inf],'SPM*.mat',{['select SPM or SPM_cgf struct']});

   load(P{1},'VY')

   if exist('Clus_Pos')
	Pos=[];
	for k = 1:length(Clus_Pos)
		Pos = cat(1,Pos,Clus_Pos{k}(:,1:3));
		Clus_size(k) = size(Clus_Pos{k},1);
	end
	%Pos(:,2) = DimFonc+1 - Pos(:,2) ;
   else
	tmp = Pos;
	Pos(:,1) = tmp(:,2);
	Pos(:,2) = DimFonc+1 -tmp(:,1);   
   end

         %si on veux afficher les xyz utilisees dans spm_sample_vol
		%Pos(:,2) = xyz(:,1);   
         	%Pos(:,1) = 65-xyz(:,2);

   for t=1:size(VY,1)
   	Tempo(:,t) = spm_sample_vol(VY(t),Pos(:,1),Pos(:,2),Pos(:,3),0);
   end

if(0)
   load(P{1},'VY','Vbeta','xX')
   cwd = pwd;
   cd(Result_SPM)
   nb_beta = length(Vbeta);
   for b=1:nb_beta
	Vbeta_s(b) = spm_vol(Vbeta{b});
   end

   for b=1:nb_beta
      beta = spm_sample_vol(Vbeta_s(b),Pos(:,1),Pos(:,2),Pos(:,3),0);
      Beta(:,:,b) = beta* xX.X(:,b)';
   end
   cd(cwd)
end

%   plotmoy(Tempo,Clus_size, Volume.Clus_name)
plotmoy(Tempo)
   
elseif strcmp(action,'init');

   P = spm_get([Inf],'SPM*.mat',{['select SPM or SPM_cgf struct']});
   if isempty(P)
     P ={'/home/romain/results/SPM/language/romLang/Ser6/SPM.mat'};
   end
   
   load(P{1},'VY')

   s = struct('XYZ',Pos','mat',Volume(hdl.Num).M);
   roi_o = maroi_pointlist(s,'vox');

   keyboard
[y t ] = getdata(roi_o,VY)


elseif strcmp(action,'panel');
  	Ser_disp = str2num(get(hdl.tpos_hdl.Series_disp,'string'));
	C = colormap;
	tname = get(hdl.tpos_hdl.listCon,'string');
	tname = tname{get(hdl.tpos_hdl.listCon,'value')};
	name = [Volume(hdl.Num).titre, tname];
	panel(3,4,Volume(hdl.Num).data,C,NbCoupe,NbLigne,DimFonc,Tpos,Ser_disp,name)


elseif strcmp(action,'saveBig');
   Big = Bigini(Pos,8);
   
   Big(2) = ordBig(Big(1),13);
   Big(3) = moyBig(Big(2));
 %  Big(4) = moyBig(Big(3));

   cd data/temporel/Big
   [Fname, Pname] = uiputfile('*.mat', 'where');
   if Fname
	   Fname = cat(2,Pname,Fname)
   	Fname = cat(2,'save ',Fname,' Big');
   	eval(Fname);
   end
   cd ../../..
   

end;
