Skip to content
Snippets Groups Projects
Commit 5bd8fead authored by Marys Revaz's avatar Marys Revaz
Browse files

Adapt renaming of files according to computation condition

parent 59e59951
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,34 @@ for f = 1:length(filenames)
btkAppendMetaData(C3D.acq, 'PROCESSING', 'EVENT_PROCESS_METHOD_FootOff', INFO_FO);
INFO = btkMetaDataInfo(format, {datestr(now, 'yyyy-mm-dd, HH:MM:SS')});
btkAppendMetaData(C3D.acq, 'PROCESSING', 'EVENT_PROCESS_TIME_Value', INFO);
btkWriteAcquisition(C3D.acq, [C3D_path, filename]);
btkWriteAcquisition(C3D.acq, [C3D_path, filename]);
% rename files adding/updating the computation condition
% (added by Marys Franco Carvalho in February 2023)
idx_dash = strfind(filename, '-');
if length(idx_dash) == 4
if ~strcmp([C3D_path, filename], [C3D_path, filename(1:(idx_dash(3)+4)), 'E', filename(idx_dash(4):end)])
movefile([C3D_path, filename], [C3D_path, filename(1:(idx_dash(3)+4)), 'E', filename(idx_dash(4):end)]);
end
else
md = btkFindMetaData(C3D.acq, 'MANUFACTURER', 'COMPANY');
if ~isnumeric(md)
MANUFACTURER = char(md.info.values);
switch MANUFACTURER
case 'Qualisys'
label_manufacturer = 'Q';
case {'Vicon', 'Vicon Motion Systems Limited'}
label_manufacturer = 'V';
otherwise
label_manufacturer = 'N';
end
else
label_manufacturer = 'N';
end
if ~strcmp([C3D_path, filename], [C3D_path, filename(1:idx_dash(end)), label_manufacturer, 'XXXE', filename(idx_dash(end):end)])
movefile([C3D_path, filename], [C3D_path, filename(1:idx_dash(end)), label_manufacturer, 'XXXE', filename(idx_dash(end):end)]);
end
end
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment