Skip to content

Commit a77635c

Browse files
committed
Merge DiskData updates
Resolved conflicts with `feature/DiskDataChanges` after `bugfix/subsref` merge into `dev`.
2 parents 616695b + e7ed534 commit a77635c

76 files changed

Lines changed: 7363 additions & 2787 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

+nigeLab/+defaults/Block.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
pars.Delimiter 'Stream.mat'];
135135
TAG.Videos = ... % Videos: behavioral videos
136136
[pars.Delimiter '%s', ...
137-
pars.Delimiter '%g.%s']; % "Video_Left-A_0.mp4" "Video_Left-A_1.mp4"
137+
pars.Delimiter '%s.%s']; % "Video_Left-A_0.mp4" "Video_Left-A_1.mp4"
138138

139139
Fields = { ...
140140
'Raw'; % 1 - hard-coded for extraction

+nigeLab/+defaults/Event.m

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
% 'Complete'; % 16)
3434
% };
3535
pars.Name = {... % Example B (RHD)
36-
'trialrunning'; % 1) Trial running "HIGH" events
37-
'beambreak'; % 2) Beam break events
38-
'nosepoke'; % 3) Nose-poke beam break
36+
'trial-running'; % 1) Trial running "HIGH" events
37+
'beam-break'; % 2) Beam break events
38+
'nose-poke'; % 3) Nose-poke beam break
3939
'Reach'; % 4) Reach scored onset
4040
'Grasp'; % 5) Grasp scored onset
4141
'Support'; % 6) Support scored onset
@@ -138,18 +138,37 @@
138138
% 'Falling'; % 11)
139139
% 'Level'; % 12) (skip 13-16 because not 'auto' field)
140140
% };
141+
% pars.EventSource = {... % Example A (RHS)
142+
% 'Channels'; % 1) 'Stim' is associated with channels
143+
% 'Streams'; % 2)
144+
% 'Streams'; % 3)
145+
% 'Streams'; % 4)
146+
% 'Streams'; % 5)
147+
% 'Streams'; % 6)
148+
% 'Streams'; % 7)
149+
% 'Streams'; % 8)
150+
% 'Streams'; % 9)
151+
% 'Streams'; % 10)
152+
% 'Streams'; % 11)
153+
% 'Streams'; % 12) (skip 13-16 because not 'auto' field)
154+
% };
141155
pars.TrialDetectionInfo = struct(... % For sync using LED (Example B)
142156
'Field','DigIO',...
143-
'Name','trialrunning',...
157+
'Name','trial-running',...
144158
'Source',[],...
145-
'Debounce',0.250,...
146-
'Threshold',0.5,...
159+
'Debounce',0.100,...% Used in parsing other 'auto' events as well
160+
'Threshold',0.5,... % Used in parsing other 'auto' events as well
147161
'Type','Rising');
148162
pars.EventDetectionType = {... % Example B (RHD)
149163
'Rising'; % 1)
150164
'Rising'; % 2)
151165
'Rising'; % 3) (skip 4-7 because not 'auto' fields)
152166
};
167+
pars.EventSource = {...
168+
'Streams'; % 1)
169+
'Streams'; % 2)
170+
'Streams'; % 3) (skip 4-7 because not 'auto' fields)
171+
};
153172

154173
%% Error parsing (do not change)
155174
% Check that number of elements of Name matches that of Fields

+nigeLab/+defaults/Queue.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
pars.Remote.RecRoot = 'P:/Recorded_Data';
2626
pars.Remote.SaveRoot = 'P:/Processed_Data';
2727

28-
pars.ClusterList = {'CPLMJS'; 'CPLMJS2'; 'CPLMJS3'};
28+
% pars.ClusterList = {'CPLMJS';'CPLMJS2';'CPLMJS3'};
29+
pars.ClusterList = {'CPLMJS';'CPLMJS2'};
2930
pars.NWorkerMinMax = [1,1]; % Min & Max # workers to assign to a job
3031
pars.WaitTimeSec = 1; % Time to wait between checking for new cluster
3132
pars.InitTimeSec = 5; % Time to wait when initializing cluster

+nigeLab/+defaults/Video.m

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@
7878
% videos, not for things like "beam-break" etc. that are in the separate
7979
% FieldType of Streams.
8080
pars = struct;
81-
pars.HasVideo = false;
82-
pars.HasVidStreams = false;
81+
pars.HasVideo = true;
82+
pars.HasVidStreams = true;
83+
pars.UseVideoPromptOnEmpty = false;
8384

8485
% % % -- For Video Scoring -- % % %
8586

@@ -160,8 +161,8 @@
160161
% to toggle it.
161162

162163
pars.VidFilePath = { ... % "Includes" for where videos might be. Stops after first non-empty path.
163-
'K:\Rat\Video\BilateralReach\Murphy';
164-
'K:\Rat\Video\BilateralReach\RC';
164+
... 'K:\Rat\Video\BilateralReach\Murphy';
165+
... 'K:\Rat\Video\BilateralReach\RC';
165166
'K:\Rat\Video\Audio Discrimination Task\post-surg'
166167
};
167168

@@ -172,12 +173,14 @@
172173
'*_0.MP4','First Video Only';...
173174
'*.MP4;*.mp4;*.avi','Video Files (*.mp4,*.avi)';...
174175
'*.*','All Files (*.*)'};
175-
pars.SelectionUITitle = 'No Videos Found - Select VIDEO associated with BLOCK';
176-
177176
pars.FileExt = '.MP4';
178-
% For DynamicVars expressions, see 'Metadata parsing' below
179-
pars.DynamicVars = {'$AnimalID','$Year','$Month','$Day','$SessionID','$View','$MovieID'}; % KUMC: "Murphy"
180-
% pars.DynamicVars = {'$AnimalID','$Year','$Month','$Day','&MovieID'}; % KUMC: "RC"
177+
% For DynamicVars expressions, see 'Metadata parsing' below; main
178+
% difference here is that ALL variables (if there are enough tokens) are
179+
% included as metadata variables; '$' vs '~' only denotes whether to use
180+
% that particular variable in figuring out other videos belonging to a
181+
% given recording.
182+
pars.DynamicVars = {'$AnimalID','$Year','$Month','$Day','$SessionID','~View','~MovieID'}; % KUMC: "Murphy"
183+
% pars.DynamicVars = {'$AnimalID','$Year','$Month','$Day','~MovieID'}; % KUMC: "RC"
181184
pars.MovieIndexVar = 'MovieID'; % KUMC: "RC" (and in general)
182185

183186
% Information about video scoring
@@ -197,14 +200,10 @@
197200
pars.Alignment_FS = struct('TDT',125,'RHD',100,'RHS',100);
198201

199202
%% Less-likely to change these parameters
200-
% Paths information
201-
pars.File = [];
202-
203203
% Metadata parsing
204204
pars.Delimiter = '_'; % Break filename "variables" by this
205205
pars.IncludeChar = '$'; % Include data from these variables
206206
pars.ExcludeChar = '~'; % Exclude data from these variables
207-
pars.Meta = [];
208207

209208
pars.ValueShortcutFcn = @nigeLab.workflow.defaultVideoScoringShortcutFcn;
210209
pars.VideoScoringStringsFcn = @nigeLab.workflow.defaultVideoScoringStrings;
@@ -219,17 +218,35 @@
219218
(~isempty(pars.VidStreamName));
220219

