commit e8c89188906809535f1406f4b7cd85cf50d1a544 Author: Clemente Date: Thu Mar 5 14:32:51 2020 -0600 Initial Commit from Clemente. -MT diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..2b331a8 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba254c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/A\ Outputs/ +.DS_STORE/ diff --git a/002 After Image GUI Project/.DS_Store b/002 After Image GUI Project/.DS_Store new file mode 100644 index 0000000..1fc19a6 Binary files /dev/null and b/002 After Image GUI Project/.DS_Store differ diff --git a/002 After Image GUI Project/AfIm_Exp.m b/002 After Image GUI Project/AfIm_Exp.m new file mode 100644 index 0000000..3edf289 --- /dev/null +++ b/002 After Image GUI Project/AfIm_Exp.m @@ -0,0 +1,521 @@ +function AfIm_Exp(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,Simu_chck) + +try +assignin('base','Stop_Press',0)% this works for the STOP experiment button + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +saveFile = sprintf('%s_afterimage', subName) +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); + +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + + + +% cd(a); % return to program folder. +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date) +pix = pix/1001; + + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +% % % % lumMod = fliplr(Final_lumMod_avg); +% % % % +% % % % sCont = [.8 .65 .5 .35]; +% % % % nCont = 4; + +% lCont = Final_lCont_avg(:,4:5); +% lumMod = Final_lumMod_avg(:,4:5); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% +% nCont = 2; + +% lCont = Final_lCont_avg(3:6); +% lumMod = Final_lumMod_avg(3:6); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% sCont = Final_sCont_ref; + +lCont = Final_lCont_avg; +lumMod = Final_lumMod_avg; +sCont = Final_sCont_ref; + +nCont = size(sCont,2); +nBckg_Chro = size(Bckg_Chro,1); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% Bckg_Chro = Final_lCont_avg(:,1:2) + +%% Save Session Information + +theDate = fix(clock); +% 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') +fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\n',... + subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... + meanLum, nBckg_Chro, nCont, nRep,axis_chck(1),axis_chck(2),... + axis_chck(3),axis_chck(4) ,axis_chck(5),axis_chck(6),... + axis_chck(7),axis_chck(8),axis_chck(9)); +% % % % 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)),... +% % % % 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(7),curr_cond(8),curr_cond(9)); + +fclose(fo) + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +% cd(a); + +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +% % % circleDegGrid = 2 ; +% % % rad = circleDegGrid/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, 1*radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +WaitSecs(1); + + +%%///////////////////////////////////////////////////////////////////////// +%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// +%%///////////////////////////////////////////////////////////////////////// +clear iCond + +curr_axis = find(axis_chck) +TrialCount = 1; +%run experiment + +TrialCount = 1; + +Card_Dir = 0; + + for iChro = 1:size(Bckg_Chro,1) + + + +wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +commandwindow; +Speak(' Press any key when you are ready'); + KbStrokeWait; + + Screen('FillRect', window, wRGB); + +Screen('Flip',window) + +WaitSecs(AdaptTime) + + for iRep = 1:nRep + + cont = randperm(nCont); %randomize contrast conditions + for iCont = 1:nCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum]; %+l, -l + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum];%+s, -s + + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; % -lum , +lum + + l_s_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + l_s_135 = [Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + + lum_l_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont))]; + + lum_l_135 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; + + lum_s_45 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont))]; + + lum_s_135 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont))]; + + + rnd_idx = randperm(length(curr_axis)); + curr_axis = curr_axis(rnd_idx) +% cond = randperm(9); + for iCond = 1:length(curr_axis) + %create table of color changes + switch curr_axis(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 %%%% ATENCION que ahora LUM es la condicion 3 + colLut = lum; + case 4 + colLut = l_s_45; + case 5 + colLut = l_s_135; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% loadCombined =1; +% if loadCombined +% rampLeft = importdata('rampLeft_Combined.mat'); +% rampRight = importdata('rampRight_Combined.mat'); +% end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),1*rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + WaitSecs(5); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, blackLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, blackLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + +% % %----------------- +% % % PrintScreen of the monitor (for the paper) +% % % GetImage call. Alter the rect argument to change the location of the screen shot +% % imageArray = Screen('GetImage', window, [0 0 300 300]); +% % % imwrite is a Matlab function, not a PTB-3 function +% % imwrite(imageArray, 'test.jpg') +% % %------------------ + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % RESPONSES % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if Simu_chck + userRes = 'simu'; + +else +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)); + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +end +% userRes = num2str(2); + +AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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; + 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',... + 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); + +% 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'); % + + cd + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + TrialCount = TrialCount+1 + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % WANT TO STOP? % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% pause(3) + yesno=evalin('base','Stop_Press') + + + if yesno==1 + return + end + + + end %ICond + end %iCont + end %iRep +end %iChro + +fclose(fp); +sca +%create a matrix of seconds compared to pi values for each frame - just +%used in data analysis +% % % % piVSsecs(:,1) = [0:1/(nFrames-1):1]; +% % % % piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; + catch + warndlg('The program failed to run. Try again.') + return + +end + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AfIm_Exp_Rivalry.m b/002 After Image GUI Project/AfIm_Exp_Rivalry.m new file mode 100755 index 0000000..d261a66 --- /dev/null +++ b/002 After Image GUI Project/AfIm_Exp_Rivalry.m @@ -0,0 +1,548 @@ +function AfIm_Exp_Rivalry(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,Simu_chck) + +try +assignin('base','Stop_Press',0)% this works for the STOP experiment button + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +saveFile = sprintf('%s_afterimage', subName) +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); + +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + + + +% cd(a); % return to program folder. +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date) +pix = pix/1001; + + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +% % % % lumMod = fliplr(Final_lumMod_avg); +% % % % +% % % % sCont = [.8 .65 .5 .35]; +% % % % nCont = 4; + +% lCont = Final_lCont_avg(:,4:5); +% lumMod = Final_lumMod_avg(:,4:5); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% +% nCont = 2; + +% lCont = Final_lCont_avg(3:6); +% lumMod = Final_lumMod_avg(3:6); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% sCont = Final_sCont_ref; + +lCont = Final_lCont_avg; +lumMod = Final_lumMod_avg; +sCont = Final_sCont_ref; + +nCont = size(sCont,2); +nBckg_Chro = size(Bckg_Chro,1); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% Bckg_Chro = Final_lCont_avg(:,1:2) + +%% Save Session Information + +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') +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); +% % % % 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)),... +% % % % 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(7),curr_cond(8),curr_cond(9)); + +fclose(fo) + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +% cd(a); + +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; +[xWinSize,~] = Screen('WindowSize',window); + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%% CIRCLE HALf LOCATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; +rhtXCircleCenter = xWinSize/4; +lftXCircleCenter = xWinSize-xWinSize/4; +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]; + +%create circular grid for clock face and the numbers +% % % circleDegGrid = 2 ; +% % % rad = circleDegGrid/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +degreeNumbers = linspace(0,360,25); +clockDegs = degreeNumbers(1:end-1); %[1:15:360]; +clockDegsLft = [90:15:269]; +clockDegsRht = [270:15:359,0:15:89]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, 1*radNum); +end +for iC = 1:length(clockDegsLft) + [xcRhtFace(iC), ycRhtFace(iC)] = pol2cart(clockDegsLft(iC)*pi/180, rad); + [xcRhtNumber(iC), ycRhtNumber(iC)] = pol2cart(clockDegsLft(iC)*pi/180, 1*radNum); +end +for iC = 1:length(clockDegsRht) + [xcLftFace(iC), ycLftFace(iC)] = pol2cart(clockDegsRht(iC)*pi/180, rad); + [xcLftNumber(iC), ycLftNumber(iC)] = pol2cart(clockDegsRht(iC)*pi/180, 1*radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,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))]; +clockRhtNumMat = [reshape(xcRhtNumber,1, length(clockDegsRht)); reshape(ycRhtNumber,1, length(clockDegsRht))]; +clockLftPosMat = [reshape(xcLftFace,1, length(clockDegsLft)); reshape(ycLftFace,1, length(clockDegsLft))]; +clockLftNumMat = [reshape(xcLftNumber,1, length(clockDegsLft)); reshape(ycLftNumber,1, length(clockDegsLft))]; + +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]; +yPositionIsBaseline=1; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +WaitSecs(1); + + +%%///////////////////////////////////////////////////////////////////////// +%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// +%%///////////////////////////////////////////////////////////////////////// +clear iCond + +curr_axis = find(axis_chck) +TrialCount = 1; +%run experiment + +TrialCount = 1; + +Card_Dir = 0; + + for iChro = 1:size(Bckg_Chro,1) + + + +wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +commandwindow; +Speak(' Press any key when you are ready'); + KbStrokeWait; + + Screen('FillRect', window, wRGB); + +Screen('Flip',window) + +WaitSecs(AdaptTime) + + for iRep = 1:nRep + + cont = randperm(nCont); %randomize contrast conditions + for iCont = 1:nCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum]; %+l, -l + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum];%+s, -s + + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; % -lum , +lum + + l_s_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + l_s_135 = [Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + + lum_l_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont))]; + + lum_l_135 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; + + lum_s_45 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont))]; + + lum_s_135 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont))]; + + + rnd_idx = randperm(length(curr_axis)); + curr_axis = curr_axis(rnd_idx) +% cond = randperm(9); + for iCond = 1:length(curr_axis) + %create table of color changes + switch curr_axis(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 %%%% ATENCION que ahora LUM es la condicion 3 + colLut = lum; + case 4 + colLut = l_s_45; + case 5 + colLut = l_s_135; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% loadCombined =1; +% if loadCombined +% rampLeft = importdata('rampLeft_Combined.mat'); +% rampRight = importdata('rampRight_Combined.mat'); +% end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),1*rad); + end + + handxLft = handx + lftXCircleCenter; + handyLft = handy + ycent; + handxRht = handx + rhtXCircleCenter; + handyRht = handy + ycent; + + WaitSecs(5); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstCircleLeft, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstCircleRight, 180, 180); + Screen('DrawDots', window, clockLftPosMat,clockPix, blackLut, [lftXCircleCenter,center(2)], 2); + Screen('DrawDots', window, clockRhtPosMat,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, [rhtXCircleCenter,center(2)], 2); % black dot for fixation + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + for itxt = 1:12 + textNum = num2str(textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockRhtNumMat(1,itxt)+rhtXCircleCenter-7, 1.18*clockRhtNumMat(2,itxt)+center(1,2)-7, blackLut, wRGB); + textNum = num2str(textOne(itxt+12)); + Screen('DrawText', window, textNum, 1.18*clockLftNumMat(1,itxt)+lftXCircleCenter-7, 1.18*clockLftNumMat(2,itxt)+center(1,2)-7, blackLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, lftXCircleCenter, ycent, handxLft(count), handyLft(count), 2.5); + Screen('DrawLine', window, redLut, rhtXCircleCenter, ycent, handxRht(count), handyRht(count), 2.5); + end + +% % %----------------- +% % % PrintScreen of the monitor (for the paper) +% % % GetImage call. Alter the rect argument to change the location of the screen shot +% % imageArray = Screen('GetImage', window, [0 0 300 300]); +% % % imwrite is a Matlab function, not a PTB-3 function +% % imwrite(imageArray, 'test.jpg') +% % %------------------ + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % RESPONSES % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if Simu_chck + userRes = 'simu'; + +else +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)); + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +end +% userRes = num2str(2); + +AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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; + 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',... + 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); + +% 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'); % + + cd + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + TrialCount = TrialCount+1 + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % WANT TO STOP? % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% pause(3) + yesno=evalin('base','Stop_Press') + + + if yesno==1 + return + end + + + end %ICond + end %iCont + end %iRep +end %iChro + +fclose(fp); +sca +%create a matrix of seconds compared to pi values for each frame - just +%used in data analysis +% % % % piVSsecs(:,1) = [0:1/(nFrames-1):1]; +% % % % piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; + catch + warndlg('The program failed to run. Try again.') + return + +end + +end diff --git a/002 After Image GUI Project/AfIm_Exp_borrar.m b/002 After Image GUI Project/AfIm_Exp_borrar.m new file mode 100644 index 0000000..f89652a --- /dev/null +++ b/002 After Image GUI Project/AfIm_Exp_borrar.m @@ -0,0 +1,459 @@ +function AfIm_Exp(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,Train_chck) + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +saveFile = sprintf('%s_afterimage', subName) +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); + +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + + + +cd(a); % return to program folder. +Calib_Dire = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/002 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date) +pix = pix/1001; + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +% % % % lumMod = fliplr(Final_lumMod_avg); +% % % % +% % % % sCont = [.8 .65 .5 .35]; +% % % % nCont = 4; + +% lCont = Final_lCont_avg(:,4:5); +% lumMod = Final_lumMod_avg(:,4:5); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% +% nCont = 2; + +lCont = Final_lCont_avg; +lumMod = Final_lumMod_avg; +sCont = [.5 .65]; +% .5 .65 +% .5 .65 +% .5 .65]; + +nCont = size(sCont,2); +nBckg_Chro = size(Bckg_Chro,1); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% Bckg_Chro = Final_lCont_avg(:,1:2) + +%% Save Session Information + +theDate = fix(clock); +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/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); ;% folder where the program is. +cd +fo = fopen(infoFile, 'at') +fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\n',... + subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... + meanLum, nBckg_Chro, nCont, nRep,axis_chck(1),axis_chck(2),... + axis_chck(3),axis_chck(4) ,axis_chck(5),axis_chck(6),... + axis_chck(7),axis_chck(8),axis_chck(9)); +% % % % 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)),... +% % % % 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(7),curr_cond(8),curr_cond(9)); + +fclose(fo) + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +cd(a); + +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +WaitSecs(1); + + +%%///////////////////////////////////////////////////////////////////////// +%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// +%%///////////////////////////////////////////////////////////////////////// +clear iCond + +curr_axis = find(axis_chck) +TrialCount = 1; +%run experiment + +TrialCount = 1; +for iRep = 1:nRep + cont = randperm(nCont); %randomize contrast conditions + + for iChro = 1:size(Bckg_Chro,1) + +wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +Screen('FillRect', window, wRGB); + +Screen('Flip',window) + +WaitSecs(AdaptTime) + + for iCont = 1:nCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2) meanLum]; %+l, -l + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum];%+s, -s + + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum-lumMod(cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum+lumMod(cont(iCont))]; + + l_s_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum]; + + l_s_135 = [Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum + Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum]; + + + lum_l_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(cont(iCont))]; + + lum_l_135 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; + + lum_s_45 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum+lumMod(cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum-lumMod(cont(iCont))]; + + lum_s_135 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum-lumMod(cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(cont(iCont))) meanLum+lumMod(cont(iCont))]; + + + rnd_idx = randperm(length(curr_axis)); + curr_axis = curr_axis(rnd_idx) +% cond = randperm(9); + for iCond = 1:length(curr_axis) + %create table of color changes + switch curr_axis(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 %%%% ATENCION que ahora LUM es la condicion 3 + colLut = lum; + case 4 + colLut = l_s_45; + case 5 + colLut = l_s_135; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + WaitSecs(5); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, redLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, redLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)); + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +% userRes = num2str(2); + +AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); +% 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; + 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%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), randStrt+5, userRes); + + +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'); % + + cd + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + TrialCount = TrialCount+1 + end %ICond + end %iCont + end %iChro + end %iRep +fclose(fp); +sca +%create a matrix of seconds compared to pi values for each frame - just +%used in data analysis +piVSsecs(:,1) = [0:1/(nFrames-1):1]; +piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; + + + + + + + + + + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AfIm_Exp_borrarr.m b/002 After Image GUI Project/AfIm_Exp_borrarr.m new file mode 100644 index 0000000..209f6e1 --- /dev/null +++ b/002 After Image GUI Project/AfIm_Exp_borrarr.m @@ -0,0 +1,464 @@ +function AfIm_Exp(subName,numRep,maxLum,Bckg_Chro,cond_chck,Adapt_chck) + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + + +nBckg_Chro = size(Bckg_Chro,1); +nCont = 2 + +theDate = fix(clock); +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/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); ;% folder where the program is. +cd +fo = fopen(infoFile, 'at') +fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\n',... + subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... + maxLum, nBckg_Chro, nCont, numRep,cond_chck(1),cond_chck(2),... + cond_chck(3),cond_chck(4) ,cond_chck(5),cond_chck(6),... + cond_chck(7),cond_chck(8),cond_chck(9)); +% % % % 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)),... +% % % % maxLum, white(1),white(2), numRep)%,curr_cond(1),curr_cond(2),... +% % % % % % curr_cond(3),curr_cond(4) ,curr_cond(5),curr_cond(6),... +% % % % % % curr_cond(7),curr_cond(8),curr_cond(9)); + +fclose(fo) + + + + + +saveFile = sprintf('%s_afterimage', subName) +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); + +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + + + +cd(a); % return to program folder. +Calib_Dire = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/002 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date) +pix = pix/1001; + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +% % % % lumMod = fliplr(Final_lumMod_avg); +% % % % +% % % % sCont = [.8 .65 .5 .35]; +% % % % numCont = 4; + +% lCont = Final_lCont_avg(:,4:5); +% lumMod = Final_lumMod_avg(:,4:5); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% +% numCont = 2; + +lCont = Final_lCont_avg; +lumMod = Final_lumMod_avg; +sCont = [.5 .65 + .5 .65 + .5 .65 + .5 .65]; + +numCont = size(sCont,2); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% Bckg_Chro = Final_lCont_avg(:,1:2) + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +cd(a); + +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + +numRep = 1; %number of times to repeat the experiment +WaitSecs(1); + + +%%///////////////////////////////////////////////////////////////////////// +%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// +%%///////////////////////////////////////////////////////////////////////// +clear iCond + +curr_axis = find(cond_chck) +TrialCount = 1; +%run experiment + +TrialCount = 1; +for iRep = 1:numRep + cont = randperm(numCont); %randomize contrast conditions + + for iChro = 1:size(Bckg_Chro,1) + +wLMS(1,1) = Bckg_Chro(iChro,1)*maxLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*maxLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*maxLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +Screen('FillRect', window, wRGB); + +Screen('Flip',window) + +WaitSecs(60) + + for iCont = 1:numCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) maxLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) maxLum]; %+l, -l + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum];%+s, -s + + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) maxLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) maxLum+lumMod(iChro,cont(iCont))]; + + l_s_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum]; + + l_s_135 = [Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum + Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum]; + + + lum_l_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) maxLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) maxLum-lumMod(iChro,cont(iCont))]; + + lum_l_135 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) maxLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) maxLum+lumMod(iChro,cont(iCont))]; + + lum_s_45 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum-lumMod(iChro,cont(iCont))]; + + lum_s_135 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum+lumMod(iChro,cont(iCont))]; + + + rnd_idx = randperm(length(curr_axis)); + curr_axis = curr_axis(rnd_idx) +% cond = randperm(9); + for iCond = 1:length(curr_axis) + %create table of color changes + switch curr_axis(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 %%%% ATENCION que ahora LUM es la condicion 3 + colLut = lum; + case 4 + colLut = l_s_45; + case 5 + colLut = l_s_135; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + WaitSecs(5); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, redLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, redLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)); + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +% userRes = num2str(2); + +AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/A Outputs'); +% 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; + 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%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), randStrt+5, userRes); + + +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'); % + + cd + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + TrialCount = TrialCount+1 + end %ICond + end %iCont + end %iChro + end %iRep +fclose(fp); +sca +%create a matrix of seconds compared to pi values for each frame - just +%used in data analysis +piVSsecs(:,1) = [0:1/(nFrames-1):1]; +piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; + + + + + + + + + + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AfIm_Exp_copy.m b/002 After Image GUI Project/AfIm_Exp_copy.m new file mode 100644 index 0000000..f1f2d03 --- /dev/null +++ b/002 After Image GUI Project/AfIm_Exp_copy.m @@ -0,0 +1,616 @@ +function AfIm_Exp_copy(subName,numRep,maxLum,white,curr_cond) + + +theDate = fix(clock); +% % infoFile = sprintf('%s_SessionsInfo', subName); +% % fo = fopen(infoFile, 'at'); +% % fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%1.3f\t%1.3f\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\n',... +% % subName, time(2), time(3), time(1), time(4), time(5), round(time(6)),... +% % maxLum, white(1),white(2), numRep,curr_cond(1),curr_cond(2)... +% % curr_cond(3),curr_cond(4) ,curr_cond(5),curr_cond(6),... +% % curr_cond(7),curr_cond(8),curr_cond(9)); +% % fclose(fo); +% % +saveFile = sprintf('%s_afterimage', subName) + + +a = '/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/4 AfterImage' ;% folder where the program is. +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + +cd(a); % return to program folder. +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date); +pix = pix/1001; + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +lumMod = fliplr(Final_lumMod_avg); + +sCont = [.8 .65 .5 .35]; +numCont = 4; + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +cd(a); + +wLMS(1,1) = white(1,1)*maxLum; +wLMS(1,2) = (1-white(1,1))*maxLum; +wLMS(1,3) = white(1,2)*maxLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, wRGB, [], [], []); % +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +% numRep = 3; %number of times to repeat the experiment +WaitSecs(5); + +%practice +for iprac = 1 + FlushEvents('mouseDown','keyDown'); + + %create colors depending on contrast + l = [white(1)+(white(1)*lCont(1)) 1 maxLum + white(1)-(white(1)*lCont(1)) 1 maxLum]; %+l, -l + s = [white(1) white(2)+(white(2)*sCont(1)) maxLum + white(1) white(2)-(white(2)*sCont(1)) maxLum];%+s, -s + forFive = [white(1)+(white(1)*lCont(1)) white(2)+(white(2)*sCont(1)) maxLum + white(1)-(white(1)*lCont(1)) white(2)-(white(2)*sCont(1)) maxLum]; + oneThrFive = [white(1)-(white(1)*lCont(1)) white(2)+(white(2)*sCont(1)) maxLum + white(1)+(white(1)*lCont(1)) white(2)-(white(2)*sCont(1)) maxLum]; + + lum = [white(1) white(2) maxLum-lumMod(1) + white(1) white(2) maxLum+lumMod(1)]; + + lum_l_45 = [white(1)+(white(1)*lCont(1)) white(2) maxLum+lumMod(1) + white(1)-(white(1)*lCont(1)) white(2) maxLum-lumMod(1)]; + + lum_l_135 = [white(1)+(white(1)*lCont(1)) white(2) maxLum-lumMod(1) + white(1)-(white(1)*lCont(1)) white(2) maxLum+lumMod(1)]; + + lum_s_45 = [white(1) white(2)+(white(2)*sCont(1)) maxLum+lumMod(1) + white(1) white(2)-(white(2)*sCont(1)) maxLum-lumMod(1)]; + + lum_s_135 = [white(1) white(2)+(white(2)*sCont(1)) maxLum-lumMod(1) + white(1) white(2)-(white(2)*sCont(1)) maxLum+lumMod(1)]; + +% cond = randperm(1); + cond = 1:9 + rnd_idx = randperm(length(curr_cond)); + curr_cond = curr_cond(rnd_idx) +% Cond = Cond(curr_cond_rnd) ; + + for iCond = 1:length(curr_cond) + %create table of color changes + switch curr_cond(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 + colLut = forFive; + case 4 + colLut = oneThrFive; + case 5 + colLut = lum; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; +% % % % % % % % case 2 +% % % % % % % % colLut = TEST_lum_l; + + end + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + WaitSecs(3); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, redLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, 'Pr', 20, 20, redLut, wRGB); + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, redLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + + + Priority(0); + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName; + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + WaitSecs(.4); +%else % -si no es numero -- ignorar +end + + +end %end while + +userRes + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +% 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; +% fprintf(fp, '%s\t%i/%i/%i %i:%i:%i\t%1.3f\t%1.3f\t%i\t%i\t%s\t%i\tPractice\n',... +% subName, time(2), time(3), time(1), time(4), time(5), round(time(6)), hfpRG, hfpBG, 1, cond(iCond), randStrt+5, userRes); + + time = clock; + fprintf(fp, '%s\t%i/%i/%i %i:%i:%i\t%1.3f\t%1.3f\t%i\t%i\t%i\t%s\tPractice\n',... + subName, time(2), time(3), time(1), time(4), time(5), round(time(6)), hfpRG, hfpBG, 1,curr_cond(iCond), randStrt, userRes); + +a = cd('/Users/clemente/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 + + WaitSecs(.2) + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + end +end + +clear iCond + +TrialCount = 1; +%run experiment +for iRep = 1:numRep + cont = randperm(numCont); %randomize contrast conditions + + for iCont = 1:numCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [white(1)+(white(1)*lCont(cont(iCont))) white(2) maxLum + white(1)-(white(1)*lCont(cont(iCont))) white(2) maxLum]; %+l, -l + s = [white(1) white(2)+(white(2)*sCont(cont(iCont))) maxLum + white(1) white(2)-(white(2)*sCont(cont(iCont))) maxLum];%+s, -s + forFive = [white(1)+(white(1)*lCont(cont(iCont))) white(2)+(white(2)*sCont(cont(iCont))) maxLum + white(1)-(white(1)*lCont(cont(iCont))) white(2)-(white(2)*sCont(cont(iCont))) maxLum]; + oneThrFive = [white(1)-(white(1)*lCont(cont(iCont))) white(2)+(white(2)*sCont(cont(iCont))) maxLum + white(1)+(white(1)*lCont(cont(iCont))) white(2)-(white(2)*sCont(cont(iCont))) maxLum]; + lum = [white(1) white(2) maxLum-lumMod(cont(iCont)) + white(1) white(2) maxLum+lumMod(cont(iCont))]; + + lum_l_45 = [white(1)+(white(1)*lCont(iCont)) white(2) maxLum+lumMod(iCont) + white(1)-(white(1)*lCont(iCont)) white(2) maxLum-lumMod(iCont)]; + + lum_l_135 = [white(1)+(white(1)*lCont(iCont)) white(2) maxLum-lumMod(iCont) + white(1)-(white(1)*lCont(iCont)) white(2) maxLum+lumMod(iCont)]; + + lum_s_45 = [white(1) white(2)+(white(2)*sCont(iCont)) maxLum+lumMod(iCont) + white(1) white(2)-(white(2)*sCont(iCont)) maxLum-lumMod(iCont)]; + + lum_s_135 = [white(1) white(2)+(white(2)*sCont(iCont)) maxLum-lumMod(iCont) + white(1) white(2)-(white(2)*sCont(iCont)) maxLum+lumMod(iCont)]; + + +% cond = 1:9 + rnd_idx = randperm(length(curr_cond)); + curr_cond = curr_cond(rnd_idx) +% Cond = Cond(curr_cond_rnd) ; + + for iCond = 1:length(curr_cond) + %create table of color changes + switch curr_cond(iCond) +% cond = randperm(9); +% for iCond = 1:9 + %create table of color changes +% switch cond(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 + colLut = forFive; + case 4 + colLut = oneThrFive; + case 5 + colLut = lum; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + WaitSecs(5); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, redLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, redLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)) + NumPressed = Nums{idx} + + kbName = strcat(firstDigit,NumPressed) + userRes = kbName +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +% userRes = num2str(2); + +AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +% aa = cd('D:\Dropbox\Luminotecnia\2017\Chicago Lab files\2 Experiments\Color AfterImage_Exp_Room_150\2nd\1 Programs\A Outputs') +cd +WaitSecs(.2) + +% + fprintf(fp, '%s\t%i/%i/%i %i:%i:%i\t%1.3f\t%1.3f\t%i\t%i\t%i\t%s\n',... + subName, time(2), time(3), time(1), time(4), time(5), round(time(6)), hfpRG, hfpBG, cont(iCont), curr_cond(iCond), randStrt+5, userRes); + + +a = cd('/Users/clemente/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 + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + TrialCount = TrialCount+1 + end %ICond + end %iCont + end %iRep +fclose(fp); +sca + + + + + + + + + + + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AfIm_Exp_old.m b/002 After Image GUI Project/AfIm_Exp_old.m new file mode 100644 index 0000000..2086199 --- /dev/null +++ b/002 After Image GUI Project/AfIm_Exp_old.m @@ -0,0 +1,610 @@ +function AfIm_Exp_old(subName,numRep,maxLum,white,curr_cond) + + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +theDate = fix(clock); +saveFile = sprintf('%s_afterimage', subName) + +a = '/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/4 AfterImage' ;% folder where the program is. +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + +cd(a); % return to program folder. +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date); +pix = pix/1001; + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +lumMod = fliplr(Final_lumMod_avg); + +sCont = [.8 .65 .5 .35]; +numCont = 4; + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +cd(a); + +wLMS(1,1) = white(1,1)*maxLum; +wLMS(1,2) = (1-white(1,1))*maxLum; +wLMS(1,3) = white(1,2)*maxLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, wRGB, [], [], []); % +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +% numRep = 3; %number of times to repeat the experiment +WaitSecs(5); + +%practice +for iprac = 1 + FlushEvents('mouseDown','keyDown'); + + %create colors depending on contrast + l = [white(1)+(white(1)*lCont(1)) 1 maxLum + white(1)-(white(1)*lCont(1)) 1 maxLum]; %+l, -l + s = [white(1) white(2)+(white(2)*sCont(1)) maxLum + white(1) white(2)-(white(2)*sCont(1)) maxLum];%+s, -s + forFive = [white(1)+(white(1)*lCont(1)) white(2)+(white(2)*sCont(1)) maxLum + white(1)-(white(1)*lCont(1)) white(2)-(white(2)*sCont(1)) maxLum]; + oneThrFive = [white(1)-(white(1)*lCont(1)) white(2)+(white(2)*sCont(1)) maxLum + white(1)+(white(1)*lCont(1)) white(2)-(white(2)*sCont(1)) maxLum]; + + lum = [white(1) white(2) maxLum-lumMod(1) + white(1) white(2) maxLum+lumMod(1)]; + + lum_l_45 = [white(1)+(white(1)*lCont(1)) white(2) maxLum+lumMod(1) + white(1)-(white(1)*lCont(1)) white(2) maxLum-lumMod(1)]; + + lum_l_135 = [white(1)+(white(1)*lCont(1)) white(2) maxLum-lumMod(1) + white(1)-(white(1)*lCont(1)) white(2) maxLum+lumMod(1)]; + + lum_s_45 = [white(1) white(2)+(white(2)*sCont(1)) maxLum+lumMod(1) + white(1) white(2)-(white(2)*sCont(1)) maxLum-lumMod(1)]; + + lum_s_135 = [white(1) white(2)+(white(2)*sCont(1)) maxLum-lumMod(1) + white(1) white(2)-(white(2)*sCont(1)) maxLum+lumMod(1)]; + +% cond = randperm(1); + cond = 1:9 + rnd_idx = randperm(length(curr_cond)); + curr_cond = curr_cond(rnd_idx) +% Cond = Cond(curr_cond_rnd) ; + + for iCond = 1:length(curr_cond) + %create table of color changes + switch curr_cond(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 + colLut = forFive; + case 4 + colLut = oneThrFive; + case 5 + colLut = lum; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; +% % % % % % % % case 2 +% % % % % % % % colLut = TEST_lum_l; + + end + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + WaitSecs(3); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, redLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, 'Pr', 20, 20, redLut, wRGB); + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, redLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + + + Priority(0); + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName; + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + WaitSecs(.4); +%else % -si no es numero -- ignorar +end + + +end %end while + +userRes + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +% 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; +% fprintf(fp, '%s\t%i/%i/%i %i:%i:%i\t%1.3f\t%1.3f\t%i\t%i\t%s\t%i\tPractice\n',... +% subName, time(2), time(3), time(1), time(4), time(5), round(time(6)), hfpRG, hfpBG, 1, cond(iCond), randStrt+5, userRes); + + time = clock; + fprintf(fp, '%s\t%i/%i/%i %i:%i:%i\t%1.3f\t%1.3f\t%i\t%i\t%i\t%s\tPractice\n',... + subName, time(2), time(3), time(1), time(4), time(5), round(time(6)), hfpRG, hfpBG, 1,curr_cond(iCond), randStrt, userRes); + +a = cd('/Users/clemente/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 + + WaitSecs(.2) + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + end +end + +clear iCond + +TrialCount = 1; +%run experiment +for iRep = 1:numRep + cont = randperm(numCont); %randomize contrast conditions + + for iCont = 1:numCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [white(1)+(white(1)*lCont(cont(iCont))) white(2) maxLum + white(1)-(white(1)*lCont(cont(iCont))) white(2) maxLum]; %+l, -l + s = [white(1) white(2)+(white(2)*sCont(cont(iCont))) maxLum + white(1) white(2)-(white(2)*sCont(cont(iCont))) maxLum];%+s, -s + forFive = [white(1)+(white(1)*lCont(cont(iCont))) white(2)+(white(2)*sCont(cont(iCont))) maxLum + white(1)-(white(1)*lCont(cont(iCont))) white(2)-(white(2)*sCont(cont(iCont))) maxLum]; + oneThrFive = [white(1)-(white(1)*lCont(cont(iCont))) white(2)+(white(2)*sCont(cont(iCont))) maxLum + white(1)+(white(1)*lCont(cont(iCont))) white(2)-(white(2)*sCont(cont(iCont))) maxLum]; + lum = [white(1) white(2) maxLum-lumMod(cont(iCont)) + white(1) white(2) maxLum+lumMod(cont(iCont))]; + + lum_l_45 = [white(1)+(white(1)*lCont(iCont)) white(2) maxLum+lumMod(iCont) + white(1)-(white(1)*lCont(iCont)) white(2) maxLum-lumMod(iCont)]; + + lum_l_135 = [white(1)+(white(1)*lCont(iCont)) white(2) maxLum-lumMod(iCont) + white(1)-(white(1)*lCont(iCont)) white(2) maxLum+lumMod(iCont)]; + + lum_s_45 = [white(1) white(2)+(white(2)*sCont(iCont)) maxLum+lumMod(iCont) + white(1) white(2)-(white(2)*sCont(iCont)) maxLum-lumMod(iCont)]; + + lum_s_135 = [white(1) white(2)+(white(2)*sCont(iCont)) maxLum-lumMod(iCont) + white(1) white(2)-(white(2)*sCont(iCont)) maxLum+lumMod(iCont)]; + + +% cond = 1:9 + rnd_idx = randperm(length(curr_cond)); + curr_cond = curr_cond(rnd_idx) +% Cond = Cond(curr_cond_rnd) ; + + for iCond = 1:length(curr_cond) + %create table of color changes + switch curr_cond(iCond) +% cond = randperm(9); +% for iCond = 1:9 + %create table of color changes +% switch cond(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 + colLut = forFive; + case 4 + colLut = oneThrFive; + case 5 + colLut = lum; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + WaitSecs(5); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); + Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, redLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, redLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)) + NumPressed = Nums{idx} + + kbName = strcat(firstDigit,NumPressed) + userRes = kbName +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +% userRes = num2str(2); + +AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + +aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +% aa = cd('D:\Dropbox\Luminotecnia\2017\Chicago Lab files\2 Experiments\Color AfterImage_Exp_Room_150\2nd\1 Programs\A Outputs') +cd +WaitSecs(.2) + +% + fprintf(fp, '%s\t%i/%i/%i %i:%i:%i\t%1.3f\t%1.3f\t%i\t%i\t%i\t%s\n',... + subName, time(2), time(3), time(1), time(4), time(5), round(time(6)), hfpRG, hfpBG, cont(iCont), curr_cond(iCond), randStrt+5, userRes); + + +a = cd('/Users/clemente/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 + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + TrialCount = TrialCount+1 + end %ICond + end %iCont + end %iRep +fclose(fp); +sca + + + + + + + + + + + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AfIm_NOclock_Exp.m b/002 After Image GUI Project/AfIm_NOclock_Exp.m new file mode 100644 index 0000000..22b9b25 --- /dev/null +++ b/002 After Image GUI Project/AfIm_NOclock_Exp.m @@ -0,0 +1,608 @@ +function AfIm_NOclock_Exp(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,OneHemi_chck,Simu_chck) +Clock = 1; +%%%%%%%%%%%%%%%% +% ARDUINO and CAMERA settings +Cam_freq = 240 ; % square waves freq +Cam_RECduration = 30; %in seconds. (30secs is the maximal time allowed by Matlab to play tone in arduino board) +ard = arduino; % open arduino +%%%%%%%%%%%%%%% + + +try +assignin('base','Stop_Press',0)% this works for the STOP experiment button + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +saveFile = sprintf('%s_afterimage', subName) +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); + +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + + + +% cd(a); % return to program folder. +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date) +pix = pix/1001; + + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +% % % % lumMod = fliplr(Final_lumMod_avg); +% % % % +% % % % sCont = [.8 .65 .5 .35]; +% % % % nCont = 4; + +% lCont = Final_lCont_avg(:,4:5); +% lumMod = Final_lumMod_avg(:,4:5); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% +% nCont = 2; + +% lCont = Final_lCont_avg(3:6); +% lumMod = Final_lumMod_avg(3:6); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% sCont = Final_sCont_ref; + +lCont = Final_lCont_avg; +lumMod = Final_lumMod_avg; +sCont = Final_sCont_ref; + +nCont = size(sCont,2); +nBckg_Chro = size(Bckg_Chro,1); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% Bckg_Chro = Final_lCont_avg(:,1:2) + +%% Save Session Information + +theDate = fix(clock); +% 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') +fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\n',... + subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... + meanLum, nBckg_Chro, nCont, nRep,axis_chck(1),axis_chck(2),... + axis_chck(3),axis_chck(4) ,axis_chck(5),axis_chck(6),... + axis_chck(7),axis_chck(8),axis_chck(9)); +% % % % 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)),... +% % % % 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(7),curr_cond(8),curr_cond(9)); + +fclose(fo) + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +cd(a); + +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 +ISI = 20; +%% Stimulus Size Parameters +circleDeg = 7.2; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +% % % circleDegGrid = 2 ; +% % % rad = circleDegGrid/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, 1*radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +WaitSecs(1); + + +%%///////////////////////////////////////////////////////////////////////// +%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// +%%///////////////////////////////////////////////////////////////////////// +clear iCond + +curr_axis = find(axis_chck) +%run experiment + +TrialCount = 1; + +Card_Dir = 0; + + for iChro = 1:size(Bckg_Chro,1) + + + +wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +commandwindow; +Speak(' Press any key when you are ready'); +KbStrokeWait; + + % Adaptation screen + Screen('FillRect', window, wRGB); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('Flip',window) + +WaitSecs(AdaptTime) + + for iRep = 1:nRep + + cont = randperm(nCont); %randomize contrast conditions + for iCont = 1:nCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum]; %+l, -l + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum];%+s, -s + + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; % -lum , +lum + + l_s_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + l_s_135 = [Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + + lum_l_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont))]; + + lum_l_135 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; + + lum_s_45 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont))]; + + lum_s_135 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont))]; + + + rnd_idx = randperm(length(curr_axis)); + curr_axis = curr_axis(rnd_idx) +% cond = randperm(9); + for iCond = 1:length(curr_axis) + %create table of color changes + switch curr_axis(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 %%%% ATENCION que ahora LUM es la condicion 3 + colLut = lum; + case 4 + colLut = l_s_45; + case 5 + colLut = l_s_135; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% loadCombined =1; +% if loadCombined +% rampLeft = importdata('rampLeft_Combined.mat'); +% rampRight = importdata('rampRight_Combined.mat'); +% end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),1*rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + %///////////// + switch OneHemi_chck + case 0 %if FullCircle + Dir = [1]; + case 1 + Dir = [2 -2]; %just one hemifield modulated + end + + Dir_rnd = randperm(1); + for iDir = 1:1 + Card_Dir = Dir(Dir_rnd(iDir)); + + switch Card_Dir + case {1,2} + ramp = rampLeft; % Increment + HF_posit = 0; % to place the hemifield in the LEFT position + case {-1,-2} + ramp = rampRight; % Decrement + HF_posit = 180; % to place the hemifield in the RIGHT position + end + %--------------------------- + + flatSound; % so the subject prepare for the stimulus + %%%%%%%%%%%%%%%%%%%%%%%%% + % START CAMERA RECORDING + playTone(ard,'D3',240,Cam_RECduration); % + %%%%%%%%%%%%%%%%%%%% + + WaitSecs(4); % + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + + +% switch OneHemi_chck%if FullCircle +% case 0 + %Full Circle + Screen('FillOval', window, ramp(iFrames,:), tstcircle ); +% case 1 +% % One Hemifield Modulated +% Screen('FillArc', window, ramp(iFrames,:), tstcircle, HF_posit, 180); +% end + + +% % % Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); +% % % Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + + if Clock %--------------------- + Screen('DrawDots', window, clockPosMat,clockPix, blackLut, center, 2); + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, blackLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + end % Clock --------------------- + +% % %----------------- +% % % PrintScreen of the monitor (for the paper) +% % % GetImage call. Alter the rect argument to change the location of the screen shot +% % imageArray = Screen('GetImage', window, [0 0 300 300]); +% % % imwrite is a Matlab function, not a PTB-3 function +% % imwrite(imageArray, 'test.jpg') +% % %------------------ + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); + WaitSecs(10); % to tell the subject to blink normally + flatSound; + +% Speak('Report Time') + + +% WaitSecs(5)% This is sumed to the ISI except for the last trial +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % RESPONSES % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if Clock + +% if Simu_chck +% userRes = 'simu'; +% +% else + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)); + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +% end % end simu_chck + +else + randStrt = 94;% it will be saved as 99 + userRes = '99'; + +end % Clock + +% userRes = num2str(2); +% +% AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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; +% % 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\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, userRes); + + 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',... + 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); + +% 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'); % + + cd + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('Flip', window); + clear secHandCord colLut + + + TrialCount = TrialCount+1 + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % WANT TO STOP? % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% pause(3) + yesno=evalin('base','Stop_Press') + + + if yesno==1 + return + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +WaitSecs(ISI); % + + + + end % iDir + end %ICond + end %iCont + end %iRep +end %iChro + + %%%%%%%%%%%%%%%%%% + % STOP CAMERA + Speak('Stop camera software'); + WaitSecs(10); + writeDigitalPin(ard,'D3',1); + writeDigitalPin(ard,'D3',0); + %%%%%%%%%%%%%%%%% + +fclose(fp); +sca +%create a matrix of seconds compared to pi values for each frame - just +%used in data analysis +% % % % piVSsecs(:,1) = [0:1/(nFrames-1):1]; +% % % % piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; + catch + warndlg('The program failed to run. Try again.') + return + +end + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AfIm_OneEnd_Exp.m b/002 After Image GUI Project/AfIm_OneEnd_Exp.m new file mode 100644 index 0000000..ffabe7f --- /dev/null +++ b/002 After Image GUI Project/AfIm_OneEnd_Exp.m @@ -0,0 +1,552 @@ +function AfIm_OneEnd_Exp(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,OneHemi_chck,Simu_chck) +% Sti_Shape = 2 ;% 1 is the whole circle and 2 one hemifield +try +assignin('base','Stop_Press',0)% this works for the STOP experiment button + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +saveFile = sprintf('%s_afterimage', subName) +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); + +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + + + +% cd(a); % return to program folder. +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date) +pix = pix/1001; + + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +% % % % lCont = fliplr(Final_lCont_avg);% sort the matrix in descendent order +% % % % lumMod = fliplr(Final_lumMod_avg); +% % % % +% % % % sCont = [.8 .65 .5 .35]; +% % % % nCont = 4; + +% lCont = Final_lCont_avg(:,4:5); +% lumMod = Final_lumMod_avg(:,4:5); +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +% +% nCont = 2; + +lCont = Final_lCont_avg; +lumMod = Final_lumMod_avg; +% sCont = [.5 .65 +% .5 .65 +% .5 .65 +% .5 .65]; +sCont = Final_sCont_ref; + +nCont = size(sCont,2); +nBckg_Chro = size(Bckg_Chro,1); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% Bckg_Chro = Final_lCont_avg(:,1:2) + +%% Save Session Information + +theDate = fix(clock); +% 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') +fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\n',... + subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... + meanLum, nBckg_Chro, nCont, nRep,axis_chck(1),axis_chck(2),... + axis_chck(3),axis_chck(4) ,axis_chck(5),axis_chck(6),... + axis_chck(7),axis_chck(8),axis_chck(9)); +% % % % 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)),... +% % % % 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(7),curr_cond(8),curr_cond(9)); + +fclose(fo) + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +% cd(a); + +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 2.9*2; %how long is clock in the screen +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 + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +WaitSecs(1); + + +%%///////////////////////////////////////////////////////////////////////// +%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// +%%///////////////////////////////////////////////////////////////////////// +clear iCond + +curr_axis = find(axis_chck) +%run experiment + +TrialCount = 1; + + + + for iChro = 1:size(Bckg_Chro,1) + + + +wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +commandwindow; +Speak('Press Any Key when you are ready'); +KbStrokeWait; + +Screen('FillRect', window, wRGB); + +Screen('Flip',window) + + +WaitSecs(AdaptTime) + + for iRep = 1:nRep + + cont = randperm(nCont); %randomize contrast conditions + for iCont = 1:nCont + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum]; %+l, -l + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum];%+s, -s + + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; % -lum , +lum + + l_s_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + l_s_135 = [Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + + lum_l_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont))]; + + lum_l_135 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; + + lum_s_45 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont))]; + + lum_s_135 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont))]; + + + rnd_idx = randperm(length(curr_axis)); + curr_axis = curr_axis(rnd_idx) +% cond = randperm(9); + for iCond = 1:length(curr_axis) + %create table of color changes + switch curr_axis(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 %%%% ATENCION que ahora LUM es la condicion 3 + colLut = lum; + case 4 + colLut = l_s_45; + case 5 + colLut = l_s_135; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + + %///////////// + switch OneHemi_chck + case 0 %if FullCircle + Dir = [1 -1]; + case 1 + Dir = [2 -2]; %just one hemifield modulated + end + + Dir_rnd = randperm(2); + for iDir = 1:2 + Card_Dir = Dir(Dir_rnd(iDir)); + + switch Card_Dir + case {1,2} + ramp = rampLeft; % Increment + HF_posit = 0; % to place the hemifield in the LEFT position + case {-1,-2} + ramp = rampRight; % Decrement + HF_posit = 180; % to place the hemifield in the RIGHT position + end + + %---------------------------------------- + % Random Clock Start + %---------------------------------------- + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + + + WaitSecs(5); %a short adaptation before the next trial + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + + switch OneHemi_chck%if FullCircle + case 0 + %Full Circle + Screen('FillOval', window, ramp(iFrames,:), tstcircle ); + case 1 + % One Hemifield Modulated + Screen('FillArc', window, ramp(iFrames,:), tstcircle, HF_posit, 180); + end + +% Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); +% Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, clockPosMat,clockPix, blackLut, center, 2); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, blackLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); + + +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % RESPONSES % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if Simu_chck + userRes = 'simu'; + +else +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)); + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +end +% userRes = num2str(2); + +AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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; + 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',... + 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); + + +% 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'); % + + cd + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('Flip', window); + clear secHandCord colLut + + TrialCount = TrialCount+1 + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % WANT TO STOP? % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% pause(3) + yesno=evalin('base','Stop_Press') + + + if yesno==1 + return + end + + end %iDir + end %ICond + end %iCont + end %iRep +end %iChro + +fclose(fp); +sca +%create a matrix of seconds compared to pi values for each frame - just +%used in data analysis +% % % % piVSsecs(:,1) = [0:1/(nFrames-1):1]; +% % % % piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; + catch + warndlg('The program failed to run. Try again.') + return + +end + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AfIm_pupil_Exp.m b/002 After Image GUI Project/AfIm_pupil_Exp.m new file mode 100644 index 0000000..d31fb80 --- /dev/null +++ b/002 After Image GUI Project/AfIm_pupil_Exp.m @@ -0,0 +1,600 @@ +function AfIm_pupil_Exp(subName,meanLum,Bckg_Chro,axis_chck,AdaptTime,nRep,OneHemi_chck,Simu_chck) +Clock = 0; +%%%%%%%%%%%%%%%% +% ARDUINO and CAMERA settings + +Cam_freq = 240 ; % square waves freq +Cam_RECduration = 30; %in seconds. (30secs is the maximal time allowed by Matlab to play tone in arduino board) +ard = arduino; % open arduino +%%%%%%%%%%%%%%% + + +try +assignin('base','Stop_Press',0)% this works for the STOP experiment button + +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +saveFile = sprintf('%s_Pupil_AfIm', subName) +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); + +fp = fopen(saveFile, 'at'); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + + + +% cd(a); % return to program folder. +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date) +pix = pix/1001; + + +cd(aa) ;% output folder +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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 + +contFile = sprintf('%s_ContMatch', subName); +cd +load(contFile, '-mat') + +lCont = Final_lCont_avg; +lumMod = Final_lumMod_avg; +sCont = Final_sCont_ref; + +nCont = size(sCont,2); +nBckg_Chro = size(Bckg_Chro,1); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% Bckg_Chro = Final_lCont_avg(:,1:2) + +%% Save Session Information + +theDate = fix(clock); +% 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') +fprintf(fo, '%s\t%i/%i/%i %i:%i:%i\t %1.2f\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\t%i\tPupil\n',... + subName, theDate(2), theDate(3), theDate(1), theDate(4), theDate(5), round(theDate(6)),... + meanLum, nBckg_Chro, nCont, nRep,axis_chck(1),axis_chck(2),... + axis_chck(3),axis_chck(4) ,axis_chck(5),axis_chck(6),... + axis_chck(7),axis_chck(8),axis_chck(9)); +% % % % 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)),... +% % % % 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(7),curr_cond(8),curr_cond(9)); + +fclose(fo) + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT + +% cd(a); + +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % Set a black screen before starting +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 8; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +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 +%in Zaidi, clock face appears at 10.15 seconds, will approximate this +%number +zaidiClock = 2%10.15; %is when Zaidi started in his example. +clFrmStart = floor(1/ifi*zaidiClock); +clTotTime = 6%2.9*2; %how long is clock in the screen +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 + + +if Clock + ISI = 8; +else +ISI = 20; +end +%% Stimulus Size Parameters +circleDeg = 7.2; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +%create circular grid for clock face and the numbers +% % % circleDegGrid = 2 ; +% % % rad = circleDegGrid/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +rad = circleDeg/2*pixPerDeg; %circlePix/2-pixPerDeg/2; +radNum = (circleDeg/2) * pixPerDeg; +clockDegs = [1:15:360]; +for iC = 1:length(clockDegs) + [xcFace(iC), ycFace(iC)] = pol2cart(clockDegs(iC)*pi/180, rad); + [xcNumber(iC), ycNumber(iC)] = pol2cart(clockDegs(iC)*pi/180, 1*radNum); +end + +%create matrix of dot locations +clockPosMat = [reshape(xcFace,1, length(clockDegs)); reshape(ycFace,1, length(clockDegs))]; +clockNumMat = [reshape(xcNumber,1, length(clockDegs)); reshape(ycNumber,1, length(clockDegs))]; + +Screen('TextSize', window, 14); +textOne = [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; +%create array of second hand positions to index +count = 1; +secHandCord(1:handInt) = (1:15:360)*(pi/180); +for iMove = 1:length(secHandCord) + secHandMove(count:count+clFrames-1) = secHandCord(iMove); + count = count+clFrames; +end +secHandMove(length(secHandMove)+1:length(secHandMove)*2) = secHandMove(1:length(secHandMove)); + + +WaitSecs(1); + + +%%///////////////////////////////////////////////////////////////////////// +%%///////////////////////// EXPERIMENT TRIALS ///////////////////////////// +%%///////////////////////////////////////////////////////////////////////// +clear iCond + +curr_axis = find(axis_chck) +%run experiment + +TrialCount = 1; + +Card_Dir = 0; + + for iChro = 1:size(Bckg_Chro,1) + + + +wLMS(1,1) = Bckg_Chro(iChro,1)*meanLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*meanLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*meanLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +commandwindow; +Speak(' Press any key when you are ready'); +KbStrokeWait; + + % Adaptation screen + Screen('FillRect', window, wRGB); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('Flip',window) + +WaitSecs(AdaptTime) + + + + cont = randperm(nCont); %randomize contrast conditions + for iCont = 1:nCont + for iRep = 1:nRep + FlushEvents('mouseDown','keyDown'); + + %create colors with depending on contrast + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum]; %+l, -l + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum];%+s, -s + + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; % -lum , +lum + + l_s_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + l_s_135 = [Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum + Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum]; + + + lum_l_45 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont))]; + + lum_l_135 = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont(iChro,cont(iCont))) Bckg_Chro(iChro,2) meanLum+lumMod(iChro,cont(iCont))]; + + lum_s_45 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont))]; + + lum_s_135 = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum-lumMod(iChro,cont(iCont)) + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(iChro,cont(iCont))) meanLum+lumMod(iChro,cont(iCont))]; + + + rnd_idx = randperm(length(curr_axis)); + curr_axis = curr_axis(rnd_idx) +% cond = randperm(9); + for iCond = 1:length(curr_axis) + %create table of color changes + switch curr_axis(iCond) + case 1 + colLut = l; + case 2 + colLut = s; + case 3 %%%% ATENCION que ahora LUM es la condicion 3 + colLut = lum; + case 4 + colLut = l_s_45; + case 5 + colLut = l_s_135; + case 6 + colLut = lum_l_45; + case 7 + colLut = lum_l_135; + case 8 + colLut = lum_s_45; + case 9 + colLut = lum_s_135; + end + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% loadCombined =1; +% if loadCombined +% rampLeft = importdata('rampLeft_Combined.mat'); +% rampRight = importdata('rampRight_Combined.mat'); +% end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + %create random start point for clock hand + randStrt = randi(handInt-1); %won't pick midnight as start point due to second hand array not being long enough + %clock set to go around 1 full circle + for ihand = 1:handInt*clFrames+clFrames + th(ihand) = (secHandMove(randStrt*clFrames-clFrames+ihand)); + [handx(ihand), handy(ihand)] = pol2cart(th(ihand),1*rad); + end + + handx = handx + xcent; + handy = handy + ycent; + + %///////////// + switch OneHemi_chck + case 0 %if FullCircle + Dir = [-1]; + case 1 + Dir = [2 -2]; %just one hemifield modulated + end + + Dir_rnd = randperm(1); + for iDir = 1:1 + Card_Dir = Dir(Dir_rnd(iDir)); + + switch Card_Dir + case {1,2} + ramp = rampLeft; % Increment + HF_posit = 0; % to place the hemifield in the LEFT position + case {-1,-2} + ramp = rampRight; % Decrement + HF_posit = 180; % to place the hemifield in the RIGHT position + end + %--------------------------- + + if ~Clock + flatSound; % so the subject prepare for the stimulus + WaitSecs(4); % a few seconds before start recording + %%%%%%%%%%%%%%%%%%%%%%%%% + % START CAMERA RECORDING + playTone(ard,'D3',240,Cam_RECduration); % + %%%%%%%%%%%%%%%%%%%% + + WaitSecs(4); % + end + + keypress = 0; + count = 0; %for clock hand + TrialCountStr = num2str(TrialCount); + Priority(topPriorityLevel); + FlushEvents('mouseDown','keyDown'); + %ListenChar(2) + secs0 = Screen('Flip', window); + for iFrames = 1:nFrames + + +% switch OneHemi_chck%if FullCircle +% case 0 + %Full Circle + Screen('FillOval', window, ramp(iFrames,:), tstcircle ); +% case 1 +% % One Hemifield Modulated +% Screen('FillArc', window, ramp(iFrames,:), tstcircle, HF_posit, 180); +% end + + +% % % Screen('FillArc', window, rampLeft(iFrames,:), tstcircle, 0, 180); +% % % Screen('FillArc', window, rampRight(iFrames,:), tstcircle, 180, 180); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + + if Clock %--------------------- + Screen('DrawDots', window, clockPosMat,clockPix, blackLut, center, 2); + Screen('DrawText', window, TrialCountStr, 20, 20, redLut, wRGB); + + + for itxt = 1:24 + textNum = sprintf('%i', textOne(itxt)); + Screen('DrawText', window, textNum, 1.18*clockNumMat(1,itxt)+center(1,1)-7, 1.18*clockNumMat(2,itxt)+center(1,2)-7, blackLut, wRGB); + end + + if iFrames == clFrmStart + beep; + end + + if iFrames > clFrmStart-1 && iFrames < clFrmStart + handInt*clFrames+5 + count = count+1; + Screen('DrawLine', window, redLut, xcent, ycent, handx(count), handy(count), 2.5); + end + + end % Clock --------------------- + +% % %----------------- +% % % PrintScreen of the monitor (for the paper) +% % % GetImage call. Alter the rect argument to change the location of the screen shot +% % imageArray = Screen('GetImage', window, [0 0 300 300]); +% % % imwrite is a Matlab function, not a PTB-3 function +% % imwrite(imageArray, 'test.jpg') +% % %------------------ + + vbl = Screen('Flip', window, secs0 + (waitframes - 0.5) * ifi); + + Screen('DrawingFinished', window); % tell psychtoolbox drawing is finished, should help timing + + end + Priority(0); + + if ~Clock + WaitSecs(18); % to tell the subject to blink normally + flatSound; + end + +% Speak('Report Time') + + +% WaitSecs(5)% This is sumed to the ISI except for the last trial +% % % % while ~keypress +% % % % if CharAvail +% % % % userRes = input(' '); +% % % % keypress = 1; +% % % % end +% % % % end +% % % % FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % RESPONSES % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if Clock + +% if Simu_chck +% userRes = 'simu'; +% +% else + +keyIsDown=0; +kbName=[]; +Digit = []; + +Nums = {'0','1','2','3','4','5','6','7','8','9'}; +Screen('TextSize', window, 30); +commandwindow; +while keyIsDown==0 | (strcmp('ENTER',kbName)==0)% & strcmp('2',kbName)==0) + +keyIsDown=0; +[keyIsDown, secs, keyCode] = KbCheck; + + +if keyIsDown==1 % +kbName = KbName(keyCode); +end + +if Digit & any(strcmp(Nums(:),kbName)); + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + + kbName = strcat(firstDigit,NumPressed); + userRes = kbName; +% DrawFormattedText(window, kbName, 'center', 'center', color); + DrawFormattedText(window, kbName, 400, 512, redLut); + Screen('Flip', window); + kbName = []; + Digit = 0; + WaitSecs(.4); +elseif any(strcmp(Nums(:),kbName)) + idx=find(strcmp(Nums(:),kbName)); + NumPressed = Nums{idx}; + userRes = kbName; + %-si es numero -- llevarlo a la pantalla + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); + + Digit = 1 ;% flag to mean that + firstDigit = kbName; + WaitSecs(.4); + kbName = []; + +end + +if strcmp('DELETE',kbName)==1 %-si es el backspace --limpiar numero + kbName = []% ; + userRes = kbName + firstDigit = []; + Digit = 0; + DrawFormattedText(window, kbName, 400, 512, redLut); + % Flip to the screen + Screen('Flip', window); +%else % -si no es numero -- ignorar + WaitSecs(.4); +end + + +end %end while + +% end % end simu_chck + +else + randStrt = 94;% it will be saved as 99 + userRes = '99'; + +end % Clock + +% userRes = num2str(2); +% +% AfterResp = 'OK' + + + +Screen('TextSize', window, 14); + FlushEvents('mouseDown','keyDown'); + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +% 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; +% % 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\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, userRes); + + 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\tPupilExp\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); + +% 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'); % + + cd + + WaitSecs(.2) + + + %ListenChar(0) + Screen('FillRect', window, wRGB, windowRect); + Screen('DrawDots', window, [0 0],clockPix, 0, center, 2); % black dot for fixation + Screen('Flip', window); + clear secHandCord colLut + + + TrialCount = TrialCount+1 + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % WANT TO STOP? % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% pause(3) + yesno=evalin('base','Stop_Press') + + + if yesno==1 + return + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +WaitSecs(ISI); % + + + + end % iDir + end %ICond + end %iCont + end %iRep +end %iChro + + %%%%%%%%%%%%%%%%%% + % STOP CAMERA + Speak('Stop camera software'); + WaitSecs(10); + writeDigitalPin(ard,'D3',1); + writeDigitalPin(ard,'D3',0); + %%%%%%%%%%%%%%%%% + +fclose(fp); +sca +%create a matrix of seconds compared to pi values for each frame - just +%used in data analysis +% % % % piVSsecs(:,1) = [0:1/(nFrames-1):1]; +% % % % piVSsecs(:,2) = [0:numSecs/(nFrames-1):numSecs]; + catch + warndlg('The program failed to run. Try again.') + return + +end + +end \ No newline at end of file diff --git a/002 After Image GUI Project/AppTEST copy.mlapp b/002 After Image GUI Project/AppTEST copy.mlapp new file mode 100644 index 0000000..e794df4 Binary files /dev/null and b/002 After Image GUI Project/AppTEST copy.mlapp differ diff --git a/002 After Image GUI Project/AppTESTpackaged.prj b/002 After Image GUI Project/AppTESTpackaged.prj new file mode 100644 index 0000000..dbd8231 --- /dev/null +++ b/002 After Image GUI Project/AppTESTpackaged.prj @@ -0,0 +1,91 @@ + + + AppTESTpackaged + CP + + UIC + ${PROJECT_ROOT}/AppTESTpackaged_resources/icon_24.png + + ${PROJECT_ROOT}/AppTESTpackaged_resources/icon_48.png + ${PROJECT_ROOT}/AppTESTpackaged_resources/icon_24.png + ${PROJECT_ROOT}/AppTESTpackaged_resources/icon_16.png + + + + + 1.0 + + MATLAB + + + 1 + + + 9.0 + + + /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project + 602a72bb-7004-4a02-a8fc-d08478156bbd + + + + + + + + + + + + + + + /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project + + + + /Applications/MATLAB_R2016a.app + + + + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + true + true + false + false + false + false + false + false + 10.12.6 + false + true + maci64 + true + + + \ No newline at end of file diff --git a/002 After Image GUI Project/ContMatch_session.m b/002 After Image GUI Project/ContMatch_session.m new file mode 100644 index 0000000..f7c663e --- /dev/null +++ b/002 After Image GUI Project/ContMatch_session.m @@ -0,0 +1,489 @@ +function ContMatch_session(subName,meanLum,Bckg_Chro,AdaptTime,curr_cond) + +try +assignin('base','Stop_Press',0)% this works for the STOP experiment button + +commandwindow; % open this, and the cursor will appear there +% Check that Psychtoolbox is properly installed, switch to unified KbName's +% across operating systems, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +%% Start Experiment + +a = cd; +theDate = fix(clock); +saveFile = sprintf('%s_ContMatch.mat', subName); + +%% Color information, load hfp data and color calibration + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg +hfpBG = bg_avg + +% hfpRG = .89; +% hfpBG = 1 ; + +%% Load previous matched contrast + +name = sprintf('%s_ContMatch.mat', subName); +if exist(name, 'file') == 2 + +load(name) + +% Prev_l_cont_match = l_cont_match; +l_cont_match = []; +% Prev_lum_cont_match = lum_cont_match; +lum_cont_match = []; +% Prev_lumMod_match = lumMod_match; +lumMod_match = []; + + + +else + +Prev_l_cont_match = []; +Prev_lum_cont_match = []; +Prev_lumMod_match = []; + +end + + + + +%% +cd(a); % return to folder where the program is +% Calib_Dire = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/001 After Image GUI Project'); +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date); +pix = pix/1001; +maxLum = 20; %cd/m^2 + +lumMod_initial = [.6 .7 .8 1 ]; + +lCont_initial = [0.02 0.026 0.034 .04]; + + +sCont = [.35 .5 .65 .8]; +% sCont = [.5 .5 .5 .5]; + +nCont = length(sCont); + +% white = [.665 1]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + +% % Bckg_Chro = [.665 1.353 +% % .665 .647 +% % .647 1 +% % .683 1]; % 4 rows X 2 columns + + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT +% % % wLMS(1,1) = white(1,1)*maxLum; +% % % wLMS(1,2) = (1-white(1,1))*maxLum; +% % % wLMS(1,3) = white(1,2)*maxLum; +% % % wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +% % % wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +% % % wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +% % % wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +% % % wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); % +%Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +% % % % numSecs = 16; %in seconds, total presentation time +hfpFreq = 4.6; hfpPeriod = 1/hfpFreq; +numSecs = hfpPeriod; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; + +% waitframes = floor(framesPerSec/hfpFreq); %number of frames to wait between refresh + nFrames = round(hfpPeriod /ifi) ; +% % % % waitframes = 1; %number of frames to wait between refresh +waitframes = 1; %number of frames to wait between refresh + +%% Stimulus Size Parameters +circleDeg = 3.6; +clockPt = 0.1; + +% code assumes 1 pixel = 1 arc min +pixPerDeg = 35; %at a distance of 57 cm +circlePix = circleDeg*pixPerDeg; +clockPix = clockPt*pixPerDeg; + +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + + +WaitSecs(1); + +%run experiment +Priority(topPriorityLevel); + +vbl = Screen('Flip', window); + + + + +%%///////////////////////////////////////////////////////////////////////// +%%/ TRIALS +%%///////////////////////////////////////////////////////////////////////// + +stepSize_l = 0.0005; +stepSize_lum = 0.01; +order = randi(1); +count = 0; + +nRep = 3; % in this case is always three + +for iChro = 1:size(Bckg_Chro,1) + +wLMS(1,1) = Bckg_Chro(iChro,1)*maxLum; +wLMS(1,2) = (1-Bckg_Chro(iChro,1))*maxLum; +wLMS(1,3) = Bckg_Chro(iChro,2)*maxLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +Screen('FillRect', window, wRGB); +Screen('Flip',window) +WaitSecs(AdaptTime) + + for iaxis = curr_cond(1):curr_cond(end); % 1 means lCont and 2 means lumCont + for icont = 1:nCont % number of contrast to match + for irep = 1:nRep % + + FlushEvents('mouseDown','keyDown'); + + order = de2bi(count) + order = order(1); %use the last digit of the binary number (that is the first to matlab) so it switch between 0 and 1 + +if iaxis == 1 + cont_values = linspace(lCont_initial(icont),lCont_initial(icont)-0.02,21); + initial_idx = randi(length(cont_values)) + lCont = cont_values(initial_idx) +elseif iaxis == 2 + cont_values = linspace(lumMod_initial(icont),lumMod_initial(icont)-.5,21); + initial_idx = randi(length(cont_values)) + lumMod = cont_values(initial_idx) +end + +%%///////////////////////////////////////////////////////////////////////// +%%/ SUBJECT INPUTS (RESPONSES) +%%///////////////////////////////////////////////////////////////////////// + + DoneMatch = 0; + +while ~DoneMatch %look for key presses and put up stimulus + [ keyIsDown, timeSecs, keyCode ] = KbCheck; + if(CharAvail) % check for keypress, record if key=1 or 2 or 3 + [char] = GetChar; + switch char + case '8' + DoneMatch = 1; + clc + + switch iaxis + case 1 + l_cont_match (irep, icont) = lCont + case 2 + lumMod_match (irep, icont) = lumMod + lum_cont_match (irep, icont) = (lumMod) / maxLum + end + + case '6' + + switch iaxis + case 1 + lCont = lCont + stepSize_l + case 2 + lumMod = lumMod + stepSize_lum + end + + case '4' + + switch iaxis + case 1 + lCont = lCont - stepSize_l + if lt(lCont,0) + lCont=0 + end + case 2 + lumMod = lumMod - stepSize_lum + if lt(lumMod,0) + lumMod=0 + end + end + + case '9' + + switch iaxis + case 1 + lCont = lCont + stepSize_l/5; + case 2 + lumMod = lumMod + stepSize_lum/10; + end + + case '7' + + switch iaxis + case 1 + lCont = lCont - stepSize_l/5; + if lt(lCont,0) + lCont=0 + end + case 2 + lumMod = lumMod - stepSize_lum/10; + if lt(lumMod,0) + lumMod=0 + end + end + + end + FlushEvents('keyDown'); + end + +%%///////////////////////////////////////////////////////////////////////// +%%/ SET STIMULUS +%%///////////////////////////////////////////////////////////////////////// + %create colors depending on contrast + switch iaxis + case 1 + l = [Bckg_Chro(iChro,1)+(Bckg_Chro(iChro,1)*lCont) Bckg_Chro(iChro,2) maxLum + Bckg_Chro(iChro,1)-(Bckg_Chro(iChro,1)*lCont) Bckg_Chro(iChro,2) maxLum]; %+l, -l + + colLut = l; + + case 2 + lum = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) maxLum-lumMod + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2) maxLum+lumMod]; + + colLut = lum; + end + + s = [Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)+(Bckg_Chro(iChro,2)*sCont(icont)) maxLum + Bckg_Chro(iChro,1) Bckg_Chro(iChro,2)-(Bckg_Chro(iChro,2)*sCont(icont)) maxLum];%+s, -s + +colLut_R = s; + + + + %LMS values of each color, ls to LMS + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + + cLMS_R(iLMS,1) = colLut_R(iLMS,1)*colLut_R(iLMS, 3); + cLMS_R(iLMS,2) = (1-colLut_R(iLMS,1))*colLut_R(iLMS, 3); + cLMS_R(iLMS,3) = colLut_R(iLMS,2)*colLut_R(iLMS, 3); + + + + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + + cXYZ_R(iXYZ,:) = LMS_to_XYZ(cLMS_R(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + + + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + + cRGB_R(iRGB,:) = XYZ_to_RGB(cXYZ_R(iRGB,:), maxPhosXYZ); + cRGB_R(iRGB,1) = pix(dsearchn(redProp(:), cRGB_R(iRGB,1)))*hfpRG; + cRGB_R(iRGB,2) = pix(dsearchn(grnProp(:), cRGB_R(iRGB,2))); + cRGB_R(iRGB,3) = pix(dsearchn(blueProp(:), cRGB_R(iRGB,3)))*hfpBG; + end + + + Left = zeros(nFrames,3); + Right = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + Left(:,iRamp) = sinspaceOneCycle(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + Right(:,iRamp) = sinspaceOneCycle(wRGB(1,iRamp), cRGB_R(1,iRamp), nFrames); + end + + +%%///////////////////////////////////////////////////////////////////////// +%%/ DISPLAY STIMULUS +%%///////////////////////////////////////////////////////////////////////// + +startT=GetSecs(); +elapsedT=0; +for iFrames = 1:nFrames + + + + +switch order + case 0 +%LEFT SEMICIRCLE + Screen('FillArc', window, Left(iFrames,:), tstcircle, 180, 180); + % vbl = Screen('Flip', window, vbl + (waitframes - 0.5) * ifi); + Screen('FillArc', window, Right(iFrames,:), tstcircle, 0, 180); + vbl = Screen('Flip', window, vbl + (waitframes - 0.5) * ifi); + + case 1 + %LEFT SEMICIRCLE + Screen('FillArc', window, Right(iFrames,:), tstcircle, 180, 180); + % vbl = Screen('Flip', window, vbl + (waitframes - 0.5) * ifi); + Screen('FillArc', window, Left(iFrames,:), tstcircle, 0, 180); + vbl = Screen('Flip', window, vbl + (waitframes - 0.5) * ifi); + +end + +end + + end %while done + + + +count = count+1; +elapsedT=GetSecs()-startT; +FreqCheck = 1/elapsedT; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % CHECK STOP BUTTON PUSHING? % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + yesno=evalin('base','Stop_Press') + + + if yesno==1 + return + end + + % - - - - - - - - - - - - - - - - - - - - - - - - - - + + end % irep + end %icont + end % iaxis + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % FINAL VARIABLES % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + lCont_avg = median(l_cont_match,1); lCont_sd = std(l_cont_match,1); + lumCont_avg = median(lum_cont_match,1); lumCont_sd = std(lum_cont_match,1); + lumMod_avg = median(lumMod_match); + Avg_MatchCont = [lCont_avg ; + lumCont_avg]; + + + TodayDate = datevec(date); + for ii=1:nRep + CoMatch_Date(ii,1:3) = TodayDate(1:3) ; + end + + + Dated_l_cont_match = [CoMatch_Date repelem(Bckg_Chro(iChro,:),nRep,1) l_cont_match]; + Dated_lum_cont_match = [CoMatch_Date repelem(Bckg_Chro(iChro,:),nRep,1) lum_cont_match]; + Dated_lumMod_match = [CoMatch_Date repelem(Bckg_Chro(iChro,:),nRep,1) lumMod_match]; + + + if ~isempty(l_cont_match) + Prev_l_cont_match = [Prev_l_cont_match ; + Dated_l_cont_match]; + end + + if ~isempty(lum_cont_match) + Prev_lum_cont_match = [Prev_lum_cont_match ; + Dated_lum_cont_match]; + + Prev_lumMod_match = [Prev_lumMod_match ; + Dated_lumMod_match]; + end + + + if gt(size(Prev_l_cont_match,1),4)% Final values of contrast for the afterimage program + idx_l = find(and(Prev_l_cont_match(:,4) == Bckg_Chro(iChro,1), Prev_l_cont_match(:,5) == Bckg_Chro(iChro,2) )) + idx_lum = find(and(Prev_lum_cont_match(:,4) == Bckg_Chro(iChro,1), Prev_lum_cont_match(:,5) == Bckg_Chro(iChro,2) )) + idx_lumMod = find(and(Prev_lumMod_match(:,4) == Bckg_Chro(iChro,1), Prev_lumMod_match(:,5) == Bckg_Chro(iChro,2) )) + + + Final_lCont_avg(iChro,:) = [Bckg_Chro(iChro,:) median(Prev_l_cont_match(idx_l,end-3:end))]; + Final_lumCont_avg(iChro,:) = [Bckg_Chro(iChro,:) median(Prev_lum_cont_match(idx_lum,end-3:end))]; + Final_lumMod_avg(iChro,:) = [Bckg_Chro(iChro,:) median(Prev_lumMod_match(idx_lumMod,end-3:end))]; + else + Msg = 'MORE MEASUREMENTS ARE NEEDEED' + Final_lCont_avg = []; + Final_lumCont_avg = []; + Final_lumMod_avg = []; + + end + Final_sCont_ref = sCont; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % PLOT AND SAVE % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + f(iChro) = figure + + if ~isempty(l_cont_match) + errorbar(sCont,lCont_avg,lCont_sd,'r*--','MarkerSize',15); hold on + end + + if ~isempty(lum_cont_match) + errorbar(sCont,lumCont_avg,lumCont_sd,'k*--','MarkerSize',15); + end + + switch iChro + case 1 + set(f(iChro), 'Position', [1100 770 500 500]); + title('North (blueish)') + case 2 + set(f(iChro), 'Position', [1100 170 500 500]); + title('South (yellowish)') + case 3 + set(f(iChro), 'Position', [400 470 500 500]); + title('West (greenish)') + case 4 + set(f(iChro), 'Position', [1700 470 500 500]); + title('East (redish)') + end + + + end% iChro + +Screen('CloseAll') + +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +save(saveFile,'Final_lCont_avg','Final_lumCont_avg','Final_lumMod_avg','Final_sCont_ref',... + 'Prev_l_cont_match','Prev_lum_cont_match','Prev_lumMod_match') + +sca + + figure(1);figure(2);figure(3);figure(4); %bring figures to front + + catch + warndlg('The program failed to run. Try again.') + return + +end + + +end \ No newline at end of file diff --git a/002 After Image GUI Project/Disp_Color.m b/002 After Image GUI Project/Disp_Color.m new file mode 100644 index 0000000..156cf8d --- /dev/null +++ b/002 After Image GUI Project/Disp_Color.m @@ -0,0 +1,99 @@ +function Disp_Color(l_value,s_value,hfpRG,hfpBG) + +commandwindow; % open this, and the cursor will appear in the command window + + +% %% Choose program +% EEW_StdObsANDSubj = 0; +% EEW_Subj = 1; + +%% + +% Check that Psychtoolbox is properly installed, and switch color range to normalized 0 - 1 range: +PsychDefaultSetup(2); + +%% Start Experiment + +a = cd; +theDate = fix(clock); +% subName = 'DC'%input(sprintf('\nEnter Subject Initials: ')) + +duration= 5; % sec +% %% Color information, load hfp data and color calibration +% +% aa = cd('/Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/A Outputs'); +% hfpFile = sprintf('%sHFP', subName); +% load(hfpFile, '-mat') +% hfpRG = rg_avg; +% hfpBG = bg_avg; + +% hfpRG = .89; +% hfpBG = .97 ; + +%% +cd(a); % return to folder where the program is +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +load colorCalFile1.mat +fprintf('\nLast calibrationS was %s\n', describe.date); +pix = pix/1001; +maxLum = 20; %cd/m^2 + +l_s_pair = [l_value s_value]; +blackLut = [0 0 0]; +redLut = [.8 0 0]; + + + + +%% set up psych toolbox +%set up 10 bit color +PsychImaging('PrepareConfiguration'); +%PsychImaging('AddTask', 'General', 'EnableNative10BitFrameBuffer',1); %the 0 is turn off dithering? +expScreen = 1; +%create white LUT +wLMS(1,1) = .665*maxLum;%l_s_pair(1,1)*maxLum; +wLMS(1,2) = (1-.665)*maxLum;%(1-l_s_pair(1,1))*maxLum; +wLMS(1,3) = 1*maxLum;%l_s_pair(1,2)*maxLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))%*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))%*hfpBG; + +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0]); %EEW for standard observer + +%% Circle parameters +[xCenter, yCenter] = RectCenter(windowRect);% Get the centre coordinate of the window +baseRect = [0 0 300 300]; % Rect of 200 by 250 pixels +maxDiameter = max(baseRect) * 1.01;% For Ovals we set a miximum diameter up to which it is perfect for +centeredRect = CenterRectOnPointd(baseRect, xCenter, yCenter);% Center the rectangle on the centre of the screen + + +%% + +Screen('FillRect', window, [0 0 0], windowRect);% dark screen +Screen('Flip', window); +WaitSecs(1) + +% % if EEW_StdObsANDSubj +% Screen('FillOval', window, wRGB, centeredRect, maxDiameter); % Draw the rect to the screen +% Screen('Flip', window); +% WaitSecs(duration) +% +% % end + +% if EEW_Subj +wRGB(1,1) = wRGB(1,1)*hfpRG; +wRGB(1,2) = wRGB(1,2); +wRGB(1,3) = wRGB(1,3)*hfpBG; +% +Screen('FillOval', window, wRGB, centeredRect, maxDiameter); % Draw the rect to the screen +Screen('Flip', window); +WaitSecs(duration) +% +% end + +% KbStrokeWait; +Screen('CloseAll') + +end \ No newline at end of file diff --git a/002 After Image GUI Project/Exp_Conditions.txt b/002 After Image GUI Project/Exp_Conditions.txt new file mode 100644 index 0000000..44b011d --- /dev/null +++ b/002 After Image GUI Project/Exp_Conditions.txt @@ -0,0 +1,8 @@ +Variable,Values +Lum,20 littleL,0.665 littleS,1 l_axis,true s_axis,true l_s_45,true l_s_135,true +lum_axis,true +lum_l_45,true +lum_l_135,true +lum_s_45,true +lum_s_135,true +N_repet,3 \ No newline at end of file diff --git a/002 After Image GUI Project/HFP_session.m b/002 After Image GUI Project/HFP_session.m new file mode 100644 index 0000000..eb060ac --- /dev/null +++ b/002 After Image GUI Project/HFP_session.m @@ -0,0 +1,303 @@ + +function HFP_session(subName,curr_cond) + +% HFP Code for Elliott Lab +% Written by SLE 3/24/17 +% Modified by CPF + +a = cd; % folder where the program is. + + +hfpDate = date; +saveFile = sprintf('%sHFP',subName); +numRep = 3; %number of repetitions + +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); +%load in monitor calibration information & color set parameters +load colorCalFile1.mat +fprintf('\nLast calibration was %s\n', describe.date); +pixDec = pix/length(pix); %converts 1001 numbers to decimals +lum = 5; %in cd/m^2 + +rgbMat(:,4) = pix; +rgbMat(:,1) = redProp(:)*maxPhosXYZ(1,2); +rgbMat(:,2) = grnProp(:)*maxPhosXYZ(2,2); +rgbMat(:,3) = blueProp(:)*maxPhosXYZ(3,2); + +for i=1:3 + settings(i) = pix(dsearchn(rgbMat(:,i), lum)); +end +%gives an index into the phosphor table to find a value btw 0-1 +%correponding to that luminance +initial_RED = settings(1) +initial_GREEN = settings(2) +initial_BLUE = settings(3) +%stepSize is based on the total number of unique luminance values in the rgbMat so we don't get stuck pushing the button to move the luminance of 1 phosphor +stepSize = 4; + +%% Load previous HFP values +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +name = sprintf('%sHFP.mat', subName); +if exist(name, 'file') == 2 + +load(name) + +% bg = []; +% rg = []; +% br = []; +% br_check = []; + +else + +Prev_bg = []; bg = []; +Prev_rg = []; rg = []; +Prev_br = []; br = []; +Prev_brcheck = []; br_check = []; + +end + +%% Set up toolbox variables +% switch color range to normalized 0 - 1 range: +% PsychDefaultSetup(2); +expScreen = 1; +[window, windowRect] = PsychImaging('OpenWindow', expScreen, [0 0 0], [], [], []); +% Screen('OpenWindow',0, [0 0 0]); %makes main screen dark +%PsychImaging('OpenWindow', expScreen, wRGB); +[xcent,ycent] = RectCenter(windowRect); +center = [xcent ycent]; + +%% TIMING +%find frames per second +ifi = Screen('GetFlipInterval', window);% Measure the vertical refresh rate of the monitor +topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +framesPerSec = round(1/ifi); +hfpFreq = 15; +waitframes = floor(framesPerSec/hfpFreq); %number of frames to wait between refresh +%freqRefresh = ifi*framesPerSec/hfpFreq; + +%% Stimulus Size Parameters +circleDeg = 3.6; %was 1.5 in Sarah Program +pixPerDeg =35;% was 60 in Sarah Program +circlePix = circleDeg*pixPerDeg; +tstcircle = [xcent - circlePix/2 ycent - circlePix/2 xcent + circlePix/2 ycent + circlePix/2]; + +cd(a); % return to folder where the program is +%run experiment +Priority(topPriorityLevel); +% for iRepeat = 1:numRep + stim_order = [1 1 1 2 2 2 3 3 3];%randperm(3); + keypress = 0; + %Speak('Setting %i', iRepeat) + commandwindow; + for j = 1:9 + vbl = Screen('Flip', window); + + switch stim_order(j) + case 1 %RG + current_RED = initial_RED; + colClut_one = [pixDec(current_RED) 0 0]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 2 %BG + current_BLUE = initial_BLUE; + colClut_one = [0 0 pixDec(current_BLUE)]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 3 %RB + current_RED = initial_RED; + colClut_one = [0 0 pixDec(initial_BLUE)]; + colClut_two = [pixDec(current_RED) 0 0]; + end + + %ListenChar(2); +% % % % BeginMatch = 0; +% Speak('press start to begin') +% % % % while ~BeginMatch %wait for initial key press +% % % % if(CharAvail) % check for keypress, record if key=4 +% % % % [char] = GetChar; +% % % % if char =='8' +% % % % BeginMatch = 1; +% % % % end +% % % % FlushEvents('keyDown'); +% % % % end +% % % % end + + FlushEvents('keyDown'); + %Speak('Next Session') + DoneMatch = 0; + count = 0; %count the number of frames + while ~DoneMatch %look for key presses and put up stimulus + [ keyIsDown, timeSecs, keyCode ] = KbCheck; + if(CharAvail) % check for keypress, record if key=1 or 2 or 3 + [char] = GetChar; + switch char + case '8' + DoneMatch = 1; + switch stim_order(j) + case 1 %RG + rg(j) = rgbMat(current_RED,1)/rgbMat(initial_GREEN,2) + case 2 %BG + bg(j-3) = rgbMat(current_BLUE,3)/rgbMat(initial_GREEN,2) + case 3 %BR + br(j-6) = rgbMat(initial_BLUE,3)/rgbMat(current_RED,1) + end + case '6' + switch stim_order(j) + case 1 %RG + current_RED = current_RED + stepSize + if current_RED > 1001 + beep%Speak('setting limit'); + current_RED = 1001; + end + colClut_one = [pixDec(current_RED) 0 0]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 2 %BG + current_BLUE = current_BLUE + stepSize + if current_BLUE > 1001 + beep%Speak('setting limit'); + current_BLUE = 1001; + end + colClut_one = [0 0 pixDec(current_BLUE)]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 3 %BR + current_RED = current_RED + stepSize + if current_RED > 1001 + beep%Speak('setting limit'); + current_RED = 1001; + end + colClut_one = [0 0 pixDec(initial_BLUE)]; + colClut_two = [pixDec(current_RED) 0 0]; + end + + case '9' + switch stim_order(j) + case 1 %RG + current_RED = current_RED + stepSize/4 + if current_RED > 1001 + beep%Speak('setting limit'); + current_RED = 1001; + end + colClut_one = [pixDec(current_RED) 0 0]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 2 %BG + current_BLUE = current_BLUE + stepSize/4 + if current_BLUE > 1001 + beep%Speak('setting limit'); + current_BLUE = 1001; + end + colClut_one = [0 0 pixDec(current_BLUE)]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 3 %BR + current_RED = current_RED + stepSize/4 + if current_RED > 1001 + beep%Speak('setting limit'); + current_RED = 1001; + end + colClut_one = [0 0 pixDec(initial_BLUE)]; + colClut_two = [pixDec(current_RED) 0 0]; + end + case '4' + switch stim_order(j) + case 1 %RG + current_RED = current_RED - stepSize + if current_RED <= 1 + beep%speak('setting limit'); + current_RED = 1; +% else + end + colClut_one = [pixDec(current_RED) 0 0]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 2 %BG + current_BLUE = current_BLUE - stepSize + if current_BLUE <= 1 + beep%speak('setting limit') + current_BLUE = 1; +% else + end + colClut_one = [0 0 pixDec(current_BLUE)]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 3 %BR + current_RED = current_RED - stepSize + if current_RED <= 1 + beep%speak('setting limit') + current_RED = 1; +% else + end + colClut_one = [0 0 pixDec(initial_BLUE)]; + colClut_two = [pixDec(current_RED) 0 0]; + end + case '7' + switch stim_order(j) + case 1 %RG + current_RED = current_RED - stepSize/4 + if current_RED <= 1 + beep%speak('setting limit'); + current_RED = 1; +% else + end + colClut_one = [pixDec(current_RED) 0 0]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 2 %BG + current_BLUE = current_BLUE - stepSize/4 + if current_BLUE <= 1 + beep%speak('setting limit') + current_BLUE = 1; +% else + end + colClut_one = [0 0 pixDec(current_BLUE)]; + colClut_two = [0 pixDec(initial_GREEN) 0]; + case 3 %BR + current_RED = current_RED - stepSize/4 + if current_RED <= 1 + beep%speak('setting limit') + current_RED = 1; +% else + end + colClut_one = [0 0 pixDec(initial_BLUE)]; + colClut_two = [pixDec(current_RED) 0 0]; + end + end + FlushEvents('keyDown'); + end + Screen('FillOval', window, colClut_one, tstcircle); + vbl = Screen('Flip', window, vbl + (waitframes - 0.5) * ifi); + Screen('FillOval', window, colClut_two, tstcircle); + vbl = Screen('Flip', window, vbl + (waitframes - 0.5) * ifi); + end %while done + Screen('FillOval', window, [0 0 0], windowRect); + Screen('Flip', window); + pause(1); + end %for j + + for irep = 1:3 + br_check(irep) = bg(irep)/rg(irep); + end +% end %i +Priority(0) +%ListenChar(0); +sca +fprintf('\n\n') + +% rg_avg = median(rg(1,2:3)); +% bg_avg = median(bg(1,2:3)); +% rb_avg = median(br(1,2:3)); + +Prev_bg = [Prev_bg ; bg]; +Prev_rg = [Prev_rg ; rg]; +Prev_br = [Prev_br ; br]; +Prev_brcheck = [Prev_brcheck ; br_check]; + +if ge(size(Prev_bg,1),3); +rg_avg = median(reshape(Prev_rg(end-2:end,2:3),6,1)); +bg_avg = median(reshape(Prev_bg(end-2:end,2:3),6,1)); +rb_avg = median(reshape(Prev_br(end-2:end,2:3),6,1)); +else +rg_avg = []; +bg_avg = []; +rb_avg = []; +end + +% Save to mat file +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +saveCmd = ['save ' saveFile ' hfpDate rg_avg bg_avg rb_avg Prev_rg Prev_bg Prev_br Prev_brcheck']; +eval(saveCmd) + +end \ No newline at end of file diff --git a/002 After Image GUI Project/LMS_to_XYZ.m b/002 After Image GUI Project/LMS_to_XYZ.m new file mode 100755 index 0000000..5235e7e --- /dev/null +++ b/002 After Image GUI Project/LMS_to_XYZ.m @@ -0,0 +1,39 @@ +function XYZ = LMS_to_XYZ(LMS) +% function XYZ = Color_Convert_LMS_to_XYZ(LMS) +% +% Converts fron Cone Activation (LMS) to CIE 1931 Tristimulus Value (XYZ) +% +% Takes: LMS (N, 3) - LMS coordinates +% Returns: XYZ (N, 3) - XYZ coordinates +% Dependencies: Variable_Report.m +% +% Created 2015-07-09 by KCM +% +% Updated 2015-07-09 by KCM +% +%Updated 2015-08-18 by SLE to be consistent with UC with s scaled to 1 + +%% Arguments +if ~exist('LMS', 'var') || isempty(LMS) + fprintf(char(strcat({'\nColor_Convert_LMS_to_XYZ: '}, {'''LMS'' must be provided!\n\n'}))) + XYZ = []; return +end +if ~ismatrix(LMS) || size(LMS, 2) ~= 3 + fprintf(char(strcat({'\nColor_Convert_LMS_to_XYZ: '}, {'''LMS'' must have size (N, 3)!\n\n'}))) + XYZ = []; return +end +if sum(sum(~isfinite(LMS))) || sum(sum(~isreal(LMS))) + fprintf(char(strcat({'\nColor_Convert_LMS_to_XYZ: '}, ... + {'''LMS'' must be finite and real!\n\n'}))) + XYZ = []; return +end + +%% Convert +XYZ = [2.9448 .* LMS(:, 1) - 3.5010 .* LMS(:, 2) + 0.2068 .* LMS(:, 3), ... % X + 1 .* LMS(:, 1) + 1 .* LMS(:, 2) + 0 .* LMS(:, 3), ... % Y + 0 .* LMS(:, 1) + 0 .* LMS(:, 2) + 0.9765 .* LMS(:, 3)]; clear LMS % Z +% +% %% Variable Report (Housecleaning: for spotting uncleared variables. Omit if desired) +% Variable_Report(whos, 'XYZ') + +end diff --git a/002 After Image GUI Project/Program Compiled/.DS_Store b/002 After Image GUI Project/Program Compiled/.DS_Store new file mode 100644 index 0000000..27d6176 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/.DS_Store differ diff --git a/002 After Image GUI Project/Program Compiled/PackagingLog.html b/002 After Image GUI Project/Program Compiled/PackagingLog.html new file mode 100644 index 0000000..5d278b4 --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/PackagingLog.html @@ -0,0 +1,39 @@ +
+mcc -o tvp_GENERATOR -W main:tvp_GENERATOR -T link:exe -d '/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_testing' -v '/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/AppTEST.mlapp' 
+Compiler version: 6.2 (R2016a)
+
+Dependency analysis by REQUIREMENTS.
+
+Name is nonexistent or not a directory: /Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/002 After Image GUI Project
+[Warning: Directory permission denied: /Users/inaki/Documents/Color Afterimages] 
+[Warning: Adding path
+"/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background
+Afterimage/1 Programs/002 After Image GUI Project" to Compiler path instance.] 
+Parsing file "/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/AppTEST.mlapp"
+	(Referenced from: "Compiler Command Line").
+Deleting 11 temporary MEX authorization files.
+Removing: '/tmp/020341yliQ7_8244.auth'.
+Removing: '/tmp/02034TqWg50_8244.auth'.
+Removing: '/tmp/02034ZEw9Wc_8244.auth'.
+Removing: '/tmp/02034lnprP3_8244.auth'.
+Removing: '/tmp/02034Lw9dR6_8244.auth'.
+Removing: '/tmp/02034rmBu8Q_8244.auth'.
+Removing: '/tmp/020344qOOri_8244.auth'.
+Removing: '/tmp/02034aVx57k_8244.auth'.
+Removing: '/tmp/02034hgoEMd_8244.auth'.
+Removing: '/tmp/020340Cm2kq_8244.auth'.
+Removing: '/tmp/02034Nyhm5R_8244.auth'.
+Generating file "/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_testing/readme.txt".
+Generating file "/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_testing/run_tvp_GENERATOR.sh".
+Packaging...
+Adding custom icon /Applications/MATLAB_R2016a.app/toolbox/compiler/Resources/default_icon.icns to /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app.
+Creating the bundle...
+Copying /Applications/MATLAB_R2016a.app/toolbox/compiler/maci64/setup.app to /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app.
+Copying /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_redistribution/bundle.zip to /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/bundle.zip.
+Copying /Applications/MATLAB_R2016a.app/toolbox/compiler/Resources/default_splash.png to /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/splash.png.
+Copying /Applications/MATLAB_R2016a.app/toolbox/compiler/Resources/default_icon.icns to /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/installer.icns.
+Copying /Users/clemente/.installAgent9.0.1/maci64/InstallAgent_35000_35010.zip to /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/InstallAgent_35000_35010.zip.
+Self contained installer created at /Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app.
+Packaging complete.
+Elapsed packaging time was: 3 minutes and 29 seconds.
+
diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Info.plist b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Info.plist new file mode 100644 index 0000000..9f548b6 --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + setup + CFBundleIconFile + installer.icns + CFBundleIdentifier + com.mathworks.toolbox.compiler.setup + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + 10.4 + NSHumanReadableCopyright + Copyright © 2013 __MyCompanyName__. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup new file mode 100755 index 0000000..ed65350 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup.dSYM/Contents/Info.plist b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup.dSYM/Contents/Info.plist new file mode 100644 index 0000000..29859ca --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.com.mathworks.toolbox.compiler.setup + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup.dSYM/Contents/Resources/DWARF/setup b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup.dSYM/Contents/Resources/DWARF/setup new file mode 100644 index 0000000..33a6987 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/MacOS/setup.dSYM/Contents/Resources/DWARF/setup differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/InstallAgent_35000_35010.zip b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/InstallAgent_35000_35010.zip new file mode 100644 index 0000000..28b9e3e Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/InstallAgent_35000_35010.zip differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/bundle.zip b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/bundle.zip new file mode 100644 index 0000000..69f4ffe Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/bundle.zip differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/en.lproj/MainMenu.nib b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/en.lproj/MainMenu.nib new file mode 100644 index 0000000..dc842dd Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/en.lproj/MainMenu.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/installer.icns b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/installer.icns new file mode 100755 index 0000000..8f10702 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/installer.icns differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/splash.png b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/splash.png new file mode 100644 index 0000000..d60c6fa Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution/MyAppInstaller_mcr.app/Contents/Resources/splash.png differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/default_icon.icns b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/default_icon.icns new file mode 100755 index 0000000..8f10702 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/default_icon.icns differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/readme.txt b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/readme.txt new file mode 100644 index 0000000..182559f --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/readme.txt @@ -0,0 +1,120 @@ +MATLAB Compiler + +1. Prerequisites for Deployment + +. Verify the MATLAB Runtime is installed and ensure you + have installed version 9.0.1 (R2016a). + +. If the MATLAB Runtime is not installed, do the following: + (1) enter + + >>mcrinstaller + + at MATLAB prompt. The MCRINSTALLER command displays the + location of the MATLAB Runtime installer. + + (2) run the MATLAB Runtime installer. + +Or download the Macintosh version of the MATLAB Runtime for R2016a +from the MathWorks Web site by navigating to + + http://www.mathworks.com/products/compiler/mcr/index.html + + +For more information about the MATLAB Runtime and the MATLAB Runtime installer, see +Package and Distribute in the MATLAB Compiler documentation +in the MathWorks Documentation Center. + + +NOTE: You will need administrator rights to run MCRInstaller. + + +2. Files to Deploy and Package + +Files to package for Standalone +================================ +-run_tvp_GENERATOR.sh (shell script for temporarily setting environment variables and + executing the application) + -to run the shell script, type + + ./run_tvp_GENERATOR.sh + + at Linux or Mac command prompt. is the directory + where version 9.0.1 of the MATLAB Runtime is installed or the directory where + MATLAB is installed on the machine. is all the + arguments you want to pass to your application. For example, + + If you have version 9.0.1 of the MATLAB Runtime installed in + /mathworks/home/application/v901, run the shell script as: + + ./run_tvp_GENERATOR.sh /mathworks/home/application/v901 + + If you have MATLAB installed in /mathworks/devel/application/matlab, + run the shell script as: + + ./run_tvp_GENERATOR.sh /mathworks/devel/application/matlab +-MCRInstaller.zip + -if end users are unable to download the MATLAB Runtime using the above + link, include it when building your component by clicking + the "Runtime downloaded from web" link in the Deployment Tool +-The Macintosh bundle directory structure tvp_GENERATOR.app + -this can be gathered up using the zip command + zip -r tvp_GENERATOR.zip tvp_GENERATOR.app + or the tar command + tar -cvf tvp_GENERATOR.tar tvp_GENERATOR.app +-This readme file + +3. Definitions + +For information on deployment terminology, go to +http://www.mathworks.com/help. Select MATLAB Compiler > +Getting Started > About Application Deployment > +Deployment Product Terms in the MathWorks Documentation +Center. + + +4. Appendix + +A. Mac systems: +In the following directions, replace MCR_ROOT by the directory where the MATLAB Runtime + is installed on the target machine. + +If the environment variable DYLD_LIBRARY_PATH is undefined, set it to the concatenation + of the following strings: + + MCR_ROOT/v901/runtime/maci64: + MCR_ROOT/v901/sys/os/maci64: + MCR_ROOT/v901/bin/maci64 + +If it is defined, set it to the concatenation of these strings: + + ${LD_LIBRARY_PATH}: + MCR_ROOT/v901/runtime/maci64: + MCR_ROOT/v901/sys/os/maci64: + MCR_ROOT/v901/bin/maci64 + + For more detail information about setting the MATLAB Runtime paths, see Package and + Distribute in the MATLAB Compiler documentation in the MathWorks Documentation Center. + + + + NOTE: To make these changes persistent after logout on Linux + or Mac machines, modify the .cshrc file to include this + setenv command. + NOTE: The environment variable syntax utilizes forward + slashes (/), delimited by colons (:). + NOTE: When deploying standalone applications, it is possible + to run the shell script file run_tvp_GENERATOR.sh + instead of setting environment variables. See + section 2 "Files to Deploy and Package". + + + +5. Launching of application using Macintosh finder. + +If the application is purely graphical, that is, it doesn't read from standard in or +write to standard out or standard error, it may be launched in the finder just like any +other Macintosh application. + + + diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/run_tvp_GENERATOR.sh b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/run_tvp_GENERATOR.sh new file mode 100755 index 0000000..8f2b8e8 --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/run_tvp_GENERATOR.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# script for execution of deployed applications +# +# Sets up the MATLAB Runtime environment for the current $ARCH and executes +# the specified command. +# +exe_name=$0 +exe_dir=`dirname "$0"` +echo "------------------------------------------" +if [ "x$1" = "x" ]; then + echo Usage: + echo $0 \ args +else + echo Setting up environment variables + MCRROOT="$1" + echo --- + DYLD_LIBRARY_PATH=.:${MCRROOT}/runtime/maci64 ; + DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${MCRROOT}/bin/maci64 ; + DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${MCRROOT}/sys/os/maci64; + export DYLD_LIBRARY_PATH; + echo DYLD_LIBRARY_PATH is ${DYLD_LIBRARY_PATH}; + shift 1 + args= + while [ $# -gt 0 ]; do + token=$1 + args="${args} \"${token}\"" + shift + done + eval "\"${exe_dir}/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR\"" $args +fi +exit + diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/splash.png b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/splash.png new file mode 100644 index 0000000..d60c6fa Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/splash.png differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Info.plist b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Info.plist new file mode 100644 index 0000000..e7d5da7 --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + prelaunch + CFBundleIconFile + membrane.icns + CFBundleIdentifier + tvp_GENERATOR + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + tvp_GENERATOR + CFBundlePackageType + APPL + CFBundleSignature + tvp_GENERATOR + CFBundleVersion + 1 + CFBundleVersionString + 1.0 + CFResourcesFileMapped + + LSMinimumSystemVersion + 10.9.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/applauncher b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/applauncher new file mode 100755 index 0000000..9be1e80 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/applauncher differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/prelaunch b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/prelaunch new file mode 100755 index 0000000..820c27a Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/prelaunch differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR new file mode 100755 index 0000000..df01a61 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/About.nib b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/About.nib new file mode 100644 index 0000000..6903da1 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/About.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWOpenAccessoryView.nib b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWOpenAccessoryView.nib new file mode 100644 index 0000000..4dd35d3 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWOpenAccessoryView.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWSaveAccessoryView.nib b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWSaveAccessoryView.nib new file mode 100644 index 0000000..305519f Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWSaveAccessoryView.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MainMenu.nib b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MainMenu.nib new file mode 100644 index 0000000..e67f49b Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MainMenu.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/membrane.icns b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/membrane.icns new file mode 100755 index 0000000..8f10702 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_redistribution_files_only/tvp_GENERATOR.app/Contents/Resources/membrane.icns differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/.DS_Store b/002 After Image GUI Project/Program Compiled/for_testing/.DS_Store new file mode 100644 index 0000000..84f8365 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/.DS_Store differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/mccExcludedFiles.log b/002 After Image GUI Project/Program Compiled/for_testing/mccExcludedFiles.log new file mode 100644 index 0000000..50ed07c --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_testing/mccExcludedFiles.log @@ -0,0 +1,7 @@ +The List of Excluded Files +Excluded files Exclusion Message ID Reason For Exclusion Exclusion Rule +/Applications/MATLAB_R2016a.app/toolbox/local/+matlab/+internal/+toolboxes/addInstalledToolboxesToPath.m MATLAB:Completion:ExcludedBy Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler. /Applications/MATLAB_R2016a\.app/toolbox/local/[+]matlab/[+]internal/[+]toolboxes/addInstalledToolboxesToPath[.]m +/Applications/MATLAB_R2016a.app/toolbox/local/+matlab/+internal/+zipAddOns/addInstalledZipAddOnsToPath.m MATLAB:Completion:ExcludedBy Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler. /Applications/MATLAB_R2016a\.app/toolbox/local/[+]matlab/[+]internal/[+]zipAddOns/addInstalledZipAddOnsToPath[.]m +/Applications/MATLAB_R2016a.app/toolbox/local/pathdef.m MATLAB:Completion:ExcludedBy Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler. /Applications/MATLAB_R2016a\.app/toolbox/local/pathdef[.]m +/Applications/MATLAB_R2016a.app/toolbox/matlab/codetools/commandwindow.m MATLAB:Completion:ExcludedBy Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler. /Applications/MATLAB_R2016a\.app/toolbox/matlab/codetools +/Applications/MATLAB_R2016a.app/toolbox/matlab/codetools/initdesktoputils.m MATLAB:Completion:ExcludedBy Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler. /Applications/MATLAB_R2016a\.app/toolbox/matlab/codetools diff --git a/002 After Image GUI Project/Program Compiled/for_testing/readme.txt b/002 After Image GUI Project/Program Compiled/for_testing/readme.txt new file mode 100644 index 0000000..182559f --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_testing/readme.txt @@ -0,0 +1,120 @@ +MATLAB Compiler + +1. Prerequisites for Deployment + +. Verify the MATLAB Runtime is installed and ensure you + have installed version 9.0.1 (R2016a). + +. If the MATLAB Runtime is not installed, do the following: + (1) enter + + >>mcrinstaller + + at MATLAB prompt. The MCRINSTALLER command displays the + location of the MATLAB Runtime installer. + + (2) run the MATLAB Runtime installer. + +Or download the Macintosh version of the MATLAB Runtime for R2016a +from the MathWorks Web site by navigating to + + http://www.mathworks.com/products/compiler/mcr/index.html + + +For more information about the MATLAB Runtime and the MATLAB Runtime installer, see +Package and Distribute in the MATLAB Compiler documentation +in the MathWorks Documentation Center. + + +NOTE: You will need administrator rights to run MCRInstaller. + + +2. Files to Deploy and Package + +Files to package for Standalone +================================ +-run_tvp_GENERATOR.sh (shell script for temporarily setting environment variables and + executing the application) + -to run the shell script, type + + ./run_tvp_GENERATOR.sh + + at Linux or Mac command prompt. is the directory + where version 9.0.1 of the MATLAB Runtime is installed or the directory where + MATLAB is installed on the machine. is all the + arguments you want to pass to your application. For example, + + If you have version 9.0.1 of the MATLAB Runtime installed in + /mathworks/home/application/v901, run the shell script as: + + ./run_tvp_GENERATOR.sh /mathworks/home/application/v901 + + If you have MATLAB installed in /mathworks/devel/application/matlab, + run the shell script as: + + ./run_tvp_GENERATOR.sh /mathworks/devel/application/matlab +-MCRInstaller.zip + -if end users are unable to download the MATLAB Runtime using the above + link, include it when building your component by clicking + the "Runtime downloaded from web" link in the Deployment Tool +-The Macintosh bundle directory structure tvp_GENERATOR.app + -this can be gathered up using the zip command + zip -r tvp_GENERATOR.zip tvp_GENERATOR.app + or the tar command + tar -cvf tvp_GENERATOR.tar tvp_GENERATOR.app +-This readme file + +3. Definitions + +For information on deployment terminology, go to +http://www.mathworks.com/help. Select MATLAB Compiler > +Getting Started > About Application Deployment > +Deployment Product Terms in the MathWorks Documentation +Center. + + +4. Appendix + +A. Mac systems: +In the following directions, replace MCR_ROOT by the directory where the MATLAB Runtime + is installed on the target machine. + +If the environment variable DYLD_LIBRARY_PATH is undefined, set it to the concatenation + of the following strings: + + MCR_ROOT/v901/runtime/maci64: + MCR_ROOT/v901/sys/os/maci64: + MCR_ROOT/v901/bin/maci64 + +If it is defined, set it to the concatenation of these strings: + + ${LD_LIBRARY_PATH}: + MCR_ROOT/v901/runtime/maci64: + MCR_ROOT/v901/sys/os/maci64: + MCR_ROOT/v901/bin/maci64 + + For more detail information about setting the MATLAB Runtime paths, see Package and + Distribute in the MATLAB Compiler documentation in the MathWorks Documentation Center. + + + + NOTE: To make these changes persistent after logout on Linux + or Mac machines, modify the .cshrc file to include this + setenv command. + NOTE: The environment variable syntax utilizes forward + slashes (/), delimited by colons (:). + NOTE: When deploying standalone applications, it is possible + to run the shell script file run_tvp_GENERATOR.sh + instead of setting environment variables. See + section 2 "Files to Deploy and Package". + + + +5. Launching of application using Macintosh finder. + +If the application is purely graphical, that is, it doesn't read from standard in or +write to standard out or standard error, it may be launched in the finder just like any +other Macintosh application. + + + diff --git a/002 After Image GUI Project/Program Compiled/for_testing/requiredMCRProducts.txt b/002 After Image GUI Project/Program Compiled/for_testing/requiredMCRProducts.txt new file mode 100644 index 0000000..3ed6af0 --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_testing/requiredMCRProducts.txt @@ -0,0 +1 @@ +35000 35010 \ No newline at end of file diff --git a/002 After Image GUI Project/Program Compiled/for_testing/run_tvp_GENERATOR.sh b/002 After Image GUI Project/Program Compiled/for_testing/run_tvp_GENERATOR.sh new file mode 100755 index 0000000..8f2b8e8 --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_testing/run_tvp_GENERATOR.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# script for execution of deployed applications +# +# Sets up the MATLAB Runtime environment for the current $ARCH and executes +# the specified command. +# +exe_name=$0 +exe_dir=`dirname "$0"` +echo "------------------------------------------" +if [ "x$1" = "x" ]; then + echo Usage: + echo $0 \ args +else + echo Setting up environment variables + MCRROOT="$1" + echo --- + DYLD_LIBRARY_PATH=.:${MCRROOT}/runtime/maci64 ; + DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${MCRROOT}/bin/maci64 ; + DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${MCRROOT}/sys/os/maci64; + export DYLD_LIBRARY_PATH; + echo DYLD_LIBRARY_PATH is ${DYLD_LIBRARY_PATH}; + shift 1 + args= + while [ $# -gt 0 ]; do + token=$1 + args="${args} \"${token}\"" + shift + done + eval "\"${exe_dir}/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR\"" $args +fi +exit + diff --git a/002 After Image GUI Project/Program Compiled/for_testing/splash.png b/002 After Image GUI Project/Program Compiled/for_testing/splash.png new file mode 100644 index 0000000..d60c6fa Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/splash.png differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Info.plist b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Info.plist new file mode 100644 index 0000000..e7d5da7 --- /dev/null +++ b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + prelaunch + CFBundleIconFile + membrane.icns + CFBundleIdentifier + tvp_GENERATOR + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + tvp_GENERATOR + CFBundlePackageType + APPL + CFBundleSignature + tvp_GENERATOR + CFBundleVersion + 1 + CFBundleVersionString + 1.0 + CFResourcesFileMapped + + LSMinimumSystemVersion + 10.9.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/applauncher b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/applauncher new file mode 100755 index 0000000..9be1e80 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/applauncher differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/prelaunch b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/prelaunch new file mode 100755 index 0000000..820c27a Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/prelaunch differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR new file mode 100755 index 0000000..df01a61 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/MacOS/tvp_GENERATOR differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/About.nib b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/About.nib new file mode 100644 index 0000000..6903da1 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/About.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWOpenAccessoryView.nib b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWOpenAccessoryView.nib new file mode 100644 index 0000000..4dd35d3 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWOpenAccessoryView.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWSaveAccessoryView.nib b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWSaveAccessoryView.nib new file mode 100644 index 0000000..305519f Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MWSaveAccessoryView.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MainMenu.nib b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MainMenu.nib new file mode 100644 index 0000000..e67f49b Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/Base.lproj/MainMenu.nib differ diff --git a/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/membrane.icns b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/membrane.icns new file mode 100755 index 0000000..8f10702 Binary files /dev/null and b/002 After Image GUI Project/Program Compiled/for_testing/tvp_GENERATOR.app/Contents/Resources/membrane.icns differ diff --git a/002 After Image GUI Project/Prueba_ReadTable.txt b/002 After Image GUI Project/Prueba_ReadTable.txt new file mode 100644 index 0000000..23d4157 --- /dev/null +++ b/002 After Image GUI Project/Prueba_ReadTable.txt @@ -0,0 +1,5 @@ +Luminance , Chro_littL , Chro_littS , l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.4 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.00 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.4 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 \ No newline at end of file diff --git a/002 After Image GUI Project/TRY_NonCardPULSE.m b/002 After Image GUI Project/TRY_NonCardPULSE.m new file mode 100644 index 0000000..2e25578 --- /dev/null +++ b/002 After Image GUI Project/TRY_NonCardPULSE.m @@ -0,0 +1,120 @@ +%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%% +% I use this program to create a modified Zaidi paradigm in which there is +% one a NonCardinal pulse is added to a Cardinal zaidi stimulus at a given +% point and for a certain time. + +clear all; %close all; +%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%% +Calib_Dire = cd('/Users/clemente/Desktop/AfterImage Programs/002 After Image GUI Project'); +load colorCalFile1.mat +pix = pix/1001; +%%%%%%%%%%%%%%%%%% +aa = cd('/Users/clemente/Desktop/AfterImage Programs/A Outputs'); +commandwindow; +subName = upper(input('Subject Initials: ','s')); +hfpFile = sprintf('%sHFP', subName); +load(hfpFile, '-mat') +hfpRG = rg_avg; +hfpBG = bg_avg; + +% a = '/Users/clemente/Dropbox/Luminotecnia/2018/Experiments/Color Background Afterimage/1 Programs/4 ColBackg AI' ;% folder where the program is. +cd(a); + +%%%%%%%%%%%%%%%%%% +% TIMING +%find frames per second +ifi = 0.0118;% Measure the vertical refresh rate of the monitor +% topPriorityLevel = MaxPriority(window);% Retreive the maximum priority number +numSecs = 16; %in seconds, total presentation time +framesPerSec = round(1/ifi); +nFrames = numSecs * framesPerSec; +waitframes = 1; %number of frames to wait between refresh + + + +%%%%%%%%%%%%%%%%%% +Chro = [.665 1]; iChro =1; +maxLum = 20; +cont = 1; iCont = 1; +lCont = .02; +sCont = .8; + +%%%%%%%%%%%%%%%%%% + +wLMS(1,1) = Chro(iChro,1)*maxLum; +wLMS(1,2) = (1-Chro(iChro,1))*maxLum; +wLMS(1,3) = Chro(iChro,2)*maxLum; +wXYZ(1,:) = LMS_to_XYZ(wLMS(1,:)); +wRGB(1,:) = XYZ_to_RGB(wXYZ(1,:), maxPhosXYZ); +wRGB(1,1) = pix(dsearchn(redProp(:), wRGB(1,1)))*hfpRG; +wRGB(1,2) = pix(dsearchn(grnProp(:), wRGB(1,2))); +wRGB(1,3) = pix(dsearchn(blueProp(:), wRGB(1,3)))*hfpBG; + +for i = 1:2 + + switch i + case 1 + l = [Chro(iChro,1)+(Chro(iChro,1)*lCont(iChro,cont(iCont))) Chro(iChro,2) maxLum + Chro(iChro,1)-(Chro(iChro,1)*lCont(iChro,cont(iCont))) Chro(iChro,2) maxLum]; %+l, -l + colLut = l; + case 2 + l_s_45 = [Chro(iChro,1)+(Chro(iChro,1)*lCont(iChro,cont(iCont))) Chro(iChro,2)+(Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum + Chro(iChro,1)-(Chro(iChro,1)*lCont(iChro,cont(iCont))) Chro(iChro,2)-(Chro(iChro,2)*sCont(iChro,cont(iCont))) maxLum]; + + colLut = l_s_45; + end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + for iLMS = 1:2 + cLMS(iLMS,1) = colLut(iLMS,1)*colLut(iLMS, 3); + cLMS(iLMS,2) = (1-colLut(iLMS,1))*colLut(iLMS, 3); + cLMS(iLMS,3) = colLut(iLMS,2)*colLut(iLMS, 3); + end + + %XYZ values for each + for iXYZ = 1:length(cLMS(:,1)) + cXYZ(iXYZ,:) = LMS_to_XYZ(cLMS(iXYZ,:)); + end + + %use lut to find corrected monitor RGB values for each rgb color + for iRGB = 1:length(cXYZ(:,1)) + cRGB(iRGB,:) = XYZ_to_RGB(cXYZ(iRGB,:), maxPhosXYZ); + cRGB(iRGB,1) = pix(dsearchn(redProp(:), cRGB(iRGB,1)))*hfpRG; + cRGB(iRGB,2) = pix(dsearchn(grnProp(:), cRGB(iRGB,2))); + cRGB(iRGB,3) = pix(dsearchn(blueProp(:), cRGB(iRGB,3)))*hfpBG; + end + + rampLeft = zeros(nFrames,3); + rampRight = zeros(nFrames,3); + for iRamp = 1:3 %for 3 phosophors + rampLeft(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(1,iRamp), nFrames); + rampRight(:,iRamp) = sinspace(wRGB(1,iRamp), cRGB(2,iRamp), nFrames); + end + +switch i + case 1 + left1 = rampLeft; + right1 = rampRight; + case 2 + left2 = rampLeft; + right2 = rampRight; +end +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% COMBINE SIGNALS +%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +left1(637:722,1:3) = left2(637:722,1:3); +right1(637:722,1:3) = right2(637:722,1:3); +rampLeft = left1; +rampRight = right1; +save('rampLeft_Combined.mat','left1') +save('rampRight_Combined.mat','right1') + + diff --git a/002 After Image GUI Project/TVP_GENERATOR.mlapp b/002 After Image GUI Project/TVP_GENERATOR.mlapp new file mode 100644 index 0000000..7a2d1ac Binary files /dev/null and b/002 After Image GUI Project/TVP_GENERATOR.mlapp differ diff --git a/002 After Image GUI Project/TVP_GENERATOR.mlappinstall b/002 After Image GUI Project/TVP_GENERATOR.mlappinstall new file mode 100644 index 0000000..9f8e641 Binary files /dev/null and b/002 After Image GUI Project/TVP_GENERATOR.mlappinstall differ diff --git a/002 After Image GUI Project/TVP_GENERATOR_resources/.DS_Store b/002 After Image GUI Project/TVP_GENERATOR_resources/.DS_Store new file mode 100644 index 0000000..5d7efa4 Binary files /dev/null and b/002 After Image GUI Project/TVP_GENERATOR_resources/.DS_Store differ diff --git a/002 After Image GUI Project/TVP_GENERATOR_resources/icon_16.png b/002 After Image GUI Project/TVP_GENERATOR_resources/icon_16.png new file mode 100644 index 0000000..342a507 Binary files /dev/null and b/002 After Image GUI Project/TVP_GENERATOR_resources/icon_16.png differ diff --git a/002 After Image GUI Project/TVP_GENERATOR_resources/icon_24.png b/002 After Image GUI Project/TVP_GENERATOR_resources/icon_24.png new file mode 100644 index 0000000..8c1cb02 Binary files /dev/null and b/002 After Image GUI Project/TVP_GENERATOR_resources/icon_24.png differ diff --git a/002 After Image GUI Project/TVP_GENERATOR_resources/icon_48.png b/002 After Image GUI Project/TVP_GENERATOR_resources/icon_48.png new file mode 100644 index 0000000..7d2d34f Binary files /dev/null and b/002 After Image GUI Project/TVP_GENERATOR_resources/icon_48.png differ diff --git a/002 After Image GUI Project/Visu_Stim_Gen.prj b/002 After Image GUI Project/Visu_Stim_Gen.prj new file mode 100644 index 0000000..5c848d3 --- /dev/null +++ b/002 After Image GUI Project/Visu_Stim_Gen.prj @@ -0,0 +1,343 @@ + + + Visu_Stim_Gen + + + 1.0 + CPF + + + + + + + /Visu_Stim_Gen/ + option.installpath.systemwideapp + + In the following directions, replace MCR_ROOT by the directory where the MATLAB Runtime is installed on the target machine. + +If the environment variable DYLD_LIBRARY_PATH is undefined, set it to the concatenation of the following strings: + + MCR_ROOT/v901/runtime/maci64: + MCR_ROOT/v901/sys/os/maci64: + MCR_ROOT/v901/bin/maci64 + +If it is defined, set it to the concatenation of these strings: + + ${LD_LIBRARY_PATH}: + MCR_ROOT/v901/runtime/maci64: + MCR_ROOT/v901/sys/os/maci64: + MCR_ROOT/v901/bin/maci64 + + ${PROJECT_ROOT}/Visu_Stim_Gen/for_testing + ${PROJECT_ROOT}/Visu_Stim_Gen/for_redistribution_files_only + ${PROJECT_ROOT}/Visu_Stim_Gen/for_redistribution + ${PROJECT_ROOT}/Visu_Stim_Gen + false + + true + subtarget.standalone + + true + false + false + MyAppInstaller_web + MyAppInstaller_mcr + MyAppInstaller_app + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${PROJECT_ROOT}/AppTEST.mlapp + + + + + /Applications/Psychtoolbox/PsychBasic/CharAvail.m + /Applications/Psychtoolbox/PsychBasic/Datapixx.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/DrawFormattedText.m + /Applications/Psychtoolbox/PsychBasic/FlushEvents.m + /Applications/Psychtoolbox/PsychBasic/GetChar.m + /Applications/Psychtoolbox/PsychBasic/GetSecs.m + /Applications/Psychtoolbox/PsychBasic/GetSecs.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/HideCursor.m + /Applications/Psychtoolbox/PsychBasic/IOPort.m + /Applications/Psychtoolbox/PsychBasic/IOPort.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/IsWinVista.m + /Applications/Psychtoolbox/PsychBasic/KbCheck.m + /Applications/Psychtoolbox/PsychBasic/KbName.m + /Applications/Psychtoolbox/PsychBasic/KbQueueReserve.m + /Applications/Psychtoolbox/PsychBasic/LoadPsychHID.m + /Applications/Psychtoolbox/PsychBasic/MachAbsoluteTimeClockFrequency.m + /Applications/Psychtoolbox/PsychBasic/MachAbsoluteTimeClockFrequency.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/MachGetPriorityMex.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/MachSetPriorityMex.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/PsychHID.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/Screen.m + /Applications/Psychtoolbox/PsychBasic/Screen.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/SetMouse.m + /Applications/Psychtoolbox/PsychBasic/ShowCursor.m + /Applications/Psychtoolbox/PsychBasic/WaitSecs.m + /Applications/Psychtoolbox/PsychBasic/WaitSecs.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/moglcore.mexmaci64 + /Applications/Psychtoolbox/PsychBasic/psychlasterror.m + /Applications/Psychtoolbox/PsychBasic/psychrethrow.m + /Applications/Psychtoolbox/PsychContributed/ple.m + /Applications/Psychtoolbox/PsychFiles/PsychtoolboxConfigDir.m + /Applications/Psychtoolbox/PsychGLImageProcessing/AddImageUndistortionToGLOperator.m + /Applications/Psychtoolbox/PsychGLImageProcessing/AddToGLOperator.m + /Applications/Psychtoolbox/PsychGLImageProcessing/BitsPlusPlus.m + /Applications/Psychtoolbox/PsychGLImageProcessing/CountSlotsInGLOperator.m + /Applications/Psychtoolbox/PsychGLImageProcessing/CreateDisplayWarp.m + /Applications/Psychtoolbox/PsychGLImageProcessing/CreateGLOperator.m + /Applications/Psychtoolbox/PsychGLImageProcessing/CreatePseudoGrayLUT.m + /Applications/Psychtoolbox/PsychGLImageProcessing/PsychColorCorrection.m + /Applications/Psychtoolbox/PsychGLImageProcessing/PsychHelperCreateARGB2101010RemapCLUT.m + /Applications/Psychtoolbox/PsychGLImageProcessing/PsychHelperCreateGenericLuminanceToRGBA8LUT.m + /Applications/Psychtoolbox/PsychGLImageProcessing/PsychHelperCreateRGB111110RemapCLUT.m + /Applications/Psychtoolbox/PsychGLImageProcessing/PsychHelperCreateRemapCLUT.m + /Applications/Psychtoolbox/PsychGLImageProcessing/PsychImaging.m + /Applications/Psychtoolbox/PsychGLImageProcessing/PsychVideoSwitcher.m + /Applications/Psychtoolbox/PsychGLImageProcessing/SetCompressedStereoSideBySideParameters.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeed16BPCFixed.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeed16BPCFloat.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeed32BPCFloat.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedDualPass.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedDualWindowOutput.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedFastBackingStore.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedFastOffscreenWindows.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedHalfHeightWindow.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedHalfWidthWindow.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedImageProcessing.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedMultiPass.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedOtherStreamInput.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedOutputConversion.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedRetinaResolution.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychNeedTwiceWidthWindow.m + /Applications/Psychtoolbox/PsychGLImageProcessing/kPsychUse32BPCFloatAsap.m + /Applications/Psychtoolbox/PsychHardware/BitsPlusToolbox/BitsPlusDIO2Matrix.m + /Applications/Psychtoolbox/PsychHardware/BitsPlusToolbox/bitsEncodeDIO.m + /Applications/Psychtoolbox/PsychHardware/BitsPlusToolbox/bitsGoggles.m + /Applications/Psychtoolbox/PsychHardware/BrightSideDisplay/BrightSideCore.m + /Applications/Psychtoolbox/PsychHardware/BrightSideDisplay/BrightSideHDR.m + /Applications/Psychtoolbox/PsychHardware/DatapixxToolbox/DatapixxBasic/PsychDataPixx.m + /Applications/Psychtoolbox/PsychHardware/FindSerialPort.m + /Applications/Psychtoolbox/PsychHardware/GetKeyboardIndices.m + /Applications/Psychtoolbox/PsychHardware/GetKeypadIndices.m + /Applications/Psychtoolbox/PsychHardware/PsychGPURasterizerOffsets.m + /Applications/Psychtoolbox/PsychHardware/PsychGPUTestAndTweakGammaTables.m + /Applications/Psychtoolbox/PsychHardware/SerialComm.m + /Applications/Psychtoolbox/PsychJava/AssignGetCharJava.m + /Applications/Psychtoolbox/PsychJava/JavaTimeToGetSecs.m + /Applications/Psychtoolbox/PsychJava/PsychJavaSwingCleanup.m + /Applications/Psychtoolbox/PsychJava/PsychJavaTrouble.m + /Applications/Psychtoolbox/PsychJava/psychusejava.m + /Applications/Psychtoolbox/PsychObsolete/IsOS9.m + /Applications/Psychtoolbox/PsychObsolete/IsWindows.m + /Applications/Psychtoolbox/PsychOneliners/AssertGLSL.m + /Applications/Psychtoolbox/PsychOneliners/AssertMex.m + /Applications/Psychtoolbox/PsychOneliners/AssertOSX.m + /Applications/Psychtoolbox/PsychOneliners/AssertOpenGL.m + /Applications/Psychtoolbox/PsychOneliners/Is64Bit.m + /Applications/Psychtoolbox/PsychOneliners/IsGLES.m + /Applications/Psychtoolbox/PsychOneliners/IsGUI.m + /Applications/Psychtoolbox/PsychOneliners/IsLinux.m + /Applications/Psychtoolbox/PsychOneliners/IsOSX.m + /Applications/Psychtoolbox/PsychOneliners/IsOctave.m + /Applications/Psychtoolbox/PsychOneliners/IsWayland.m + /Applications/Psychtoolbox/PsychOneliners/IsWin.m + /Applications/Psychtoolbox/PsychOneliners/LoadIdentityClut.m + /Applications/Psychtoolbox/PsychOneliners/OSName.m + /Applications/Psychtoolbox/PsychOneliners/PsychDefaultSetup.m + /Applications/Psychtoolbox/PsychOneliners/PsychGPUControl.m + /Applications/Psychtoolbox/PsychOneliners/PsychNumel.m + /Applications/Psychtoolbox/PsychOneliners/PsychtoolboxRoot.m + /Applications/Psychtoolbox/PsychOneliners/RestoreCluts.m + /Applications/Psychtoolbox/PsychOneliners/SaveIdentityClut.m + /Applications/Psychtoolbox/PsychOneliners/Speak.m + /Applications/Psychtoolbox/PsychOneliners/WhiteIndex.m + /Applications/Psychtoolbox/PsychOneliners/WrapString.m + /Applications/Psychtoolbox/PsychOneliners/sca.m + /Applications/Psychtoolbox/PsychOneliners/streq.m + /Applications/Psychtoolbox/PsychOpenGL/LoadGLSLProgramFromFiles.m + /Applications/Psychtoolbox/PsychOpenGL/LoadShaderFromFile.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/core/InitializeMatlabOpenGL.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/core/mor.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glActiveTexture.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glAttachShader.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glBegin.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glBindTexture.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glCallList.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glColor3ub.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glColor4f.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glColorMask.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glCompileShader.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glCreateProgram.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glCreateShader.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glDisable.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glDisableClientState.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glDrawArrays.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glDrawPixels.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glEnable.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glEnableClientState.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glEnd.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glEndList.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glEvalMesh2.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glGenLists.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glGenTextures.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glGetError.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glGetIntegerv.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glGetString.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glGetUniformLocation.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glIsList.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glLinkProgram.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glLoadIdentity.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glMap2d.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glMapGrid2d.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glMatrixMode.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glMultMatrixf.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glNewList.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glOrthof.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glPointSize.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glPopAttrib.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glPopMatrix.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glPushAttrib.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glPushMatrix.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glRasterPos2f.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glRasterPos2i.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glRotatef.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glShaderSource.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glTexCoord2f.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glTexCoordPointer.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glTexImage2D.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glTexImage3D.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glTexParameteri.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glTexSubImage2D.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glTranslatef.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUniform1f.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUniform1i.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUniform2f.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUniform3f.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUniform3fv.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUniformMatrix3fv.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUniformMatrix4fv.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glUseProgram.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glVertex2f.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glVertex2i.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/glVertexPointer.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/gluErrorString.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/gluOrtho2D.m + /Applications/Psychtoolbox/PsychOpenGL/MOGL/wrap/moglsingle.m + /Applications/Psychtoolbox/PsychPriority/MachGetPriorityFlavor.m + /Applications/Psychtoolbox/PsychPriority/MachSetStandardPriority.m + /Applications/Psychtoolbox/PsychPriority/MachSetTimeConstraintPriority.m + /Applications/Psychtoolbox/PsychPriority/MaxPriority.m + /Applications/Psychtoolbox/PsychPriority/Priority.m + /Applications/Psychtoolbox/PsychRects/CenterRect.m + /Applications/Psychtoolbox/PsychRects/CenterRectOnPointd.m + /Applications/Psychtoolbox/PsychRects/ClipRect.m + /Applications/Psychtoolbox/PsychRects/OffsetRect.m + /Applications/Psychtoolbox/PsychRects/RectBottom.m + /Applications/Psychtoolbox/PsychRects/RectCenter.m + /Applications/Psychtoolbox/PsychRects/RectCenterd.m + /Applications/Psychtoolbox/PsychRects/RectHeight.m + /Applications/Psychtoolbox/PsychRects/RectLeft.m + /Applications/Psychtoolbox/PsychRects/RectRight.m + /Applications/Psychtoolbox/PsychRects/RectTop.m + /Applications/Psychtoolbox/PsychRects/RectWidth.m + /Applications/Psychtoolbox/PsychRects/ScaleRect.m + /Applications/Psychtoolbox/PsychRects/SetRect.m + ${PROJECT_ROOT}/AfIm_Exp.m + ${PROJECT_ROOT}/ContMatch_session.m + ${PROJECT_ROOT}/Disp_Color.m + ${PROJECT_ROOT}/HFP_session.m + ${PROJECT_ROOT}/LMS_to_XYZ.m + ${PROJECT_ROOT}/XYZ_to_RGB.m + ${PROJECT_ROOT}/sinspaceOneCycle.m + + + /Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/001 After Image GUI Project/Visu_Stim_Gen/for_testing/readme.txt + /Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/001 After Image GUI Project/Visu_Stim_Gen/for_testing/splash.png + /Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/001 After Image GUI Project/Visu_Stim_Gen/for_testing/Visu_Stim_Gen.app + /Users/clemente/Dropbox/Luminotecnia/2017/Chicago Lab files/2 Experiments/Color AfterImage_Exp_Room_150/2nd/1 Programs/001 After Image GUI Project/Visu_Stim_Gen/for_testing/run_Visu_Stim_Gen.sh + + + + /Applications/MATLAB_R2016a.app + + + + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + true + true + false + false + false + false + false + false + 10.11.6 + false + true + maci64 + true + + + \ No newline at end of file diff --git a/002 After Image GUI Project/XX_SessionsInfo b/002 After Image GUI Project/XX_SessionsInfo new file mode 100644 index 0000000..e69de29 diff --git a/002 After Image GUI Project/XYZ_to_RGB.m b/002 After Image GUI Project/XYZ_to_RGB.m new file mode 100755 index 0000000..683454d --- /dev/null +++ b/002 After Image GUI Project/XYZ_to_RGB.m @@ -0,0 +1,73 @@ +function RGB = XYZ_to_RGB(XYZ, Primary) +% function RGB = Color_Convert_XYZ_to_RGB(XYZ, Primary) +% +% Converts from Judd-Vos XYZ to Monitor RGB (for monitor with Primaries defined in Judd-Vos XYZ) +% +% Takes: XYZ (N, 3) - XYZ coordinates +% Primary (3, 3) - XYZ coordinates of red, green and blue guns / filters of monitor +% Returns: RGB (N, 3) - RGB coordinates (scaled from 0 to 1) +% Dependencies: Variable_Report.m +% +% Created 2015-06-26 by KCM +% +% Updated 2015-07-10 by KCM + +%% Arguments +if ~exist('XYZ', 'var') || isempty(XYZ) + fprintf(char(strcat({'\nColor_Convert_XYZ_to_RGB: '}, {'''XYZ'' must be provided!\n\n'}))) + RGB = []; return +end +if ~ismatrix(XYZ) || size(XYZ, 2) ~= 3 + fprintf(char(strcat({'\nColor_Convert_XYZ_to_RGB: '}, {'''XYZ'' must have size (N, 3)!\n\n'}))) + RGB = []; return +end +if sum(sum(~isfinite(XYZ))) || sum(sum(~isreal(XYZ))) + fprintf(char(strcat({'\nColor_Convert_XYZ_to_RGB: '}, ... + {'''XYZ'' must be finite and real!\n\n'}))) + RGB = []; return +end +if ~exist('Primary', 'var') || isempty(Primary) + fprintf(char(strcat({'\nColor_Convert_XYZ_to_RGB: '}, {'''Primary'' must be provided!\n\n'}))) + RGB = []; return +end +if ~ismatrix(Primary) || size(Primary, 1) ~= 3 || size(Primary, 2) ~= 3 + fprintf(char(strcat({'\nColor_Convert_XYZ_to_RGB: '}, ... + {'''Primary'' must have size (3, 3)!\n\n'}))) + RGB = []; return +end +if sum(sum(~isfinite(Primary))) || sum(sum(~isreal(Primary))) + fprintf(char(strcat({'\nColor_Convert_XYZ_to_RGB: '}, ... + {'''Primary'' must be finite and real!\n\n'}))) + RGB = []; return +end + +%% Denominator +denom = Primary(1, 1) * Primary(2, 2) * Primary(3, 3) + ... + Primary(2, 1) * Primary(3, 2) * Primary(1, 3) + ... + Primary(3, 1) * Primary(1, 2) * Primary(2, 3) - ... + Primary(1, 1) * Primary(3, 2) * Primary(2, 3) - ... + Primary(2, 1) * Primary(1, 2) * Primary(3, 3) - ... + Primary(3, 1) * Primary(2, 2) * Primary(1, 3); + +%% Components +rX = (Primary(2, 2) * Primary(3, 3) - Primary(2, 3) * Primary(3, 2)) / denom; +rY = (Primary(2, 3) * Primary(3, 1) - Primary(2, 1) * Primary(3, 3)) / denom; +rZ = (Primary(2, 1) * Primary(3, 2) - Primary(2, 2) * Primary(3, 1)) / denom; +gX = (Primary(3, 2) * Primary(1, 3) - Primary(3, 3) * Primary(1, 2)) / denom; +gY = (Primary(3, 3) * Primary(1, 1) - Primary(3, 1) * Primary(1, 3)) / denom; +gZ = (Primary(3, 1) * Primary(1, 2) - Primary(3, 2) * Primary(1, 1)) / denom; +bX = (Primary(1, 2) * Primary(2, 3) - Primary(1, 3) * Primary(2, 2)) / denom; +bY = (Primary(1, 3) * Primary(2, 1) - Primary(1, 1) * Primary(2, 3)) / denom; +bZ = (Primary(1, 1) * Primary(2, 2) - Primary(1, 2) * Primary(2, 1)) / denom; clear Primary denom + +%% RGB Values +tR = rX .* XYZ(:, 1) + rY .* XYZ(:, 2) + rZ .* XYZ(:, 3); clear rX rY rZ +tG = gX .* XYZ(:, 1) + gY .* XYZ(:, 2) + gZ .* XYZ(:, 3); clear gX gY gZ +tB = bX .* XYZ(:, 1) + bY .* XYZ(:, 2) + bZ .* XYZ(:, 3); clear XYZ bX bY bZ +RGB = [tR, tG, tB]; clear tR tG tB +RGB = round(RGB .* 1000) ./ 1000; + +% %% Variable Report (Housecleaning: for spotting uncleared variables. Omit if desired) +% Variable_Report(whos, 'RGB') + +end diff --git a/002 After Image GUI Project/colorCalFile1.mat b/002 After Image GUI Project/colorCalFile1.mat new file mode 100755 index 0000000..ba1c7b8 Binary files /dev/null and b/002 After Image GUI Project/colorCalFile1.mat differ diff --git a/002 After Image GUI Project/flatSound.m b/002 After Image GUI Project/flatSound.m new file mode 100644 index 0000000..ce96f99 --- /dev/null +++ b/002 After Image GUI Project/flatSound.m @@ -0,0 +1,13 @@ +function flatSound +% written by CPF + +Nsecs = 1; %number of seconds +delta_t = 1/4096; +t = 0:delta_t:(Nsecs-delta_t); + +Fs=4096; % sampling frequency +freq = 400 ; % frequency of the sound +A = 0.6;% amplitud of the sound (between 1 and -1 so it can be played by 'sound' function of Matlab +y = A*sin(2*pi*freq*t); % build the intensities over time +sound(y,Fs) +end \ No newline at end of file diff --git a/002 After Image GUI Project/pruebaFuncion.m b/002 After Image GUI Project/pruebaFuncion.m new file mode 100644 index 0000000..afa81b2 --- /dev/null +++ b/002 After Image GUI Project/pruebaFuncion.m @@ -0,0 +1,15 @@ + + +if gt(Bckg_Chro,1) + +% f = figure('Position', [100 100 752 250]); +t = uitable('Parent', Table1, 'Position', [25 50 700 200], 'Data', Bckg_Chro) + +else + +% f = figure('Position', [100 100 752 250]); +t = uitable('Parent', , 'Position', [25 50 700 200], 'Data', Bckg_Chro) + + + + \ No newline at end of file diff --git a/002 After Image GUI Project/pruebaReadTable.m b/002 After Image GUI Project/pruebaReadTable.m new file mode 100644 index 0000000..063392c --- /dev/null +++ b/002 After Image GUI Project/pruebaReadTable.m @@ -0,0 +1,37 @@ +[FileName,PathName] = uigetfile('*.txt','Select the MATLAB code file'); + +if FileName == 0% +return + +else + +ExpCond = readtable(FileName,'Delimiter',',') +Bckg_Chro = [ExpCond{:,2} ExpCond{:,3}]; + +app.Lum_Field.Value = str2num(Values{1}); +app.littleL_Field.Value = str2num(Values{2}); +app.littleS_Field.Value = str2num(Values{3}); +app.CheckBox.Value = str2num(Values{1,4}); +app.CheckBox2.Value = str2num(Values{1,5}); +app.CheckBox3.Value = str2num(Values{1,6}); +app.CheckBox4.Value = str2num(Values{1,7}); +app.CheckBox5.Value = str2num(Values{1,8}); +app.CheckBox6.Value = str2num(Values{1,9}); +app.CheckBox7.Value = str2num(Values{1,10}); +app.CheckBox8.Value = str2num(Values{1,11}); +app.CheckBox9.Value = str2num(Values{1,12}); + +end + +app.Lum_Field.Value = ExpCond{1,1}; +app.littleL_Field.Value = ExpCond{1,2}; +app.littleS_Field.Value = ExpCond{1,3}; +app.CheckBox.Value = ExpCond{1,4}; +app.CheckBox2.Value = ExpCond{1,5}; +app.CheckBox3.Value = ExpCond{1,6}; +app.CheckBox4.Value = ExpCond{1,7}; +app.CheckBox5.Value = ExpCond{1,8}; +app.CheckBox6.Value = ExpCond{1,9}; +app.CheckBox7.Value = ExpCond{1,10}; +app.CheckBox8.Value = ExpCond{1,11}; +app.CheckBox9.Value = ExpCond{1,12}; \ No newline at end of file diff --git a/002 After Image GUI Project/sinspace.m b/002 After Image GUI Project/sinspace.m new file mode 100755 index 0000000..1ff70af --- /dev/null +++ b/002 After Image GUI Project/sinspace.m @@ -0,0 +1,9 @@ +function [c] = sinspace(a, b, n) + + c = zeros(1, n); + ind = [0:pi/n:pi]; + for i=1:n + c(i) = a + (b-a)*sin(ind(i)); + end + +return; \ No newline at end of file diff --git a/002 After Image GUI Project/sinspaceOneCycle.m b/002 After Image GUI Project/sinspaceOneCycle.m new file mode 100755 index 0000000..3e5452f --- /dev/null +++ b/002 After Image GUI Project/sinspaceOneCycle.m @@ -0,0 +1,9 @@ +function [c] = OneCycleSinspace(a, b, n) + + c = zeros(1, n); + ind = [0:2*pi/n:2*pi]; + for i=1:n + c(i) = a + (b-a)*sin(ind(i)); + end + +return; \ No newline at end of file diff --git a/002 After Image GUI Project/tvp_GENERATOR.prj b/002 After Image GUI Project/tvp_GENERATOR.prj new file mode 100644 index 0000000..03d312e --- /dev/null +++ b/002 After Image GUI Project/tvp_GENERATOR.prj @@ -0,0 +1,268 @@ + + + tvp_GENERATOR + CPF + + UIC + ${PROJECT_ROOT}\tvp_GENERATOR_resources\icon_24.png + + ${PROJECT_ROOT}\TVP_GENERATOR_resources\icon_48.png + ${PROJECT_ROOT}\TVP_GENERATOR_resources\icon_24.png + ${PROJECT_ROOT}\TVP_GENERATOR_resources\icon_16.png + + + + + 1.0 + + + + + maci64 + + ${PROJECT_ROOT}\App Name.mlappinstall + 05b15400-8656-4ef0-8422-d77d5791bf20 + + + + + + + + + + + + + ${PROJECT_ROOT}\TVP_GENERATOR.mlapp + + + C:\Applications\Psychtoolbox\PsychBasic\CharAvail.m + C:\Applications\Psychtoolbox\PsychBasic\Datapixx.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\DrawFormattedText.m + C:\Applications\Psychtoolbox\PsychBasic\FlushEvents.m + C:\Applications\Psychtoolbox\PsychBasic\GetChar.m + C:\Applications\Psychtoolbox\PsychBasic\GetSecs.m + C:\Applications\Psychtoolbox\PsychBasic\GetSecs.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\HideCursor.m + C:\Applications\Psychtoolbox\PsychBasic\IOPort.m + C:\Applications\Psychtoolbox\PsychBasic\IOPort.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\IsWinVista.m + C:\Applications\Psychtoolbox\PsychBasic\KbCheck.m + C:\Applications\Psychtoolbox\PsychBasic\KbName.m + C:\Applications\Psychtoolbox\PsychBasic\KbQueueReserve.m + C:\Applications\Psychtoolbox\PsychBasic\LoadPsychHID.m + C:\Applications\Psychtoolbox\PsychBasic\MachAbsoluteTimeClockFrequency.m + C:\Applications\Psychtoolbox\PsychBasic\MachAbsoluteTimeClockFrequency.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\MachGetPriorityMex.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\MachSetPriorityMex.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\moglcore.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\PsychHID.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\psychlasterror.m + C:\Applications\Psychtoolbox\PsychBasic\psychrethrow.m + C:\Applications\Psychtoolbox\PsychBasic\Screen.m + C:\Applications\Psychtoolbox\PsychBasic\Screen.mexmaci64 + C:\Applications\Psychtoolbox\PsychBasic\SetMouse.m + C:\Applications\Psychtoolbox\PsychBasic\ShowCursor.m + C:\Applications\Psychtoolbox\PsychBasic\WaitSecs.m + C:\Applications\Psychtoolbox\PsychBasic\WaitSecs.mexmaci64 + C:\Applications\Psychtoolbox\PsychContributed\ple.m + C:\Applications\Psychtoolbox\PsychFiles\PsychtoolboxConfigDir.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\AddImageUndistortionToGLOperator.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\AddToGLOperator.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\BitsPlusPlus.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\CountSlotsInGLOperator.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\CreateDisplayWarp.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\CreateGLOperator.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\CreatePseudoGrayLUT.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeed16BPCFixed.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeed16BPCFloat.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeed32BPCFloat.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedDualPass.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedDualWindowOutput.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedFastBackingStore.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedFastOffscreenWindows.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedHalfHeightWindow.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedHalfWidthWindow.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedImageProcessing.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedMultiPass.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedOtherStreamInput.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedOutputConversion.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedRetinaResolution.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychNeedTwiceWidthWindow.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\kPsychUse32BPCFloatAsap.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\PsychColorCorrection.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\PsychHelperCreateARGB2101010RemapCLUT.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\PsychHelperCreateGenericLuminanceToRGBA8LUT.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\PsychHelperCreateRemapCLUT.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\PsychHelperCreateRGB111110RemapCLUT.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\PsychImaging.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\PsychVideoSwitcher.m + C:\Applications\Psychtoolbox\PsychGLImageProcessing\SetCompressedStereoSideBySideParameters.m + C:\Applications\Psychtoolbox\PsychHardware\BitsPlusToolbox\bitsEncodeDIO.m + C:\Applications\Psychtoolbox\PsychHardware\BitsPlusToolbox\bitsGoggles.m + C:\Applications\Psychtoolbox\PsychHardware\BitsPlusToolbox\BitsPlusDIO2Matrix.m + C:\Applications\Psychtoolbox\PsychHardware\BrightSideDisplay\BrightSideCore.m + C:\Applications\Psychtoolbox\PsychHardware\BrightSideDisplay\BrightSideHDR.m + C:\Applications\Psychtoolbox\PsychHardware\DatapixxToolbox\DatapixxBasic\PsychDataPixx.m + C:\Applications\Psychtoolbox\PsychHardware\FindSerialPort.m + C:\Applications\Psychtoolbox\PsychHardware\GetKeyboardIndices.m + C:\Applications\Psychtoolbox\PsychHardware\GetKeypadIndices.m + C:\Applications\Psychtoolbox\PsychHardware\PsychGPURasterizerOffsets.m + C:\Applications\Psychtoolbox\PsychHardware\PsychGPUTestAndTweakGammaTables.m + C:\Applications\Psychtoolbox\PsychHardware\SerialComm.m + C:\Applications\Psychtoolbox\PsychJava\AssignGetCharJava.m + C:\Applications\Psychtoolbox\PsychJava\JavaTimeToGetSecs.m + C:\Applications\Psychtoolbox\PsychJava\PsychJavaSwingCleanup.m + C:\Applications\Psychtoolbox\PsychJava\PsychJavaTrouble.m + C:\Applications\Psychtoolbox\PsychJava\psychusejava.m + C:\Applications\Psychtoolbox\PsychObsolete\IsOS9.m + C:\Applications\Psychtoolbox\PsychObsolete\IsWindows.m + C:\Applications\Psychtoolbox\PsychOneliners\AssertGLSL.m + C:\Applications\Psychtoolbox\PsychOneliners\AssertMex.m + C:\Applications\Psychtoolbox\PsychOneliners\AssertOpenGL.m + C:\Applications\Psychtoolbox\PsychOneliners\AssertOSX.m + C:\Applications\Psychtoolbox\PsychOneliners\Is64Bit.m + C:\Applications\Psychtoolbox\PsychOneliners\IsGLES.m + C:\Applications\Psychtoolbox\PsychOneliners\IsGUI.m + C:\Applications\Psychtoolbox\PsychOneliners\IsLinux.m + C:\Applications\Psychtoolbox\PsychOneliners\IsOctave.m + C:\Applications\Psychtoolbox\PsychOneliners\IsOSX.m + C:\Applications\Psychtoolbox\PsychOneliners\IsWayland.m + C:\Applications\Psychtoolbox\PsychOneliners\IsWin.m + C:\Applications\Psychtoolbox\PsychOneliners\LoadIdentityClut.m + C:\Applications\Psychtoolbox\PsychOneliners\OSName.m + C:\Applications\Psychtoolbox\PsychOneliners\PsychDefaultSetup.m + C:\Applications\Psychtoolbox\PsychOneliners\PsychGPUControl.m + C:\Applications\Psychtoolbox\PsychOneliners\PsychNumel.m + C:\Applications\Psychtoolbox\PsychOneliners\PsychtoolboxRoot.m + C:\Applications\Psychtoolbox\PsychOneliners\RestoreCluts.m + C:\Applications\Psychtoolbox\PsychOneliners\SaveIdentityClut.m + C:\Applications\Psychtoolbox\PsychOneliners\sca.m + C:\Applications\Psychtoolbox\PsychOneliners\Speak.m + C:\Applications\Psychtoolbox\PsychOneliners\streq.m + C:\Applications\Psychtoolbox\PsychOneliners\WhiteIndex.m + C:\Applications\Psychtoolbox\PsychOneliners\WrapString.m + C:\Applications\Psychtoolbox\PsychOpenGL\LoadGLSLProgramFromFiles.m + C:\Applications\Psychtoolbox\PsychOpenGL\LoadShaderFromFile.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\core\InitializeMatlabOpenGL.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\core\mor.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glActiveTexture.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glAttachShader.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glBegin.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glBindTexture.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glCallList.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glColor3ub.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glColor4f.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glColorMask.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glCompileShader.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glCreateProgram.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glCreateShader.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glDisable.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glDisableClientState.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glDrawArrays.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glDrawPixels.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glEnable.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glEnableClientState.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glEnd.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glEndList.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glEvalMesh2.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glGenLists.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glGenTextures.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glGetError.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glGetIntegerv.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glGetString.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glGetUniformLocation.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glIsList.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glLinkProgram.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glLoadIdentity.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glMap2d.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glMapGrid2d.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glMatrixMode.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glMultMatrixf.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glNewList.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glOrthof.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glPointSize.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glPopAttrib.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glPopMatrix.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glPushAttrib.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glPushMatrix.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glRasterPos2f.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glRasterPos2i.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glRotatef.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glShaderSource.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glTexCoord2f.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glTexCoordPointer.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glTexImage2D.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glTexImage3D.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glTexParameteri.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glTexSubImage2D.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glTranslatef.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\gluErrorString.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUniform1f.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUniform1i.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUniform2f.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUniform3f.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUniform3fv.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUniformMatrix3fv.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUniformMatrix4fv.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\gluOrtho2D.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glUseProgram.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glVertex2f.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glVertex2i.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\glVertexPointer.m + C:\Applications\Psychtoolbox\PsychOpenGL\MOGL\wrap\moglsingle.m + C:\Applications\Psychtoolbox\PsychPriority\MachGetPriorityFlavor.m + C:\Applications\Psychtoolbox\PsychPriority\MachSetStandardPriority.m + C:\Applications\Psychtoolbox\PsychPriority\MachSetTimeConstraintPriority.m + C:\Applications\Psychtoolbox\PsychPriority\MaxPriority.m + C:\Applications\Psychtoolbox\PsychPriority\Priority.m + C:\Applications\Psychtoolbox\PsychRects\CenterRect.m + C:\Applications\Psychtoolbox\PsychRects\CenterRectOnPointd.m + C:\Applications\Psychtoolbox\PsychRects\ClipRect.m + C:\Applications\Psychtoolbox\PsychRects\OffsetRect.m + C:\Applications\Psychtoolbox\PsychRects\RectBottom.m + C:\Applications\Psychtoolbox\PsychRects\RectCenter.m + C:\Applications\Psychtoolbox\PsychRects\RectCenterd.m + C:\Applications\Psychtoolbox\PsychRects\RectHeight.m + C:\Applications\Psychtoolbox\PsychRects\RectLeft.m + C:\Applications\Psychtoolbox\PsychRects\RectRight.m + C:\Applications\Psychtoolbox\PsychRects\RectTop.m + C:\Applications\Psychtoolbox\PsychRects\RectWidth.m + C:\Applications\Psychtoolbox\PsychRects\ScaleRect.m + C:\Applications\Psychtoolbox\PsychRects\SetRect.m + ${PROJECT_ROOT}\AfIm_Exp.m + ${PROJECT_ROOT}\ContMatch_session.m + ${PROJECT_ROOT}\Disp_Color.m + ${PROJECT_ROOT}\HFP_session.m + ${PROJECT_ROOT}\LMS_to_XYZ.m + ${PROJECT_ROOT}\sinspaceOneCycle.m + ${PROJECT_ROOT}\XYZ_to_RGB.m + + + + + D:\Dropbox\Luminotecnia\2018\Experiments\Color Background Afterimage\1 Programs\002 After Image GUI Project\App Name.mlappinstall + + + + D:\Archivos de Programa\Matlab 2014 + + + + false + false + true + false + false + false + false + false + 6.2 + false + true + win64 + true + + + \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/.DS_Store b/Experimental Conditions (zaidi paradigm)/.DS_Store new file mode 100644 index 0000000..a6e2850 Binary files /dev/null and b/Experimental Conditions (zaidi paradigm)/.DS_Store differ diff --git a/Experimental Conditions (zaidi paradigm)/01 Backgr_EEW_9axes_4cont.txt b/Experimental Conditions (zaidi paradigm)/01 Backgr_EEW_9axes_4cont.txt new file mode 100644 index 0000000..9555c1e --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/01 Backgr_EEW_9axes_4cont.txt @@ -0,0 +1,2 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.00 , 60, 3 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 diff --git a/Experimental Conditions (zaidi paradigm)/MT_9_CHROS_lum.txt b/Experimental Conditions (zaidi paradigm)/MT_9_CHROS_lum.txt new file mode 100644 index 0000000..9b944bd --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/MT_9_CHROS_lum.txt @@ -0,0 +1,14 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 2.000 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 3.000 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.647 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.500 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.647 , 1.000 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.641 , 1.000 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.683 , 1.000 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.689 , 1.000 , 60, 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 + + + + diff --git a/Experimental Conditions (zaidi paradigm)/OneEnd_4_CHROS_3axis.txt b/Experimental Conditions (zaidi paradigm)/OneEnd_4_CHROS_3axis.txt new file mode 100644 index 0000000..0ab608f --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/OneEnd_4_CHROS_3axis.txt @@ -0,0 +1,11 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.647 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , +20, 0.641 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , +20, 0.683 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , +20, 0.689 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/OneEnd_5_CHROS_3axis.txt b/Experimental Conditions (zaidi paradigm)/OneEnd_5_CHROS_3axis.txt new file mode 100644 index 0000000..c1f5dc0 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/OneEnd_5_CHROS_3axis.txt @@ -0,0 +1,10 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , +20, 0.665 , 2.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , +20, 0.665 , 3.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , +20, 0.665 , 0.647 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , +20, 0.665 , 0.500 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/.DS_Store b/Experimental Conditions (zaidi paradigm)/Others/.DS_Store new file mode 100644 index 0000000..3266372 Binary files /dev/null and b/Experimental Conditions (zaidi paradigm)/Others/.DS_Store differ diff --git a/Experimental Conditions (zaidi paradigm)/Others/01 Backgr_EEW_9axes_4cont.txt b/Experimental Conditions (zaidi paradigm)/Others/01 Backgr_EEW_9axes_4cont.txt new file mode 100644 index 0000000..5f34f00 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/01 Backgr_EEW_9axes_4cont.txt @@ -0,0 +1,2 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.00 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 diff --git a/Experimental Conditions (zaidi paradigm)/Others/02 Backgr_4chro_9axes_2cont.txt b/Experimental Conditions (zaidi paradigm)/Others/02 Backgr_4chro_9axes_2cont.txt new file mode 100644 index 0000000..47d81c4 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/02 Backgr_4chro_9axes_2cont.txt @@ -0,0 +1,5 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.353 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 0.647 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.647 , 1.000 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.683 , 1.000 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Others/MT_OneEnd_4_CHROS_3axis.txt b/Experimental Conditions (zaidi paradigm)/Others/MT_OneEnd_4_CHROS_3axis.txt new file mode 100644 index 0000000..c6353fb --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/MT_OneEnd_4_CHROS_3axis.txt @@ -0,0 +1,11 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.647 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.641 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.683 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.689 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/MT_OneEnd_5_CHROS_3axis.txt b/Experimental Conditions (zaidi paradigm)/Others/MT_OneEnd_5_CHROS_3axis.txt new file mode 100644 index 0000000..0d46fe9 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/MT_OneEnd_5_CHROS_3axis.txt @@ -0,0 +1,10 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 2.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 3.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.647 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.500 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/Prueba_ReadTable.txt b/Experimental Conditions (zaidi paradigm)/Others/Prueba_ReadTable.txt new file mode 100644 index 0000000..56d6af5 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/Prueba_ReadTable.txt @@ -0,0 +1,5 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.10 , 60, 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.40 , 60, 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.00 , 60, 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.40 , 60, 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Others/TEST01 Backgr_5chro_9axes_1cont.txt b/Experimental Conditions (zaidi paradigm)/Others/TEST01 Backgr_5chro_9axes_1cont.txt new file mode 100644 index 0000000..fb50c9f --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TEST01 Backgr_5chro_9axes_1cont.txt @@ -0,0 +1,6 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 1.353 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 0.647 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.647 , 1.000 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.683 , 1.000 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING 13_CHROS_1axis.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING 13_CHROS_1axis.txt new file mode 100644 index 0000000..975c9c4 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING 13_CHROS_1axis.txt @@ -0,0 +1,19 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.176 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.353 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.500 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.824 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.647 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.500 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.656 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.647 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.641 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.674 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.683 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.689 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING 13_CHROS_2axes.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING 13_CHROS_2axes.txt new file mode 100644 index 0000000..c7af181 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING 13_CHROS_2axes.txt @@ -0,0 +1,19 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.176 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.353 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.500 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.824 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.647 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.500 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.656 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.647 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.641 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.674 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.683 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.689 , 1.000 , 60, 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING ClosestEEW-Chro ColorBackgr.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING ClosestEEW-Chro ColorBackgr.txt new file mode 100644 index 0000000..3c8c8ca --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING ClosestEEW-Chro ColorBackgr.txt @@ -0,0 +1,5 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.176 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 0.824 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.656 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.674 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING Middle-Chro ColorBackgr.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING Middle-Chro ColorBackgr.txt new file mode 100644 index 0000000..132d408 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING Middle-Chro ColorBackgr.txt @@ -0,0 +1,6 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 1.353 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 0.647 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.647 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.683 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING MostExtreme-Chro ColorBackgr.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING MostExtreme-Chro ColorBackgr.txt new file mode 100644 index 0000000..168633e --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING MostExtreme-Chro ColorBackgr.txt @@ -0,0 +1,6 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 1.5 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.665 , 0.5 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.641 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 +20, 0.689 , 1.000 , 100, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_13_CHROS_1axis.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_13_CHROS_1axis.txt new file mode 100644 index 0000000..975c9c4 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_13_CHROS_1axis.txt @@ -0,0 +1,19 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.176 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.353 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.500 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.824 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.647 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.500 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.656 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.647 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.641 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.674 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.683 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.689 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_7_CHROS_1axis(1).txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_7_CHROS_1axis(1).txt new file mode 100644 index 0000000..d001993 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_7_CHROS_1axis(1).txt @@ -0,0 +1,14 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.176 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.353 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.500 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.824 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.647 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.500 , 60, 3 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_7_CHROS_1axis(2).txt b/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_7_CHROS_1axis(2).txt new file mode 100644 index 0000000..3cf9af3 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTING_OneEnd_7_CHROS_1axis(2).txt @@ -0,0 +1,14 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.656 , 1.000 , 60, 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.647 , 1.000 , 60, 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.641 , 1.000 , 60, 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.674 , 1.000 , 60, 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.683 , 1.000 , 60, 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.689 , 1.000 , 60, 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTT copy.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTT copy.txt new file mode 100644 index 0000000..34b4475 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTT copy.txt @@ -0,0 +1,9 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 2 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 + + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TESTT.txt b/Experimental Conditions (zaidi paradigm)/Others/TESTT.txt new file mode 100644 index 0000000..296af13 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TESTT.txt @@ -0,0 +1,9 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TEST_Chros_OtherContrasts.txt b/Experimental Conditions (zaidi paradigm)/Others/TEST_Chros_OtherContrasts.txt new file mode 100644 index 0000000..418fe33 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TEST_Chros_OtherContrasts.txt @@ -0,0 +1,13 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 3.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.500 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.641 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.689 , 1.000 , 60, 3 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TEST_lAxis_Contrast.txt b/Experimental Conditions (zaidi paradigm)/Others/TEST_lAxis_Contrast.txt new file mode 100644 index 0000000..43699e7 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TEST_lAxis_Contrast.txt @@ -0,0 +1,9 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 5 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/TEST_sAxis_Contrast.txt b/Experimental Conditions (zaidi paradigm)/Others/TEST_sAxis_Contrast.txt new file mode 100644 index 0000000..1af0956 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TEST_sAxis_Contrast.txt @@ -0,0 +1,9 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 5 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/Others/Test.txt b/Experimental Conditions (zaidi paradigm)/Others/Test.txt new file mode 100644 index 0000000..c473210 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/Test.txt @@ -0,0 +1,5 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis , s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.3 , 60, 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 0.6 , 60, 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.647 , 1.0 , 60, 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.683 , 1.0 , 60, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Others/TestOneEnd.txt b/Experimental Conditions (zaidi paradigm)/Others/TestOneEnd.txt new file mode 100644 index 0000000..5318cd8 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/TestOneEnd.txt @@ -0,0 +1,4 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis , s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 1, 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.176 , 1, 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 +20, 0.665 , 1.353 , 1, 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 diff --git a/Experimental Conditions (zaidi paradigm)/Others/red_background.txt b/Experimental Conditions (zaidi paradigm)/Others/red_background.txt new file mode 100644 index 0000000..d1c3dc1 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Others/red_background.txt @@ -0,0 +1,2 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.683 , 1.000 , 60, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 \ No newline at end of file diff --git a/Experimental Conditions (zaidi paradigm)/Pupil.txt b/Experimental Conditions (zaidi paradigm)/Pupil.txt new file mode 100644 index 0000000..fb884e2 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/Pupil.txt @@ -0,0 +1,2 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.00 , 60 , 5 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0, diff --git a/Experimental Conditions (zaidi paradigm)/PupilDELETE.txt b/Experimental Conditions (zaidi paradigm)/PupilDELETE.txt new file mode 100644 index 0000000..dc85221 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/PupilDELETE.txt @@ -0,0 +1,2 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.00 , 1 , 2 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0, diff --git a/Experimental Conditions (zaidi paradigm)/TwoVP_unbalanced.txt b/Experimental Conditions (zaidi paradigm)/TwoVP_unbalanced.txt new file mode 100644 index 0000000..57520cc --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/TwoVP_unbalanced.txt @@ -0,0 +1,7 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 5 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 + + + + + diff --git a/Experimental Conditions (zaidi paradigm)/video.txt b/Experimental Conditions (zaidi paradigm)/video.txt new file mode 100644 index 0000000..d6e4ee6 --- /dev/null +++ b/Experimental Conditions (zaidi paradigm)/video.txt @@ -0,0 +1,7 @@ +Luminance , Chro_littL , Chro_littS , AdaptTime, nRep, l_axis, s_axis , lum_axis , l_s_45 , l_s_135 , lum_l_45 , lum_l_135 , lum_s_45 , lum_s_135 +20, 0.665 , 1.000 , 60, 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + + + + +