|
78 | 78 | % videos, not for things like "beam-break" etc. that are in the separate |
79 | 79 | % FieldType of Streams. |
80 | 80 | pars = struct; |
81 | | -pars.HasVideo = false; |
82 | | -pars.HasVidStreams = false; |
| 81 | +pars.HasVideo = true; |
| 82 | +pars.HasVidStreams = true; |
| 83 | +pars.UseVideoPromptOnEmpty = false; |
83 | 84 |
|
84 | 85 | % % % -- For Video Scoring -- % % % |
85 | 86 |
|
|
160 | 161 | % to toggle it. |
161 | 162 |
|
162 | 163 | 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'; |
165 | 166 | 'K:\Rat\Video\Audio Discrimination Task\post-surg' |
166 | 167 | }; |
167 | 168 |
|
|
172 | 173 | '*_0.MP4','First Video Only';... |
173 | 174 | '*.MP4;*.mp4;*.avi','Video Files (*.mp4,*.avi)';... |
174 | 175 | '*.*','All Files (*.*)'}; |
175 | | -pars.SelectionUITitle = 'No Videos Found - Select VIDEO associated with BLOCK'; |
176 | | - |
177 | 176 | 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" |
181 | 184 | pars.MovieIndexVar = 'MovieID'; % KUMC: "RC" (and in general) |
182 | 185 |
|
183 | 186 | % Information about video scoring |
|
197 | 200 | pars.Alignment_FS = struct('TDT',125,'RHD',100,'RHS',100); |
198 | 201 |
|
199 | 202 | %% Less-likely to change these parameters |
200 | | -% Paths information |
201 | | -pars.File = []; |
202 | | - |
203 | 203 | % Metadata parsing |
204 | 204 | pars.Delimiter = '_'; % Break filename "variables" by this |
205 | 205 | pars.IncludeChar = '$'; % Include data from these variables |
206 | 206 | pars.ExcludeChar = '~'; % Exclude data from these variables |
207 | | -pars.Meta = []; |
208 | 207 |
|
209 | 208 | pars.ValueShortcutFcn = @nigeLab.workflow.defaultVideoScoringShortcutFcn; |
210 | 209 | pars.VideoScoringStringsFcn = @nigeLab.workflow.defaultVideoScoringStrings; |
|
219 | 218 | (~isempty(pars.VidStreamName)); |
220 | 219 |
|
221 | 220 | 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 | + |
222 | 239 | n = numel(pars.VidStreamName); |
223 | 240 | if ~isempty(pars.CameraSourceVar) |
224 | 241 | pars.VidStreamField = cell(n,1); |
225 | 242 | pars.VidStreamFieldType = cell(n,1); |
226 | 243 |
|
227 | 244 | % Check that the CameraSourceVar is good |
228 | | - dyVar = cellfun(@(x)x(2:end),pars.DynamicVars,'UniformOutput',false); |
229 | 245 | idx = ismember(dyVar,pars.CameraSourceVar); |
230 | 246 | 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); |
233 | 250 | end |
234 | 251 |
|
235 | 252 | % For each Cell corresponding to a different subset of markings, |
|
0 commit comments