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.

143 lines
5.6 KiB
Matlab

function expts_remapping
%define network for performing saccades
[W,V,interconnects]=define_network(1);
%choose node from which to record
[angles,ranges,partitions,values]=simulate_agent();
retinaRF=-30;
panRF=30;
indR=find(ranges.Rcentres==retinaRF);
indE=find(ranges.Ecentres==panRF);
node=(indR-1)*length(ranges.Ecentres)+indE;
topresp=0.3;
figoff=100;
%no saccade: visual simulus onset in RF, no saccade
vistargetseq=[NaN,retinaRF,retinaRF,NaN,NaN];
eyepanseq=[panRF,panRF,panRF,panRF,panRF];
[yTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects);
tracelen=size(yTrace,2);
figured(figoff+1),clf,subplot(4,1,1), plot(yTrace(node,:)','LineWidth',2),
axis([1,tracelen,0,topresp]),
plot_vision_duration(vistargetseq,tracelen,topresp);
title('no saccade')
set(gca,'XTickLabel',[])
%future RF: visual target appears in location of future RF prior to saccade, saccade brings target into RF
vistargetseq=[NaN,0,0,retinaRF,retinaRF];
eyepanseq=[0,0,0,panRF,panRF];
[yTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects);
tracelen=size(yTrace,2);
figured(figoff+1),subplot(4,1,2), plot(yTrace(node,:)','LineWidth',2),
axis([1,tracelen,0,topresp]),
plot_saccade_onset(eyepanseq,panRF,tracelen);
plot_vision_duration(vistargetseq,tracelen,topresp);
title('future RF')
set(gca,'XTickLabel',[])
%current RF: visual target appears in location of current RF, saccade moves RF to blank location
vistargetseq=[NaN,retinaRF,retinaRF,0,0];
eyepanseq=[panRF,panRF,panRF,0,0];
[yTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects);
tracelen=size(yTrace,2);
figured(figoff+1),subplot(4,1,3), plot(yTrace(node,:)','LineWidth',2),
axis([1,tracelen,0,topresp]),
plot_saccade_onset(eyepanseq,0,tracelen);
plot_vision_duration(vistargetseq,tracelen,topresp);
title('current RF')
ylabel(' response');
set(gca,'XTickLabel',[])
%saccade only: saccade in the absence of any visual stimulus
vistargetseq=[NaN,NaN,NaN,NaN,NaN];
eyepanseq=[0,0,0,panRF,panRF];
[yTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects);
tracelen=size(yTrace,2);
figured(figoff+1),subplot(4,1,4), plot(yTrace(node,:)','LineWidth',2),
axis([1,tracelen,0,topresp]),
plot_saccade_onset(eyepanseq,panRF,tracelen);
title('saccade only')
xlabel('time (iterations)');
set(gcf,'PaperSize',[9 10],'PaperPosition',[0.5 0.5 8.5 9.5],'PaperOrientation','Portrait');
print -dpdf remapping.pdf
recordlen=300;
%future: visual stimulus flashed in location occupied by RF after saccade
figured(figoff+2),clf,
eyepanseq=[0,0,0,0,panRF,panRF,panRF,panRF];
seqlen=length(eyepanseq);
numtrials=seqlen-2;
for k=1:numtrials
vistargetseq=NaN.*ones(1,seqlen);
vistargetseq(k)=-eyepanseq(k);
[yTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects);
tracelen=size(yTrace,2);
figured(figoff+2),maxsubplot(numtrials+2,1,1+k,0.2); plot(yTrace(node,:)','LineWidth',2),
axis([1,tracelen,0,topresp])
if k>1, set(gca,'XTickLabel',[]), else, xlabel('time (iterations)'); end
if k==floor(numtrials/2), ylabel(' response'); end
if k==numtrials, title('future RF'); end
vOnset=plot_vision_duration(vistargetseq,tracelen,topresp);
plot_saccade_onset(eyepanseq,panRF,tracelen);
futureV(k)=mean(yTrace(node,vOnset+50:min(tracelen,vOnset+50+recordlen)));
end
set(gcf,'PaperSize',[9 10],'PaperPosition',[0.5 0.5 8.5 9.5],'PaperOrientation','Portrait');
print -dpdf remapping_future.pdf
%current: visual stimulus flashed in location occupied by RF prior to saccade
figured(figoff+3),clf,
eyepanseq=[panRF,panRF,panRF,panRF,0,0,0,0];
seqlen=length(eyepanseq);
numtrials=seqlen-2;
for k=1:numtrials
vistargetseq=NaN.*ones(1,seqlen);
vistargetseq(k)=-eyepanseq(k);
[yTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects);
tracelen=size(yTrace,2);
figured(figoff+3),maxsubplot(numtrials+2,1,1+k,0.2); plot(yTrace(node,:)','LineWidth',2),
axis([1,tracelen,0,topresp])
if k>1, set(gca,'XTickLabel',[]), else, xlabel('time (iterations)'); end
if k==floor(numtrials/2), ylabel(' response'); end
if k==numtrials, title('current RF'); end
vOnset=plot_vision_duration(vistargetseq,tracelen,topresp);
sOnset=plot_saccade_onset(eyepanseq,0,tracelen);
currentV(k)=mean(yTrace(node,vOnset+50:min(tracelen,vOnset+50+recordlen)));
end
set(gcf,'PaperSize',[9 10],'PaperPosition',[0.5 0.5 8.5 9.5],'PaperOrientation','Portrait');
print -dpdf remapping_current.pdf
figured(figoff+4),clf,
plot(futureV,'r-o','LineWidth',3,'MarkerSize',8,'MarkerFaceColor','w','Color',[0.6350 0.0780 0.1840]),
hold on,
plot(currentV,'g-s','LineWidth',3,'MarkerSize',8,'MarkerFaceColor','w','Color',[0.4660 0.6740 0.1880]);
legend({'future','current'},'FontSize',11,'Location','NorthOutside');legend('boxoff')
plot_saccade_onset(eyepanseq,0,seqlen);
axis([1,numtrials,0,topresp/2])
ylabel({'response 50-300 iterations','after stimulus onset'});
xlabel({'time from saccade onset',' to stimulus offset (iterations)'});
set(gca,'XTick',[1:numtrials],'XTickLabel',int2str(100.*[1:numtrials]'-sOnset))
set(gcf,'PaperSize',[7 9],'PaperPosition',[0.5 0.5 6.5 8.5],'PaperOrientation','Portrait');
print -dpdf remapping_response_shift.pdf
function sOnset=plot_saccade_onset(eyepanseq,newpanval,tracelen)
sOnset=min(find(eyepanseq==newpanval))-0.5;
sOnset=sOnset*tracelen/length(eyepanseq);
hold on, plot([sOnset,sOnset],[0,1],'k--')
function vOnset=plot_vision_duration(vistargetseq,tracelen,topresp)
vOnset=min(find(~isnan(vistargetseq)))-1;
vOnset=vOnset*tracelen/length(vistargetseq);
vOffset=max(find(~isnan(vistargetseq)));
vOffset=vOffset*tracelen/length(vistargetseq);
hold on, plot([vOnset,vOffset],topresp.*[0.95,0.95],'k-','LineWidth',5)