|
|
@ -1,245 +1,233 @@ |
|
|
|
function AfIm_Exp_Rivalry(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,Simu_chck) |
|
|
|
function AfIm_Exp_Rivalry(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,Simu_chck) |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
try |
|
|
|
assignin('base','Stop_Press',0)% this works for the STOP experiment button |
|
|
|
assignin('base','Stop_Press',0)% this works for the STOP experiment button |
|
|
|
|
|
|
|
|
|
|
|
% Check that Psychtoolbox is properly installed, switch to unified KbName's |
|
|
|
% Check that Psychtoolbox is properly installed, switch to unified KbName's |
|
|
|
% across operating systems, and switch color range to normalized 0 - 1 range: |
|
|
|
% across operating systems, and switch color range to normalized 0 - 1 range: |
|
|
|
PsychDefaultSetup(2); |
|
|
|
PsychDefaultSetup(2); |
|
|
|
|
|
|
|
|
|
|
|
saveFile = sprintf('%s_afterimage', subName) |
|
|
|
[curDir,~,~] = fileparts(matlab.desktop.editor.getActiveFilename); |
|
|
|
aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); |
|
|
|
saveFile = sprintf('%s/../A Outputs/%s_afterimage', curDir, subName); |
|
|
|
|
|
|
|
|
|
|
|
fp = fopen(saveFile, 'at'); |
|
|
|
fp = fopen(saveFile, 'at'); |
|
|
|
|
|
|
|
|
|
|
|
%% Color information, load hfp data and color calibration |
|
|
|
%% Color information, load hfp data and color calibration |
|
|
|
|
|
|
|
hfpFile = sprintf('%s/../A Outputs/%sHFP', curDir, subName); |
|
|
|
aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); |
|
|
|
load(hfpFile, '-mat'); |
|
|
|
hfpFile = sprintf('%sHFP', subName); |
|
|
|
hfpRG = rg_avg; |
|
|
|
load(hfpFile, '-mat') |
|
|
|
hfpBG = bg_avg; |
|
|
|
hfpRG = rg_avg; |
|
|
|
|
|
|
|
hfpBG = bg_avg; |
|
|
|
load('colorCalFile1.mat'); |
|
|
|
|
|
|
|
fprintf('\nLast calibration was %s\n', describe.date) |
|
|
|
|
|
|
|
pix = pix/1001; |
|
|
|
|
|
|
|
% maxLum = 20; %cd/m^2 |
|
|
|
% cd(a); % return to program folder. |
|
|
|
|
|
|
|
Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); |
|
|
|
contFile = sprintf('%s/../A Outputs/%s_ContMatch', curDir, subName); |
|
|
|
load colorCalFile1.mat |
|
|
|
load(contFile, '-mat'); |
|
|
|
fprintf('\nLast calibration was %s\n', describe.date) |
|
|
|
|
|
|
|
pix = pix/1001; |
|
|
|
% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order |
|
|
|
|
|
|
|
% % % % lumMod = fliplr(Final_lumMod_avg); |
|
|
|
|
|
|
|
% % % % |
|
|
|
cd(aa) ;% output folder |
|
|
|
% % % % sCont = [.8 .65 .5 .35]; |
|
|
|
aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); |
|
|
|
% % % % nCont = 4; |
|
|
|
% aa = cd('D:\Dropbox\Luminotecnia\2017\Chicago Lab files\2 Experiments\Color AfterImage_Exp_Room_150\2nd\1 Programs\A Outputs') |
|
|
|
|
|
|
|
% maxLum = 20; %cd/m^2 |
|
|
|
% lCont = Final_lCont_avg(:,4:5); |
|
|
|
|
|
|
|
% lumMod = Final_lumMod_avg(:,4:5); |
|
|
|
contFile = sprintf('%s_ContMatch', subName); |
|
|
|
% sCont = [.5 .65 |
|
|
|
cd |
|
|
|
% .5 .65 |
|
|
|
load(contFile, '-mat') |
|
|
|
% .5 .65 |
|
|
|
|
|
|
|
% .5 .65]; |
|
|
|
% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order |
|
|
|
% |
|
|
|
% % % % lumMod = fliplr(Final_lumMod_avg); |
|
|
|
% nCont = 2; |
|
|
|
% % % % |
|
|
|
|
|
|
|
% % % % sCont = [.8 .65 .5 .35]; |
|
|
|
% lCont = Final_lCont_avg(3:6); |
|
|
|
% % % % nCont = 4; |
|
|
|
% lumMod = Final_lumMod_avg(3:6); |
|
|
|
|
|
|
|
% sCont = [.5 .65 |
|
|
|
% lCont = Final_lCont_avg(:,4:5); |
|
|
|
% .5 .65 |
|
|
|
% lumMod = Final_lumMod_avg(:,4:5); |
|
|
|
% .5 .65 |
|
|
|
% sCont = [.5 .65 |
|
|
|
% .5 .65]; |
|
|
|
% .5 .65 |
|
|
|
% sCont = Final_sCont_ref; |
|
|
|
% .5 .65 |
|
|
|
|
|
|
|
% .5 .65]; |
|
|
|
lCont = Final_lCont_avg; |
|
|
|
% |
|
|
|
lumMod = Final_lumMod_avg; |
|
|
|
% nCont = 2; |
|
|
|
sCont = Final_sCont_ref; |
|
|
|
|
|
|
|
|
|
|
|
% lCont = Final_lCont_avg(3:6); |
|
|
|
nCont = size(sCont,2); |
|
|
|
% lumMod = Final_lumMod_avg(3:6); |
|
|
|
nBckg_Chro = size(Bckg_Chro,1); |
|
|
|
% sCont = [.5 .65 |
|
|
|
|
|
|
|
% .5 .65 |
|
|
|
% white = [.665 1]; |
|
|
|
% .5 .65 |
|
|
|
blackLut = [0 0 0]; |
|
|
|
% .5 .65]; |
|
|
|
redLut = [.8 0 0]; |
|
|
|
% sCont = Final_sCont_ref; |
|
|
|
|
|
|
|
|
|
|
|
% Bckg_Chro = Final_lCont_avg(:,1:2) |
|
|
|
lCont = Final_lCont_avg; |
|
|
|
|
|
|
|
lumMod = Final_lumMod_avg; |
|
|
|
%% Save Session Information |
|
|
|
sCont = Final_sCont_ref; |
|
|
|
|
|
|
|
|
|
|
|
theDate = datestr(now(),'mm/dd/yyyy HH:MM:SS'); |
|
|
|
nCont = size(sCont,2); |
|
|
|
% a = '/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/4 ColBackg AI' ;% folder where the program is. |
|
|
|
nBckg_Chro = size(Bckg_Chro,1); |
|
|
|
infoFile = sprintf('%s/../A Outputs/%s_SessionsInfo', curDir, subName); |
|
|
|
|
|
|
|
|
|
|
|
% white = [.665 1]; |
|
|
|
%aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); % folder where the program is. |
|
|
|
blackLut = [0 0 0]; |
|
|
|
|
|
|
|
redLut = [.8 0 0]; |
|
|
|
checkfile = exist(infoFile, 'file'); |
|
|
|
|
|
|
|
fo = fopen(infoFile, 'at'); |
|
|
|
% Bckg_Chro = Final_lCont_avg(:,1:2) |
|
|
|
if checkfile == 0 % if file doesn't exist, then print the following header: |
|
|
|
|
|
|
|
fprintf(fo,'Subject\t Date\t Time\t Lum\t nBckg_Chro\t nCont\t nRep\t l_\t s_\t lum_\t ls45\t ls135\t luml45\t luml135\t lums45\t luml135\n'); |
|
|
|
%% Save Session Information |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
theDate = datestr(now(),'mm/dd/yyyy HH:MM:SS') |
|
|
|
|
|
|
|
% a = '/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/4 ColBackg AI' ;% folder where the program is. |
|
|
|
|
|
|
|
infoFile = sprintf('%s_SessionsInfo', subName) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); ;% folder where the program is. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkfile = exist(infoFile, 'file') |
|
|
|
|
|
|
|
fo = fopen(infoFile, 'at') |
|
|
|
|
|
|
|
if checkfile == 0 % if file doesn't exist, then print the following header: |
|
|
|
|
|
|
|
fprintf(fo,'Subject\t Date\t Time\t Lum\t nBckg_Chro\t nCont\t nRep\t l_\t s_\t lum_\t ls45\t ls135\t luml45\t luml135\t lums45\t luml135\n') |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% fo = fopen(infoFile, 'at') |
|
|
|
% fo = fopen(infoFile, 'at') |
|
|
|
fprintf(fo, '%s\t%s\t %1.2f\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n',... |
|
|
|
fprintf(fo, '%s\t%s\t %1.2f\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n',... |
|
|
|
subName, theDate, meanLum, nBckg_Chro, nCont, nRep, axis_chck); |
|
|
|
subName, theDate, meanLum, nBckg_Chro, nCont, nRep, axis_chck); |
|
|
|
% % % % fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%1.3f\t%1.3f\t%i\n',... |
|
|
|
% % % % fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%1.3f\t%1.3f\t%i\n',... |
|
|
|
% % % % subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... |
|
|
|
% % % % subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... |
|
|
|
% % % % maxLum, white(1),white(2), nRep)%,curr_cond(1),curr_cond(2),... |
|
|
|
% % % % maxLum, white(1),white(2), nRep)%,curr_cond(1),curr_cond(2),... |
|
|
|
% % % % % % curr_cond(3),curr_cond(4) ,curr_cond(5),curr_cond(6),... |
|
|
|
% % % % % % curr_cond(3),curr_cond(4) ,curr_cond(5),curr_cond(6),... |
|
|
|
% % % % % % curr_cond(7),curr_cond(8),curr_cond(9)); |
|
|
|
% % % % % % curr_cond(7),curr_cond(8),curr_cond(9)); |
|
|
|
|
|
|
|
|
|
|
|
fclose(fo) |
|
|
|
fclose(fo); |
|
|
|
|
|
|
|
|
|
|
|
%% set up psych toolbox |
|
|
|
%% set up psych toolbox |
|
|
|
%set up 10 bit color |
|
|
|
%set up 10 bit color |
|
|
|
PsychImaging('PrepareConfiguration'); |
|
|
|
PsychImaging('PrepareConfiguration'); |
|
|
|
%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? |
|
|
|
%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? |
|
|
|
expScreen = 1; |
|
|
|
expScreen = 1; |
|
|
|
%create white LUT |
|
|
|
%create white LUT |
|
|
|
|
|
|
|
|
|
|
|
% cd(a); |
|
|
|
% cd(a); |
|
|
|
|
|
|
|
|
|
|
|
% % % wLMS(1,1) = white(1,1)*maxLum; |
|
|
|
% % % wLMS(1,1) = white(1,1)*maxLum; |
|
|
|
% % % wLMS(1,2) = (1-white(1,1))*maxLum; |
|
|
|
% % % wLMS(1,2) = (1-white(1,1))*maxLum; |
|
|
|
% % % wLMS(1,3) = white(1,2)*maxLum; |
|
|
|
% % % wLMS(1,3) = white(1,2)*maxLum; |
|
|
|
% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); |
|
|
|
% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); |
|
|
|
% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); |
|
|
|
% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); |
|
|
|
% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; |
|
|
|
% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; |
|
|
|
% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); |
|
|
|
% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); |
|
|
|
% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; |
|
|
|
% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; |
|
|
|
|
|
|
|
|
|
|
|
[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting |
|
|
|
[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting |
|
|
|
%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark |
|
|
|
%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark |
|
|
|
%PsychImaging('OpenWindow', expScreen, wRGB); |
|
|
|
%PsychImaging('OpenWindow', expScreen, wRGB); |
|
|
|
[xcent,ycent] = RectCenter(windowRect); |
|
|
|
[xcent,ycent] = RectCenter(windowRect); |
|
|
|
center = [xcent ycent]; |
|
|
|
center = [xcent ycent]; |
|
|
|
[xWinSize,~] = Screen('WindowSize',window); |
|
|
|
[xWinSize,~] = Screen('WindowSize',window); |
|
|
|
|
|
|
|
|
|
|
|
%% TIMING |
|
|
|
%% TIMING |
|
|
|
%find frames per second |
|
|
|
%find frames per second |
|
|
|
ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor |
|
|
|
ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor |
|
|
|
topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number |
|
|
|
topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number |
|
|
|
numSecs = 16; %in seconds, total presentation time |
|
|
|
numSecs = 16; %in seconds, total presentation time |
|
|
|
framesPerSec = round(1/ifi); |
|
|
|
framesPerSec = round(1/ifi); |
|
|
|
nFrames = numSecs * framesPerSec; |
|
|
|
nFrames = numSecs * framesPerSec; |
|
|
|
waitframes = 1; %number of frames to wait between refresh |
|
|
|
waitframes = 1; %number of frames to wait between refresh |
|
|
|
% color changed .03 of full cycle per second - finished 1/2 cycle in 16 seconds, 1/32 |
|
|
|
% color changed .03 of full cycle per second - finished 1/2 cycle in 16 seconds, 1/32 |
|
|
|
%in Zaidi, clock face appears at 10.15 seconds, will approximate this |
|
|
|
%in Zaidi, clock face appears at 10.15 seconds, will approximate this |
|
|
|
%number |
|
|
|
%number |
|
|
|
zaidiClock = 10.15; %is when Zaidi started in his example. |
|
|
|
zaidiClock = 10.15; %is when Zaidi started in his example. |
|
|
|
clFrmStart = floor(1/ifi*zaidiClock); |
|
|
|
clFrmStart = floor(1/ifi*zaidiClock); |
|
|
|
clTotTime = 2.9*2; %how long is clock in the screen |
|
|
|
clTotTime = 2.9*2; %how long is clock in the screen |
|
|
|
handInt = 12*2; %how many places to stop around the clock |
|
|
|
handInt = 12*2; %how many places to stop around the clock |
|
|
|
clFrames = floor(clTotTime/handInt/ifi); %this will move the hand 15 degrees at a time, and decides how many frames to sit at each angle |
|
|
|
clFrames = floor(clTotTime/handInt/ifi); %this will move the hand 15 degrees at a time, and decides how many frames to sit at each angle |
|
|
|
|
|
|
|
|
|
|
|
%% Stimulus Size Parameters |
|
|
|
%% Stimulus Size Parameters |
|
|
|
circleDeg = 3.6; |
|
|
|
circleDeg = 3.6; |
|
|
|
clockPt = 0.1; |
|
|
|
clockPt = 0.1; |
|
|
|
|
|
|
|
|
|
|
|
% code assumes 1 pixel = 1 arc min |
|
|
|
% code assumes 1 pixel = 1 arc min |
|
|
|
pixPerDeg = 35; %at a distance of 57 cm |
|
|
|
pixPerDeg = 35; %at a distance of 57 cm |
|
|
|
circlePix = circleDeg*pixPerDeg; |
|
|
|
circlePix = circleDeg*pixPerDeg; |
|
|
|
clockPix = clockPt*pixPerDeg; |
|
|
|
clockPix = clockPt*pixPerDeg; |
|
|
|
|
|
|
|
|
|
|
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%% CIRCLE HALf LOCATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%% CIRCLE HALf LOCATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; |
|
|
|
%tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; |
|
|
|
rhtXCircleCenter = xWinSize/4; |
|
|
|
rhtXCircleCenter = xWinSize/4; |
|
|
|
lftXCircleCenter = xWinSize-xWinSize/4; |
|
|
|
lftXCircleCenter = xWinSize-xWinSize/4; |
|
|
|
tstCircleLeft = [lftXCircleCenter - circlePix/2 ycent - circlePix/2 lftXCircleCenter + circlePix/2 ycent + circlePix/2]; |
|
|
|
tstCircleLeft = [lftXCircleCenter - circlePix/2 ycent - circlePix/2 lftXCircleCenter + circlePix/2 ycent + circlePix/2]; |
|
|
|
tstCircleRight = [rhtXCircleCenter - circlePix/2 ycent - circlePix/2 rhtXCircleCenter + circlePix/2 ycent + circlePix/2]; |
|
|
|
tstCircleRight = [rhtXCircleCenter - circlePix/2 ycent - circlePix/2 rhtXCircleCenter + circlePix/2 ycent + circlePix/2]; |
|
|
|
|
|
|
|
|
|
|
|
%create circular grid for clock face and the numbers |
|
|
|
%create circular grid for clock face and the numbers |
|
|
|
% % % circleDegGrid = 2 ; |
|
|
|
% % % circleDegGrid = 2 ; |
|
|
|
% % % rad = circleDegGrid/2*pixPerDeg; %circlePix/2-pixPerDeg/2; |
|
|
|
% % % rad = circleDegGrid/2*pixPerDeg; %circlePix/2-pixPerDeg/2; |
|
|
|
rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; |
|
|
|
rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; |
|
|
|
radNum = (circleDeg/2) * pixPerDeg; |
|
|
|
radNum = (circleDeg/2) * pixPerDeg; |
|
|
|
degreeNumbers = linspace(0,360,25); |
|
|
|
degreeNumbers = linspace(0,360,25); |
|
|
|
clockDegs = degreeNumbers(1:end-1); %[1:15:360]; |
|
|
|
clockDegs = degreeNumbers(1:end-1); %[1:15:360]; |
|
|
|
clockDegsLft = [90:15:269]; |
|
|
|
clockDegsLft = [90:15:269]; |
|
|
|
clockDegsRht = [270:15:359,0:15:89]; |
|
|
|
clockDegsRht = [270:15:359,0:15:89]; |
|
|
|
for iC = 1:length(clockDegs) |
|
|
|
for iC = 1:length(clockDegs) |
|
|
|
[xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); |
|
|
|
[xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); |
|
|
|
[xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, 1*radNum); |
|
|
|
[xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, 1*radNum); |
|
|
|
end |
|
|
|
end |
|
|
|
for iC = 1:length(clockDegsLft) |
|
|
|
for iC = 1:length(clockDegsLft) |
|
|
|
[xcRhtFace(iC), ycRhtFace(iC)] = pol2cart(clockDegsLft(iC)*pi/180, rad); |
|
|
|
[xcRhtFace(iC), ycRhtFace(iC)] = pol2cart(clockDegsLft(iC)*pi/180, rad); |
|
|
|
[xcRhtNumber(iC), ycRhtNumber(iC)] = pol2cart(clockDegsLft(iC)*pi/180, 1*radNum); |
|
|
|
[xcRhtNumber(iC), ycRhtNumber(iC)] = pol2cart(clockDegsLft(iC)*pi/180, 1*radNum); |
|
|
|
end |
|
|
|
end |
|
|
|
for iC = 1:length(clockDegsRht) |
|
|
|
for iC = 1:length(clockDegsRht) |
|
|
|
[xcLftFace(iC), ycLftFace(iC)] = pol2cart(clockDegsRht(iC)*pi/180, rad); |
|
|
|
[xcLftFace(iC), ycLftFace(iC)] = pol2cart(clockDegsRht(iC)*pi/180, rad); |
|
|
|
[xcLftNumber(iC), ycLftNumber(iC)] = pol2cart(clockDegsRht(iC)*pi/180, 1*radNum); |
|
|
|
[xcLftNumber(iC), ycLftNumber(iC)] = pol2cart(clockDegsRht(iC)*pi/180, 1*radNum); |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
%create matrix of dot locations |
|
|
|
%create matrix of dot locations |
|
|
|
clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; |
|
|
|
clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; |
|
|
|
clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; |
|
|
|
%clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; |
|
|
|
clockRhtPosMat = [reshape(xcRhtFace,1, length(clockDegsRht)); reshape(ycRhtFace,1, length(clockDegsRht))]; |
|
|
|
%clockRhtPosMat = [reshape(xcRhtFace,1, length(clockDegsRht)); reshape(ycRhtFace,1, length(clockDegsRht))]; |
|
|
|
clockRhtNumMat = [reshape(xcRhtNumber,1, length(clockDegsRht)); reshape(ycRhtNumber,1, length(clockDegsRht))]; |
|
|
|
clockRhtNumMat = [reshape(xcRhtNumber,1, length(clockDegsRht)); reshape(ycRhtNumber,1, length(clockDegsRht))]; |
|
|
|
clockLftPosMat = [reshape(xcLftFace,1, length(clockDegsLft)); reshape(ycLftFace,1, length(clockDegsLft))]; |
|
|
|
%clockLftPosMat = [reshape(xcLftFace,1, length(clockDegsLft)); reshape(ycLftFace,1, length(clockDegsLft))]; |
|
|
|
clockLftNumMat = [reshape(xcLftNumber,1, length(clockDegsLft)); reshape(ycLftNumber,1, length(clockDegsLft))]; |
|
|
|
clockLftNumMat = [reshape(xcLftNumber,1, length(clockDegsLft)); reshape(ycLftNumber,1, length(clockDegsLft))]; |
|
|
|
|
|
|
|
|
|
|
|
Screen('TextSize', window, 14); |
|
|
|
Screen('TextSize', window, 14); |
|
|
|
textOne = [12:24,1:11]; %[6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5]; |
|
|
|
textOne = [12:24,1:11]; %[6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5]; |
|
|
|
yPositionIsBaseline=1; |
|
|
|
%yPositionIsBaseline=1; |
|
|
|
%create array of second hand positions to index |
|
|
|
%create array of second hand positions to index |
|
|
|
count = 1; |
|
|
|
count = 1; |
|
|
|
secHandCord(1:handInt) = (1:15:360)*(pi/180); |
|
|
|
secHandCord(1:handInt) = (1:15:360)*(pi/180); |
|
|
|
for iMove = 1:length(secHandCord) |
|
|
|
for iMove = 1:length(secHandCord) |
|
|
|
secHandMove(count:count+clFrames-1) = secHandCord(iMove); |
|
|
|
secHandMove(count:count+clFrames-1) = secHandCord(iMove); |
|
|
|
count = count+clFrames; |
|
|
|
count = count+clFrames; |
|
|
|
end |
|
|
|
end |
|
|
|
secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); |
|
|
|
secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WaitSecs(1); |
|
|
|
WaitSecs(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%///////////////////////////////////////////////////////////////////////// |
|
|
|
%%///////////////////////////////////////////////////////////////////////// |
|
|
|
%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// |
|
|
|
%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// |
|
|
|
%%///////////////////////////////////////////////////////////////////////// |
|
|
|
%%///////////////////////////////////////////////////////////////////////// |
|
|
|
clear iCond |
|
|
|
clear iCond |
|
|
|
|
|
|
|
|
|
|
|
curr_axis = find(axis_chck) |
|
|
|
curr_axis = find(axis_chck); |
|
|
|
TrialCount = 1; |
|
|
|
fprintf('Current Axis: %d\n',curr_axis); |
|
|
|
%run experiment |
|
|
|
%run experiment |
|
|
|
|
|
|
|
|
|
|
|
TrialCount = 1; |
|
|
|
TrialCount = 1; |
|
|
|
|
|
|
|
|
|
|
|
Card_Dir = 0; |
|
|
|
Card_Dir = 0; |
|
|
|
|
|
|
|
|
|
|
|
for iChro = 1:size(Bckg_Chro,1) |
|
|
|
for iChro = 1:size(Bckg_Chro,1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; |
|
|
|
wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; |
|
|
|
wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; |
|
|
|
wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; |
|
|
|
wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; |
|
|
|
wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; |
|
|
|
wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); |
|
|
|
wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); |
|
|
|
wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); |
|
|
|
wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); |
|
|
|
wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; |
|
|
|
wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; |
|
|
|
wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); |
|
|
|
wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); |
|
|
|
wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; |
|
|
|
wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; |
|
|
|
|
|
|
|
|
|
|
|
commandwindow; |
|
|
|
commandwindow; |
|
|
|
Speak(' Press any key when you are ready'); |
|
|
|
Speak(' Press any key when you are ready'); |
|
|
|
KbStrokeWait; |
|
|
|
KbStrokeWait; |
|
|
|
|
|
|
|
|
|
|
|
Screen('FillRect', window, wRGB); |
|
|
|
Screen('FillRect', window, wRGB); |
|
|
|
|
|
|
|
|
|
|
|
Screen('Flip',window) |
|
|
|
Screen('Flip',window) |
|
|
|
|
|
|
|
|
|
|
|
WaitSecs(AdaptTime) |
|
|
|
WaitSecs(AdaptTime) |
|
|
|
|
|
|
|
|
|
|
|
for iRep = 1:nRep |
|
|
|
for iRep = 1:nRep |
|
|
|
|
|
|
|
|
|
|
@ -278,8 +266,9 @@ WaitSecs(AdaptTime) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rnd_idx = randperm(length(curr_axis)); |
|
|
|
rnd_idx = randperm(length(curr_axis)); |
|
|
|
curr_axis = curr_axis(rnd_idx) |
|
|
|
curr_axis = curr_axis(rnd_idx); |
|
|
|
% cond = randperm(9); |
|
|
|
fprintf('Current Axis: %d\n', curr_axis); |
|
|
|
|
|
|
|
% cond = randperm(9); |
|
|
|
for iCond = 1:length(curr_axis) |
|
|
|
for iCond = 1:length(curr_axis) |
|
|
|
%create table of color changes |
|
|
|
%create table of color changes |
|
|
|
switch curr_axis(iCond) |
|
|
|
switch curr_axis(iCond) |
|
|
@ -331,11 +320,11 @@ WaitSecs(AdaptTime) |
|
|
|
rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); |
|
|
|
rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); |
|
|
|
end |
|
|
|
end |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% loadCombined =1; |
|
|
|
% loadCombined =1; |
|
|
|
% if loadCombined |
|
|
|
% if loadCombined |
|
|
|
% rampLeft = importdata('rampLeft_Combined.mat'); |
|
|
|
% rampLeft = importdata('rampLeft_Combined.mat'); |
|
|
|
% rampRight = importdata('rampRight_Combined.mat'); |
|
|
|
% rampRight = importdata('rampRight_Combined.mat'); |
|
|
|
% end |
|
|
|
% end |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -353,7 +342,7 @@ WaitSecs(AdaptTime) |
|
|
|
handyRht = handy + ycent; |
|
|
|
handyRht = handy + ycent; |
|
|
|
|
|
|
|
|
|
|
|
WaitSecs(5); %a short adaptation before the next trial |
|
|
|
WaitSecs(5); %a short adaptation before the next trial |
|
|
|
keypress = 0; |
|
|
|
%keypress = 0; |
|
|
|
count = 0; %for clock hand |
|
|
|
count = 0; %for clock hand |
|
|
|
TrialCountStr = num2str(TrialCount); |
|
|
|
TrialCountStr = num2str(TrialCount); |
|
|
|
Priority(topPriorityLevel); |
|
|
|
Priority(topPriorityLevel); |
|
|
@ -363,8 +352,8 @@ WaitSecs(AdaptTime) |
|
|
|
for iFrames = 1:nFrames |
|
|
|
for iFrames = 1:nFrames |
|
|
|
Screen('FillArc', window, rampLeft(iFrames,:), tstCircleLeft, 0, 180); |
|
|
|
Screen('FillArc', window, rampLeft(iFrames,:), tstCircleLeft, 0, 180); |
|
|
|
Screen('FillArc', window, rampRight(iFrames,:), tstCircleRight, 180, 180); |
|
|
|
Screen('FillArc', window, rampRight(iFrames,:), tstCircleRight, 180, 180); |
|
|
|
Screen('DrawDots', window, clockLftPosMat,clockPix, blackLut, [lftXCircleCenter,center(2)], 2); |
|
|
|
Screen('DrawDots', window, clockPosMat,clockPix, blackLut, [lftXCircleCenter,center(2)], 2); |
|
|
|
Screen('DrawDots', window, clockRhtPosMat,clockPix, blackLut, [rhtXCircleCenter,center(2)], 2); |
|
|
|
Screen('DrawDots', window, clockPosMat,clockPix, blackLut, [rhtXCircleCenter,center(2)], 2); |
|
|
|
Screen('DrawDots', window, [0 0],clockPix, 0, [lftXCircleCenter,center(2)], 2); % black dot for fixation |
|
|
|
Screen('DrawDots', window, [0 0],clockPix, 0, [lftXCircleCenter,center(2)], 2); % black dot for fixation |
|
|
|
Screen('DrawDots', window, [0 0],clockPix, 0, [rhtXCircleCenter,center(2)], 2); % black dot for fixation |
|
|
|
Screen('DrawDots', window, [0 0],clockPix, 0, [rhtXCircleCenter,center(2)], 2); % black dot for fixation |
|
|
|
Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); |
|
|
|
Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); |
|
|
@ -386,69 +375,69 @@ WaitSecs(AdaptTime) |
|
|
|
Screen('DrawLine', window, redLut, rhtXCircleCenter, ycent, handxRht(count), handyRht(count), 2.5); |
|
|
|
Screen('DrawLine', window, redLut, rhtXCircleCenter, ycent, handxRht(count), handyRht(count), 2.5); |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
% % %----------------- |
|
|
|
% % %----------------- |
|
|
|
% % % PrintScreen of the monitor (for the paper) |
|
|
|
% % % PrintScreen of the monitor (for the paper) |
|
|
|
% % % GetImage call. Alter the rect argument to change the location of the screen shot |
|
|
|
% % % GetImage call. Alter the rect argument to change the location of the screen shot |
|
|
|
% % imageArray = Screen('GetImage', window, [0 0 300 300]); |
|
|
|
% % imageArray = Screen('GetImage', window, [0 0 300 300]); |
|
|
|
% % % imwrite is a Matlab function, not a PTB-3 function |
|
|
|
% % % imwrite is a Matlab function, not a PTB-3 function |
|
|
|
% % imwrite(imageArray, 'test.jpg') |
|
|
|
% % imwrite(imageArray, 'test.jpg') |
|
|
|
% % %------------------ |
|
|
|
% % %------------------ |
|
|
|
|
|
|
|
|
|
|
|
vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); |
|
|
|
Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); |
|
|
|
|
|
|
|
|
|
|
|
Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing |
|
|
|
Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing |
|
|
|
|
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
Priority(0); |
|
|
|
Priority(0); |
|
|
|
% % % % while ~keypress |
|
|
|
% % % % while ~keypress |
|
|
|
% % % % if CharAvail |
|
|
|
% % % % if CharAvail |
|
|
|
% % % % userRes = input(' '); |
|
|
|
% % % % userRes = input(' '); |
|
|
|
% % % % keypress = 1; |
|
|
|
% % % % keypress = 1; |
|
|
|
% % % % end |
|
|
|
% % % % end |
|
|
|
% % % % end |
|
|
|
% % % % end |
|
|
|
% % % % FlushEvents('mouseDown','keyDown'); |
|
|
|
% % % % FlushEvents('mouseDown','keyDown'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% RESPONSES % |
|
|
|
% RESPONSES % |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
|
|
|
|
|
|
|
|
if Simu_chck |
|
|
|
if Simu_chck |
|
|
|
userRes = 'simu'; |
|
|
|
userRes = 'simu'; |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
keyIsDown=0; |
|
|
|
keyIsDown=0; |
|
|
|
kbName=[]; |
|
|
|
kbName=[]; |
|
|
|
Digit = []; |
|
|
|
Digit = []; |
|
|
|
|
|
|
|
|
|
|
|
Nums = {'0','1','2','3','4','5','6','7','8','9'}; |
|
|
|
Nums = {'0','1','2','3','4','5','6','7','8','9'}; |
|
|
|
Screen('TextSize', window, 30); |
|
|
|
Screen('TextSize', window, 30); |
|
|
|
commandwindow; |
|
|
|
commandwindow; |
|
|
|
while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) |
|
|
|
while keyIsDown==0 || (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) |
|
|
|
|
|
|
|
|
|
|
|
keyIsDown=0; |
|
|
|
%keyIsDown=0; |
|
|
|
[keyIsDown, secs, keyCode] = KbCheck; |
|
|
|
[keyIsDown, ~, keyCode] = KbCheck; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if keyIsDown==1 % |
|
|
|
if keyIsDown==1 % |
|
|
|
kbName = KbName(keyCode); |
|
|
|
kbName = KbName(keyCode); |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if Digit & any(strcmp(Nums(:),kbName)); |
|
|
|
if Digit && any(strcmp(Nums(:),kbName)) |
|
|
|
idx=find(strcmp(Nums(:),kbName)); |
|
|
|
%idx=find(strcmp(Nums(:),kbName)); |
|
|
|
NumPressed = Nums{idx}; |
|
|
|
NumPressed = Nums{strcmp(Nums(:),kbName)}; |
|
|
|
|
|
|
|
|
|
|
|
kbName = strcat(firstDigit,NumPressed); |
|
|
|
kbName = strcat(firstDigit,NumPressed); |
|
|
|
userRes = kbName; |
|
|
|
userRes = kbName; |
|
|
|
% DrawFormattedText(window, kbName, 'center', 'center', color); |
|
|
|
% DrawFormattedText(window, kbName, 'center', 'center', color); |
|
|
|
DrawFormattedText(window, kbName, 400, 512, redLut); |
|
|
|
DrawFormattedText(window, kbName, 400, 512, redLut); |
|
|
|
Screen('Flip', window); |
|
|
|
Screen('Flip', window); |
|
|
|
kbName = []; |
|
|
|
kbName = []; |
|
|
|
Digit = 0; |
|
|
|
Digit = 0; |
|
|
|
WaitSecs(.4); |
|
|
|
WaitSecs(.4); |
|
|
|
elseif any(strcmp(Nums(:),kbName)) |
|
|
|
elseif any(strcmp(Nums(:),kbName)) |
|
|
|
idx=find(strcmp(Nums(:),kbName)); |
|
|
|
%idx=find(strcmp(Nums(:),kbName)); |
|
|
|
NumPressed = Nums{idx}; |
|
|
|
%NumPressed = Nums{idx}; |
|
|
|
userRes = kbName; |
|
|
|
userRes = kbName; |
|
|
|
%-si es numero -- llevarlo a la pantalla |
|
|
|
%-si es numero -- llevarlo a la pantalla |
|
|
|
DrawFormattedText(window, kbName, 400, 512, redLut); |
|
|
|
DrawFormattedText(window, kbName, 400, 512, redLut); |
|
|
@ -460,31 +449,31 @@ elseif any(strcmp(Nums(:),kbName)) |
|
|
|
WaitSecs(.4); |
|
|
|
WaitSecs(.4); |
|
|
|
kbName = []; |
|
|
|
kbName = []; |
|
|
|
|
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero |
|
|
|
if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero |
|
|
|
kbName = []% ; |
|
|
|
kbName = []; |
|
|
|
userRes = kbName |
|
|
|
userRes = kbName; |
|
|
|
firstDigit = []; |
|
|
|
firstDigit = []; |
|
|
|
Digit = 0; |
|
|
|
Digit = 0; |
|
|
|
DrawFormattedText(window, kbName, 400, 512, redLut); |
|
|
|
DrawFormattedText(window, kbName, 400, 512, redLut); |
|
|
|
% Flip to the screen |
|
|
|
% Flip to the screen |
|
|
|
Screen('Flip', window); |
|
|
|
Screen('Flip', window); |
|
|
|
%else % -si no es numero -- ignorar |
|
|
|
%else % -si no es numero -- ignorar |
|
|
|
WaitSecs(.4); |
|
|
|
WaitSecs(.4); |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end %end while |
|
|
|
end %end while |
|
|
|
|
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
% userRes = num2str(2); |
|
|
|
% userRes = num2str(2); |
|
|
|
|
|
|
|
|
|
|
|
AfterResp = 'OK' |
|
|
|
%AfterResp = 'OK'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Screen('TextSize', window, 14); |
|
|
|
Screen('TextSize', window, 14); |
|
|
|
FlushEvents('mouseDown','keyDown'); |
|
|
|
FlushEvents('mouseDown','keyDown'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -492,17 +481,14 @@ Screen('TextSize', window, 14); |
|
|
|
% SAVE % |
|
|
|
% SAVE % |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
|
|
|
|
|
|
|
|
aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); |
|
|
|
WaitSecs(.2) |
|
|
|
% aa = cd('D:\Dropbox\Luminotecnia\2017\Chicago Lab files\2 Experiments\Color AfterImage_Exp_Room_150\2nd\1 Programs\A Outputs') |
|
|
|
|
|
|
|
cd |
|
|
|
|
|
|
|
WaitSecs(.2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time = clock; |
|
|
|
theDate = datestr(now(),'mm/dd/yyyy HH:MM:SS'); |
|
|
|
fprintf(fp, '%s\t%i/%i/%i %i:%i:%i\t%1.3f\t%1.3f\t%1.3f\t%1.3f\t%i\t%i\t%i\t%i\t%s\tExperiment\n',... |
|
|
|
fprintf(fp, '%s\t%s\t%1.3f\t%1.3f\t%1.3f\t%1.3f\t%i\t%i\t%i\t%i\t%s\tExperiment\n',... |
|
|
|
subName, time(2), time(3), time(1), time(4), time(5), round(time(6)), hfpRG, hfpBG, Bckg_Chro(iChro,1), Bckg_Chro(iChro,2), cont(iCont), curr_axis(iCond), Card_Dir, randStrt+5, userRes); |
|
|
|
subName, theDate, hfpRG, hfpBG, Bckg_Chro(iChro,1), Bckg_Chro(iChro,2), cont(iCont), curr_axis(iCond), Card_Dir, randStrt+5, userRes); |
|
|
|
|
|
|
|
|
|
|
|
% a = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/4 ColBackg AI'); % |
|
|
|
% a = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/4 ColBackg AI'); % |
|
|
|
% a = cd('D:\Dropbox\Luminotecnia\2017\Chicago Lab files\2 Experiments\Color AfterImage_Exp_Room_150\2nd\1 Programs\4 AfterImage'); % |
|
|
|
% a = cd('D:\Dropbox\Luminotecnia\2017\Chicago Lab files\2 Experiments\Color AfterImage_Exp_Room_150\2nd\1 Programs\4 AfterImage'); % |
|
|
|
|
|
|
|
|
|
|
|
cd |
|
|
|
cd |
|
|
|
|
|
|
|
|
|
|
@ -514,13 +500,14 @@ WaitSecs(.2) |
|
|
|
Screen('Flip', window); |
|
|
|
Screen('Flip', window); |
|
|
|
clear secHandCord colLut |
|
|
|
clear secHandCord colLut |
|
|
|
|
|
|
|
|
|
|
|
TrialCount = TrialCount+1 |
|
|
|
TrialCount = TrialCount+1; |
|
|
|
|
|
|
|
fprintf('Trial Count: %d\n',TrialCount); |
|
|
|
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% WANT TO STOP? % |
|
|
|
% WANT TO STOP? % |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|
% pause(3) |
|
|
|
% pause(3) |
|
|
|
yesno=evalin('base','Stop_Press') |
|
|
|
yesno=evalin('base','Stop_Press'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if yesno==1 |
|
|
|
if yesno==1 |
|
|
@ -531,15 +518,15 @@ WaitSecs(.2) |
|
|
|
end %ICond |
|
|
|
end %ICond |
|
|
|
end %iCont |
|
|
|
end %iCont |
|
|
|
end %iRep |
|
|
|
end %iRep |
|
|
|
end %iChro |
|
|
|
end %iChro |
|
|
|
|
|
|
|
|
|
|
|
fclose(fp); |
|
|
|
fclose(fp); |
|
|
|
sca |
|
|
|
sca |
|
|
|
%create a matrix of seconds compared to pi values for each frame - just |
|
|
|
%create a matrix of seconds compared to pi values for each frame - just |
|
|
|
%used in data analysis |
|
|
|
%used in data analysis |
|
|
|
% % % % piVSsecs(:,1) = [0:1/(nFrames-1):1]; |
|
|
|
% % % % piVSsecs(:,1) = [0:1/(nFrames-1):1]; |
|
|
|
% % % % piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; |
|
|
|
% % % % piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; |
|
|
|
catch |
|
|
|
catch |
|
|
|
warndlg('The program failed to run. Try again.') |
|
|
|
warndlg('The program failed to run. Try again.') |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|