123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- %% generate light data_file for efficient processing
- Training=2; %1 for Overtraining, 2 for acquisition
- %% OT dataSet
- if Training==1
- load('Rextendedtraining.mat');
- Erefnames=R.Erefnames(1:7);
- Tm=R.Param.Tm;
- Ninfo=R.Ninfo;
- Coord=R.Coord;
- %Class=R.Class(:,1);
-
- for i=1:length(Erefnames)
- Ev(i).PSTHz(:,:)=R.Ev(i).PSTHz(:,:);
- Ev(i).PSTHraw(:,:)=R.Ev(i).PSTHraw(:,:);
- Ev(i).PSTHrawBL(:,:)=R.Ev(i).PSTHrawBL(:,:);
- Ev(i).Meanz(:,1)=R.Ev(i).Meanz(:,1);
- %Ev(i).BW(:,1)=R.Ev(i).BW(:,1);
- Ev(i).MeanzPRE(:,1)=R.Ev(i).MeanzPRE(:,1);
- A(:,i)=R.Ev(i).RespDirPost;
- B(:,i)=R.Ev(i).RespDirPre;
- if ~isempty(R.Ev(i).rawMeanz)
- Ev(i).rawMeanz(:,1)=R.Ev(i).rawMeanz(:,1);
- Ev(i).rawMeanzPre(:,1)=R.Ev(i).rawMeanzPre(:,1);
- else
- Ev(i).rawMeanz(length(Ev(i).Meanz(:,1)),1)=nan;
- Ev(i).rawMeanzPre(:,1)=R.Ev(i).rawMeanzPre(:,1);
- end
- end
- TRNevent=[B(:,1:6) A(:,1:5) A(:,7)];
- TRN(:,1)=nansum(abs(TRNevent),2);
-
- save('Rextendedtraining_light.mat','Coord','Erefnames','Ev','Ninfo','Tm','TRN')
- %% Acquisition data set
- else
- load('Rearlytraining.mat');
- path='C:\Users\yvandae1\Documents\MATLAB\DT Nex Files\RESULTdt.xls';
- [~,Session] = xlsread(path,'Windows','c18:c30');
- Erefnames=R.Erefnames(1:7);
- Tm=R.Param.Tm;
-
-
- for i=1:size(R.Ses,2) %include sessions DT and DT5
- A=[];B=[];
- A(1:length(R.Ses(i).Coord),1:length(Erefnames))=NaN(length(R.Ses(i).Coord),length(Erefnames));
- Ses(i).Coord=R.Ses(i).Coord;
- Ses(i).Ninfo=R.Ses(i).Ninfo;
- for j=1:length(Erefnames)
- Ses(i).Ev(j).PSTHz(:,:)=R.Ses(i).Ev(j).PSTHz(:,:);
- Ses(i).Ev(j).PSTHraw(:,:)=R.Ses(i).Ev(j).PSTHraw(:,:);
- Ses(i).Ev(j).PSTHrawBL(:,:)=R.Ses(i).Ev(j).PSTHrawBL(:,:);
- Ses(i).Ev(j).Meanz(:,1)=R.Ses(i).Ev(j).Meanz(:,1);
- if ~isempty(R.Ses(i).Ev(j).rawMeanz)
- Ses(i).Ev(j).rawMeanz(:,1)=R.Ses(i).Ev(j).rawMeanz(:,1);
- Ses(i).Ev(j).MeanzPRE(:,1)=R.Ses(i).Ev(j).MeanzPRE(:,1);
- else
- Ses(i).Ev(j).rawMeanz(length(Ses(i).Ev(j).Meanz(:,1)),1)=nan;
- Ses(i).Ev(j).rawMeanz(length(Ses(i).Ev(j).Meanz(:,1)),1)=nan;
- end
- A(:,j)=R.Ses(i).Ev(j).RespDirPost;
- B(:,j)=R.Ses(i).Ev(j).RespDirPre;
- end
- TRNevent=[B(:,1:6) A(:,1:5) A(:,7)];
- Ses(i).TRN(:,1)=nansum(abs(TRNevent),2);
- end
- save('Rearlytraining_light.mat','Erefnames','Ses','Tm')
- end
-
|