221220
if pars.HasVidStreams
221+
dyVar = cellfun(@(x)x(2:end),pars.DynamicVars,'UniformOutput',false);
222+
if ismember('Key',dyVar)
223+
error(['nigeLab:' mfilename ':BadConfig'],...
224+
'[DEFAULTS/VIDEO]: Invalid use of reserved meta variable (''Key'')');
225+
end
226+
227+
% Check that the CameraSourceVar and MovieIndexVar were added to `pars`
228+
if ~isfield(pars,'CameraSourceVar')
229+
error(['nigeLab:' mfilename ':BadConfig'],...
230+
['CameraSourceVar parameter field is missing\n' ...
231+
'->\t(can be left as [] if unwanted)']);
232+
end
233+
if ~isfield(pars,'MovieIndexVar')
234+
error(['nigeLab:' mfilename ':BadConfig'],...
235+
['MovieIndexVar parameter field is missing\n' ...
236+
'->\t(can be left as [] if unwanted)']);
237+
end
238+
222239
n = numel(pars.VidStreamName);
223240
if ~isempty(pars.CameraSourceVar)
224241
pars.VidStreamField = cell(n,1);
225242
pars.VidStreamFieldType = cell(n,1);
226243

227244
% Check that the CameraSourceVar is good
228-
dyVar = cellfun(@(x)x(2:end),pars.DynamicVars,'UniformOutput',false);
229245
idx = ismember(dyVar,pars.CameraSourceVar);
230246
if sum(idx) ~= 1
231-
error('CameraSourceVar (%s) is not a member of pars.DynamicVars (%s)',...
232-
pars.CameraSourceVar,dyVar);
247+
error(['nigeLab:' mfilename ':BadConfig'],...
248+
'CameraSourceVar (%s) is not a member of pars.DynamicVars',...
249+
pars.CameraSourceVar);
233250
end
234251

235252
% For each Cell corresponding to a different subset of markings,

+nigeLab/+defaults/doActions.m

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
%% Set "dependencies" for checking that stages are valid for `doMethods`
1919
pars = struct;
2020
pars.doAutoClustering = doAction({'Spikes'},true);
21-
pars.doBehaviorSync= doAction({'Video'});
22-
pars.doEventDetection = doAction();
23-
pars.doEventHeaderExtraction = doAction({'Video'});
21+
pars.doBehaviorSync= doAction({},false,{'Raw','Video'});
22+
pars.doEventDetection = doAction({'Raw'},true);
23+
pars.doEventHeaderExtraction = doAction({},false,{'Raw','Video'});
2424
pars.doLFPExtraction = doAction({'Raw'},true);
2525
pars.doRawExtraction = doAction({},true);
2626
pars.doReReference = doAction({'Filt'},true);
2727
pars.doSD = doAction({'CAR'},true);
2828
pars.doUnitFilter = doAction({'Raw'},true);
29-
pars.doVidInfoExtraction = doAction({'Video'});
30-
pars.doVidSyncExtraction = doAction({'Video'});
29+
pars.doVidInfoExtraction = doAction({},true,{});
30+
pars.doVidSyncExtraction = doAction({},false,{'Raw','Video'});
3131

3232
%% Parse output
3333
if nargin < 1
@@ -44,7 +44,7 @@
4444
end
4545

4646
% Helper function to make `doAction` param struct
47-
function doStruct = doAction(required,en)
47+
function doStruct = doAction(required,en,to_check_on_batch_run)
4848
%DOACTION Helper function to create doAction struct
4949
%
5050
% doStruct = doAction({'field1',...,'fieldk'}); Sets required fields
@@ -58,9 +58,20 @@
5858
en = false;
5959
end
6060

61+
if nargin < 3
62+
to_check_on_batch_run = {};
63+
end
64+
65+
if ~isempty(to_check_on_batch_run) && ~isempty(required)
66+
error(['nigeLab:' mfilename ':BadConfig'],...
67+
'[DOACTIONS]: If .batch has members, .required should be empty.');
68+
end
69+
6170
doStruct = struct;
6271
doStruct.required = required;
6372
doStruct.enabled = en;
73+
doStruct.batch = to_check_on_batch_run;
74+
6475
end
6576

6677
end

0 commit comments

Comments
 (0)