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.

93 lines
2.6 KiB
Matlab

function V1_cross_orient_orient_diam
clear
crop=15;
grating_wavel=6;
patch_diams=[7,13,19];
iterations=12;
contrast=0.25;
phase=0;
grating_angles=[-45:15:45];
node=1;
[wFFon,wFFoff]=dim_conv_V1_filter_definitions;
clf
j=0;
for diam=patch_diams
j=j+1;
i=0;
clear Ion Ioff
for angle=grating_angles
i=i+1;
fprintf(1,'.%i.',i);
%cross-orientation simulus
I=image_cross_orientation_sine_circular(diam,20,grating_wavel,grating_wavel,...
0,angle,phase,phase,contrast,contrast);
[a,b]=size(I);
[Ion,Ioff]=preprocess_image(I);
%plot original image
maxsubplot(3,length(grating_angles),i),
imagesc(I(crop+1:a-crop,crop+1:b-crop),[0,1]);
axis('equal','tight'), set(gca,'XTick',[],'YTick',[],'FontSize',11);
drawnow;
%initial response without competition
[y,ron,roff,eon,eoff,Y]=dim_conv_on_and_off(wFFon,wFFoff,Ion,Ioff,1);
y=mean(Y,4);
maxsubplot(3,length(grating_angles),i+length(grating_angles)),
imagesc(y(crop+1:a-crop,crop+1:b-crop,node),[0,0.01]),
axis('equal','tight'), set(gca,'XTick',[],'YTick',[],'FontSize',11);
drawnow;
%perform competition
[y,ron,roff,eon,eoff,Y]=dim_conv_on_and_off(wFFon,wFFoff,Ion,Ioff,iterations);
y=mean(Y,4);
maxsubplot(3,length(grating_angles),i+2*length(grating_angles)),
imagesc(y(crop+1:a-crop,crop+1:b-crop,node),[0,0.01]),
axis('equal','tight'), set(gca,'XTick',[],'YTick',[],'FontSize',11);
drawnow;
sc(j,i)=y(ceil(a/2),ceil(b/2),node);
end
end
%for j=1:3, sc(j,:)=sc(j,:)./max(sc(j,:)); end
figure(1),clf
subplot(3,2,[4,6])
plot(grating_angles,sc(1,:),'g-d','LineWidth',4,'MarkerSize',12,'MarkerFaceColor','w');
hold on
plot(grating_angles,sc(2,:),'r-o','LineWidth',4,'MarkerSize',12,'MarkerFaceColor','w');
plot(grating_angles,sc(3,:),'b-s','LineWidth',4,'MarkerSize',12,'MarkerFaceColor','w');
axis([-45,45,0,0.022])
set(gca,'XTick',[-45,0,45],'YTick',[0:0.01:0.02],'FontSize',20,'Box','off');
xlabel('Mask Orientation (degrees)'),ylabel('Response')
figure(2),clf
maxsubplot(5,2,8)
patch_diam=13;
maxdiam=patch_diam;
spacingh=25;
L=zeros(maxdiam+2,2*spacingh+maxdiam+2)+0.5;
centv=ceil(maxdiam/2)+1;
centh=ceil(maxdiam/2)+1;
gal=length(grating_angles);
for angle=grating_angles([1,ceil(gal/2),gal])
phase=0;
I=image_cross_orientation_sine_circular(patch_diam,0,grating_wavel,grating_wavel,...
0,angle,phase,phase,contrast,contrast);
%cross-orientation simulus
[a,b]=size(I);
L(centv-floor(a/2):centv+floor(a/2),centh-floor(a/2):centh+floor(a/2))=I;
centh=centh+spacingh;
end
imagesc(L);
axis('equal','off')
axis([-0,80,0,maxdiam+2])
hold on
cmap=colormap('gray');
%cmap=1-cmap;
%colormap(cmap);