
%plots the effect of the independent components, analogously to Fig. 1 in
%supplemental material

%Fig. 3 supplemental material

load fi9i


load unitsphere2562.mat
load Fl15


averagei=SPHARMaverage(Fl,sphere, 15,0);


 r=find(Fl(1).x); %donde colocar los no ceros

for j=1:9
f=1;
 [averagecompo,averagecompovf]=dibujopca(Fl,sphere, 15,0, [f f f],1,fi(:,j)',r);%use functions from surfstats


%scale=3;
%dibujopcavector(averagei,averagecompovf,sphere, 15,0,scale);


dibujopcacolor2(averagei,averagecompovf)

lighting none

pause
close all

end


%Figure 3 supplemental material


im1=imread('fica1.tif');
im2=imread('fica2.tif');
im3=imread('fica3.tif');


im1b=im1(25:395,95:515,:);
im2b=im2(25:395,105:515,:);
im3b=im3(25:395,105:515,:);

im4=[im1b im2b im3b];
imshow(im4)



im1=imread('fica4.tif');
im2=imread('fica5.tif');
im3=imread('fica6.tif');


im1b=im1(25:395,95:515,:);
im2b=im2(25:395,105:515,:);
im3b=im3(25:395,105:515,:);

im5=[im1b im2b im3b];
im6=[im4;im5];
imshow(im6)


im1=imread('fica7.tif');
im2=imread('fica8.tif');
im3=imread('fica9.tif');


im1b=im1(25:395,95:515,:);
im2b=im2(25:395,105:515,:);
im3b=im3(25:395,105:515,:);

im7=[im1b im2b im3b];
im8=[im6;im7];
imshow(im8)

%save im8 as ficcaeffect

%CN vs MCI

load fi6i


load unitsphere2562.mat
load Fl15

Fl=Fl(1:18,:);

averagei=SPHARMaverage(Fl,sphere, 15,0);


 r=find(Fl(1).x); %donde colocar los no ceros

for j=1:6
f=1;
 [averagecompo,averagecompovf]=dibujopca(Fl,sphere, 15,0, [f f f],1,fi(:,j)',r);


%scale=3;
%dibujopcavector(averagei,averagecompovf,sphere, 15,0,scale);


dibujopcacolor2(averagei,averagecompovf)

lighting none



end

