The attached file labeled markers.xml is the file I am using for the Opensim model leg6dof9musc.
In Vicon, I detached the markers I didnt need (the right leg markers) for this new model. However, the .trc file is showing 18 markers. It should show on 12. The extra markers in the .trc file are as follows:
LHJC
RHJC
LKJC
RKJC
LAJC
RAJC
In order for Opensim to take this .trc it must only contain 12 to match the markers.xml file.
How do you suggest I delete the extra markers in the .trc file?
These markers do not show up in VICON so I really dont know why they are appearing in the .trc file.
Thank you kindly,
.trc file editing
- Christine Dailey
- Posts: 17
- Joined: Fri Feb 09, 2018 6:55 am
.trc file editing
- Attachments
-
- markers.xml
- (8.42 KiB) Downloaded 13 times
Re: .trc file editing
That is not correct. There can be any number of markers in a trc file. What matters is the markerset you have on the model reflects (at least) a sub-set of markers in the trc file. If you collected markers for both legs, but your model is only a single leg, you can still use a trc file with all the markers- just track the markers that you care about.In order for Opensim to take this .trc it must only contain 12 to match the markers.xml file.
- Christa Wille
- Posts: 1
- Joined: Tue May 30, 2017 11:11 am
Re: .trc file editing
Hi Christine,
Thanks for starting this thread. I am also trying to delete virtual markers from a .trc file. I was able to do it using the code below but now I am having issues writing to a .trc file again (error attached as image). Per this link (https://github.com/opensim-org/opensim-core/issues/2262) I don't think my metadata is being saved in the matlab struct but I'm unsure how to call that specifically. Were you able to resolve your issue a different way Christine?
Thanks,
Christa
% Read files into memory as an opensim table
trcOpenSimTable = TRCFileAdapter().read(path2file);
% Convert to a Matlab Struct that is easier to work with
trcStruct = osimTableToStruct(trcOpenSimTable);
% Delete additional virtual markers using rmfield https://www.mathworks.com/matlabcentral ... -structure
trcStruct = rmfield(trcStruct,'vRHJC');
%% Convert Structs back into OpenSim table
newTable = osimTableFromStruct(trcStruct);
% Write back to file
TRCFileAdapter().write(newTable,filepath)
Thanks for starting this thread. I am also trying to delete virtual markers from a .trc file. I was able to do it using the code below but now I am having issues writing to a .trc file again (error attached as image). Per this link (https://github.com/opensim-org/opensim-core/issues/2262) I don't think my metadata is being saved in the matlab struct but I'm unsure how to call that specifically. Were you able to resolve your issue a different way Christine?
Thanks,
Christa
% Read files into memory as an opensim table
trcOpenSimTable = TRCFileAdapter().read(path2file);
% Convert to a Matlab Struct that is easier to work with
trcStruct = osimTableToStruct(trcOpenSimTable);
% Delete additional virtual markers using rmfield https://www.mathworks.com/matlabcentral ... -structure
trcStruct = rmfield(trcStruct,'vRHJC');
%% Convert Structs back into OpenSim table
newTable = osimTableFromStruct(trcStruct);
% Write back to file
TRCFileAdapter().write(newTable,filepath)
- Attachments
-
- Screen Shot 2018-10-25 at 9.09.04 PM.png (120.49 KiB) Viewed 351 times