-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocRecognition.jl
51 lines (39 loc) · 1.43 KB
/
socRecognition.jl
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
49
50
using Revise
using JLD, MAT, Statistics, Gtk, StatsPlots
prefix= raw"C:\Users\ricca\Documents\Iurilli Lab\Experiments\SocRecog\Data";
miceList= ["1M", "2M", "3M", "4M"];
stimuli= ["Familiar", "Novel"];
reverseStimuli= ["Novel", "Familiar"];
dataM= Matrix(undef, 2,4);
for m in 1:4
mouse= miceList[m];
fname= open_dialog_native("Select file for mouse "*mouse);
d= matread(fname);
investigationTime1= d["log"]["totalInvestigationTime"]["stimulus1"];
investigationTime2= d["log"]["totalInvestigationTime"]["stimulus2"];
start= d["log"]["onsetRecording"];
finish= d["log"]["endRecording"];
duration= finish - start;
t1= round((investigationTime1/duration)*100, digits=2);
t2= round((investigationTime2/duration)*100, digits=2);
if m==1 || m==2
dataM[1,m]= t1;
dataM[2,m]= t2;
else
dataM[1,m]= t2;
dataM[2,m]= t1;
end
end
p= plot();
for i in 1:4
plot!(p, stimuli, dataM[:,i], label= miceList[i],lw=2, marker=:circle, msc=:auto, msw=2)
ylabel!("% investigation time")
end
display(p)
savefig(prefix*"\\investigationTime.png")
npokes1= d["log"]["numberOfPokes"]["stimulus1"];
npokes2= d["log"]["numberOfPokes"]["stimulus2"];
onsets1= d["log"]["onsets"]["stimulus1"];
onsets2= d["log"]["onsets"]["stimulus2"];
elapsedtime1= d["log"]["logStimuliElapsedTimes"]["stimulus_1"];
elapsedtime2= d["log"]["logStimuliElapsedTimes"]["stimulus_2"];