-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtroubleshoot_misname.m
60 lines (56 loc) · 3.5 KB
/
troubleshoot_misname.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
%% broken files
close all
clear all
clc
tasks2BeReNamed = {'20240307-133830-133839-GraspObject', ...
'20240307-133830-134703-GraspObject', ...
'20240307-135309-135446-GraspObject', ...
'20240307-135309-140133-GraspObject', ...
'20240307-140857-140906-GraspObject', ...
'20240307-140857-141641-GraspObject'};
%% rename broken files
for ii = 1:length(tasks2BeReNamed)
tasks2BeReNamed{ii};
tempDataFile = load(['\\131.215.27.23\Raid01\Data\S4\20240307\Task\' tasks2BeReNamed{ii} '.mat']);
hDebug = Debug.Debugger('loadDataFromFramework','screen');
hArrayMPF = hst.Array('MPF', 'S4');
hArrayS1 = hst.Array('S1', 'S4');
hSubjectS4 = hst.Subject('S4', hDebug);
tempDataFile.NeuralSource.hArrayMaps{1} = hArrayMPF.hArrayMap;
tempDataFile.NeuralSource.hArrayMaps{2} = hArrayS1.hArrayMap;
tempDataFile.Options.arrays{1} = hArrayMPF;
tempDataFile.Options.arrays{2} = hArrayS1;
tempDataFile.Options.subject = hSubjectS4;
tempDataFile.Options.output = replace(tempDataFile.Options.output,'S3','S4');
tempDataFile.NeuralSource.hCBMEX.arrayString = {hArrayMPF.ID, hArrayS1.ID};
tempDataFile.NeuralSource.output = replace(tempDataFile.NeuralSource.output,'S3','S4');
tempDataFile.NeuralSource.hCBMEX.outputPath = replace(tempDataFile.NeuralSource.hCBMEX.outputPath,'S3','S4');
tempDataFile.NeuralSource.hCBMEX.recordFilenames = replace(tempDataFile.NeuralSource.hCBMEX.recordFilenames,'MPx','MPF');
tempDataFile.NeuralSource.hCBMEX.recordDirectories = replace(tempDataFile.NeuralSource.hCBMEX.recordDirectories,'MPx','MPF');
tempDataFile.NeuralSource.hCBMEX.recordFilenames = replace(tempDataFile.NeuralSource.hCBMEX.recordFilenames,'S3','S4');
tempDataFile.NeuralSource.hCBMEX.recordDirectories = replace(tempDataFile.NeuralSource.hCBMEX.recordDirectories,'S3','S4');
for tr = 1:tempDataFile.Task.nTrials
tempDataFile.Task.TrialData(tr).neu_filenames = replace(tempDataFile.Task.TrialData(tr).neu_filenames,'MPx','MPF');
end
% save
idString = tempDataFile.idString;
Runtime = tempDataFile.Runtime;
Data = tempDataFile.Data;
Options = tempDataFile.Options;
NeuralSource = tempDataFile.NeuralSource;
Sync = tempDataFile.Sync;
Task = tempDataFile.Task;
% save(['\\131.215.27.23\Raid01\Data\S4\20240206\Task\' tasks2BeReNamed{ii}], 'idString', ...
% 'Runtime', ...
% 'Data', ...
% 'Options', ...
% 'NeuralSource');
save(['\\131.215.27.23\Raid01\Data\S4\20240307\Task\' tasks2BeReNamed{ii}], 'idString', ...
'Runtime', ...
'Data', ...
'Options', ...
'NeuralSource', ...
'Sync', ...
'Task');
clear idString RunTime Data Options NeuralSource Sync Task
end