-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipetrack2.m
83 lines (58 loc) · 2.02 KB
/
pipetrack2.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
root ='Z:\AFdata\2p2019\Experiments\Sut1'; %% as character
ext1='.sbx'
ext2='_nidaq.mat' % make sure to have full ext... eek unideal....
ext1='.sbx'
ext2='_dsNidaq.mat' % make sure to have full ext... eek unideal....
ext1='.bhv2'
ext2='_bhv.mat'
cellDirs=pipeTrack(root,ext1,ext2)
intersect(A,B) %%% see which files need both eye.avi AND proc_eye.mat.
suite2pNeed=suite2pTrack(root,ext1, ext2);
%to check if _eye file written
ext1='_eye.mat'
ext2='_eye.avi'
%to check if FM done
ext1='_eye.avi'
ext1='.sbx'
ext2='_eye_proc.npy'
%to check cell clicked
ext1='iscell.npy'
ext2='Fall.mat'
ext1='.sbx' %%doesn't work for concatenated runs, look for presence of suite2p to satisfy suite2p
%%requirement for all .sbx files within the folder... hmm
%%how
ext2='iscell.npy'
%
ext1='.bhv2'
ext1 = '.sbx';
ext2 = '\behaviorPlots'
ext1='_eye_proc.npy'
ext2='\behaviorPlots'
eyeDirs=cellDirs
ext='Fall.mat'
ext2='Suite2p_dff.mat'
root ='Z:\AFdata\2p2019\Experiments\Sut4'
Fall2pDir=findFILE(root, ext)
suite2pDir=findFILE(root, ext2)
figure
plot(visstim)
[fullRoot,~] = cellfun(@fileparts,Fall2pDir,'UniformOutput',0);
fullRoot=fullRoot(1:19)
idcs = strfind(fullRoot,filesep);
for ii=1:length(fullRoot)
nameRoot{ii,1} = fullRoot{ii}(idcs{ii}(end-3)+1:idcs{ii}(end-2)-1);
end
eyeDirs=cellDirs(:)
time_window=20;
percentile=30;
for ii=1:length(sbxDirs) % will output a _nidaq.mat file
[nidaq,success] = alignNidaq(sbxDirs{ii}); % this took kinda awhile to run... hmm
goodfiles(ii) = success; % use this to get index position in case it fails but doesn't have matlab error message
end
for ii=1:length(sbxDirs)
dffCalc(sbxDirs{ii},percentile,time_window);
end
for ii=1:length(sbxDirs) % will output a _nidaq.mat file
[nidaq,success] = alignNidaq(sbxDirs{ii}); % this took kinda awhile to run... hmm
goodfiles(ii) = success; % use this to get index position in case it fails but doesn't have matlab error message
end