-
Notifications
You must be signed in to change notification settings - Fork 1
/
prepareData.m
52 lines (36 loc) · 1.79 KB
/
prepareData.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%calculates powerspectrum table for each drug in list for t-tests
clear;
%add eeglab to path and start its init file
addpath('eeglab2021.0\');
eeglab;
%check if this is the right folder, folders must exists!
drive="D:/";% folder with edf files
resultFolder = "D:/Results/t-test/single drugs/Powerspectrum2/";% result folder
%import necessary functions
d = functionsForTUHData;
funcEDF = functionsForEDFFiles;
TUHDownload = functionsTuhDownload;
excel = scriptWorkWithExcelData;
%all drugs from Hyun
% meds=["Risperidone", "Olanzapine", "Quetiapine", "Aripiprazole", "Ziprasidone", "Haloperidol", "Clozapin", ...
% "Escitalopram", "Sertraline", "Paroxetine", "Fluoxetine", "Bupropion", "Venlafaxine", "Mirtazapine", ...
% "Trazodone", "Valproate", "Lamotrigine", "Carbamazepine", "Topiramate", "Levetiracetam", "Lithium", ...
% "Lorazepam", "Clonazepam", "Diazepam", "Alprazolam"];
meds=[ "Topiramate", "Levetiracetam"];
%meds=["Risperidone"];
for i=1:length(meds)
medicine = strcat(meds(i));
folder = strcat(drive,'EDFData\', medicine, '\CleanData');
listEDF = d.createFileList('edf',folder);
psfile = strcat(resultFolder, medicine, '_powerspectrum.xls');
removedFiles = strcat(resultFolder, medicine, '_removedFilesEpochs.txt');
psFileAverage= strcat(resultFolder, medicine, '_powerspectrumAverage.xls');
%calculate powerspectrum for each file
funcEDF.calculatePowerForBandsTTest(listEDF, psfile, removedFiles);
%average over patients
funcEDF.averagePatientTTest(psfile, psFileAverage);
%calculate power from edf files, returns for each edf file several xls
%files that contain power for each frequency band
%uses spectopo from eeglab - for epoched data!
%funcEDF.calculatePowerForBandsAveragePatient(listEDF, psfile, removedFiles);
end