-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcall_spikesorter.m
88 lines (64 loc) · 2.58 KB
/
call_spikesorter.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
%Grasp project Sarah David Mac
clc
clear all
close all
%subject_id = 's4'; %GB
%subject_id = 's3'; %AN
subject_id = 's2'; %FG
subject = hst.Subject(subject_id);
%threshold session using blackrock filter. You can define the threshold
%here.
% Blackrock.thresholdSession('20230721', 's3', 'THRESHOLD', -4.5, 'noise_model', 'Blackrock')
% Blackrock.thresholdSession('20230803', 's3', 'THRESHOLD', -4.5, 'noise_model', 'Blackrock')
% Blackrock.thresholdSession('20230724', 's3', 'THRESHOLD', -4.5, 'noise_model', 'Blackrock')
Blackrock.thresholdSession('20250305', subject_id, 'THRESHOLD', -4.5, 'noise_model', 'Blackrock')
% Blackrock.thresholdSession('20230725', 's2', 'THRESHOLD', -4.5, 'noise_model', 'Blackrock')
% Blackrock.thresholdSession('20230803', 's2', 'THRESHOLD', -4.5, 'noise_model', 'Blackrock')
% Blackrock.thresholdSession('20230810', 's2', 'THRESHOLD', -4.5, 'noise_model', 'Blackrock')
%%
tasktype = {};
end_comment = {};
session_dates = {'20250305'};
taskfileTest = 2;
idxToRemove = [];
for n_session_dates= 1:length(session_dates)
session_date = session_dates{n_session_dates};
session = hst.Session(session_date, subject);
taskfiles = session.getTaskFiles('GraspObject');
for i = 1:length(taskfiles)
try
task = hst.Task(taskfiles{i});
tasktype{n_session_dates,i} = task.task.params.user.cue_type;
%end_comment{blub,i} = task.userEndComment;
end_comment{n_session_dates,i} = task.parameterName;
if size(task.trialparams,2) ~= task.numTrials
disp('probably aborted trial')
idxToRemove = [idxToRemove, i];
end
catch ME
disp('???')
idxToRemove = [idxToRemove, i];
end
end
end_comment;
end
good_blocks = setdiff(1:length(taskfiles), idxToRemove);
good_blocks
taskfiles(good_blocks)
%%
keyboard
h = SpikeSorter.GUI(fileparts(taskfiles{1}))
task = hst.Task(taskfiles{1});
n_session_dates = [session_dates' tasktype end_comment]
blub2 = 'Z:\Data\s2\20190423\PMV\20190423-144935-145018-GraspShape.mat'
%Check the endcomments to find out which sessions to combine while spike
%sorting
%end
h = SpikeSorter.GUI(fileparts(blub2))
%h = SpikeSorter.GUI(fileparts(taskfiles{1}), 'subject', 's3')
h = SpikeSorter.GUI(fileparts(taskfiles{1}));
%for new rig: seems like
session = hst.Session('20171003', 's2');
taskfiles = session.getTaskFiles('GraspShape');
task = hst.Task(taskfiles{1});
%first and second are 'good'