You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.6 KiB
Matlab

function v1_flankers_gilbert
crop=0;
iterations=20;
plotAng=1;
node=1;
%DEFINE SYNAPTIC WEIGHTS
phases=[0,180]; %even on and off
%phases=[90,270];; %odd only
%phases=[90,270,0,180]; %even and odd
texture=1;
lateral=1;
[w,v,v1Masks,lgnMasks]=filter_definitions_V1_simple_diffGauss([],[],1, [0,0],phases);
if texture
[w,v,v1Masks]=filter_definitions_V1_simple_diffGauss(w,v,1, [v1Masks,0],phases);
phases=[phases;phases];
end
if lateral
[w,v]=filter_definitions_V1_recurrent(w,v,0.5, [0,lgnMasks],phases);
end
[n,m]=size(w);
nTypes=n/8;
%DEFINE TEST IMAGES
%for FF modulation
spacing=2;
%for recurrent modulation
spacing=5
%Im=image_gilbert_simple(spacing);
Im=image_gilbert(spacing);
%find location of centre of RF
xcoord=mean(find(max(Im{1})>0.75));
ycoord=mean(find(max(Im{1}')>0.75));
if phases(1,1)==90, xcoord=xcoord-2, end
if phases(1,1)==270, xcoord=xcoord+2, end
clf
for k=1:length(Im)
fprintf(1,'.%i.',k);
I=1-Im{k};
[X]=preprocess_V1_input(I);
[a,b]=size(I);
%plot original image
maxsubplot(1+nTypes,length(Im),k), plot_cropped_image(I,crop,[0,1]);
%perform competition
[Y,E,R,Ytrace]=dim_activation_conv_recurrent(w,X,[],iterations,v);
resp=mean(Ytrace{node},3);
for j=1:nTypes
maxsubplot(1+nTypes,length(Im),k+j*length(Im)), plot_cropped_image(Y{plotAng+8*(j-1)},crop,[0,0.25]),
end
sc(k)=resp(xcoord,ycoord);
end
figure,
clf
axes('Position',[0.145,0.55,0.79,0.4]),bar([1:length(Im)],sc,'b')
top=max(max(sc));
axis([0.25,9.75,0,1.05*top])
set(gca,'XTickLabel',[],'FontSize',20,'Box','off');
ylabel('Response')
crop=0;
for i=1:length(Im)
maxsubplot(7,12,38+i);plot_cropped_image(1-Im{i},crop,[0,1])
end