123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- function pooltweyepos=getTimewinsPoolEyePos(poolstackvars,poolstackepos)
- opts = struct('WindowStyle','modal','Interpreter','none','Default','No');
- answer = questdlg('This requires memory at runtime. Are you sure to continue?','Memory Warning','Yes','No',opts);
- if strcmpi(answer,'No'); error('Aborted getting pool stack eye position (consider cleaning workspace).'); end
- if nargin<2
- subjsData(1).sbdata=getSubjectData(1);
- subjsData(2).sbdata=getSubjectData(2);
- poolstackepos=getPoolStackEyePos(subjsData);
- if nargin<1
- poolstackvars=getPoolStackVars(subjsData);
- end
- end
- Nsns=size(poolstackepos,1);
- Ntws=size(poolstackepos,2);
- Ncells=arrayfun(@(sn) poolstackvars(sn).ncells, 1:Nsns);
- Ntrs=arrayfun(@(sn) size(poolstackvars(sn).offer1sd,1),1:Nsns);
- Ntrs12=max(Ntrs);
- Ntps=[400 arrayfun(@(tw) max(arrayfun(@(sn) size(poolstackepos(sn,tw).eyePosX,2), 1:Nsns)),2:Ntws)];
- pooltweyepos(Ntws).posX=[];
- pooltweyepos(Ntws).posY=[];
- for sn=1:Nsns
- for tw=1:Ntws
- % re-reference to 1st offer = L
- if tw==1
- curreposx=poolstackepos(sn,tw).eyePosX(:,end-400+1:end);
- curreposy=poolstackepos(sn,tw).eyePosY(:,end-400+1:end);
- else
- curreposx=poolstackepos(sn,tw).eyePosX;
- curreposy=poolstackepos(sn,tw).eyePosY;
- end
- % is1stL=find(poolstackvars(sn).offer1sd==1);
- is1stR=find(poolstackvars(sn).offer1sd==0);
- curreposx(is1stR,:)=-curreposx(is1stR,:);
-
- [currntrs, currntps]=size(curreposx);
- pooltweyepos(tw).posX= cat(2, pooltweyepos(tw).posX, cat(1, cat(3, repmat(reshape(curreposx,[currntrs 1 currntps]),[1 Ncells(sn) 1]),...
- nan(Ntrs(sn),Ncells(sn),Ntps(tw)-currntps)), nan(Ntrs12-Ntrs(sn),Ncells(sn),Ntps(tw))));
- pooltweyepos(tw).posY= cat(2, pooltweyepos(tw).posY, cat(1, cat(3, repmat(reshape(curreposy,[currntrs 1 currntps]),[1 Ncells(sn) 1]),...
- nan(Ntrs(sn),Ncells(sn),Ntps(tw)-currntps)), nan(Ntrs12-Ntrs(sn),Ncells(sn),Ntps(tw))));
-
- end
- end
- end
|