Convert the numerical format of C3Ds from VaxD ("Dec") to IEEE-LE ("PC")
C3D is a file format commonly used in biomechanics and motion analysis. Floating point numbers can be stored in 3 different ways in C3D files: VAX-D, IEEE-LE and IEEE-BE (Vicon calls them DEC, PC and MIPS). Several Matlab routines to read C3D files can be found in the WWW, but unfortunately Matlab >= 2008b (v7.7) does not open files in VAX-D format anymore.
This function converts C3D files written from VAX-D to IEEE-LE files (PC style) and works under Matlab 6 and 7. This function does not import the contents of the C3D files to Matlab!
Calling:
VAXD = C3D_VaxD2PC(Mode, FileSpec)
Depending on the input [Mode] the files are only checked or converted. In addition either a single file or all files in a folder and all subfolders can be processed.
Backups of the VAX-D files are created as "<FileName>.c3d.vaxd" during the conversion. The original file is patched by changing the binary representation of all float32 numbers. Integers do not need a conversion and double64 numbers do not appear in C3D files.
Example 1: Check all C3D files in the current folder and subfolders:
VAXDFiles = C3D_VaxD2PC('CheckFolder', cd);
Example 2: Convert one file (insert a file name):
isVAXD = C3D_VaxD2PC('ConvertFile', <AC3DFileName>);
The function has been tested with Vicon-C3Ds only. Please feel free to contact me on problems.
WARNING AND DISCLAIMER OF WARRANTY:
Although no error appeared during the tests of this function, touching the expensive measurement files must be performed with care! Create a backup of all accessed files before!
Tested: Matlab 6.5 and 2009a.
引用格式
Jan (2024). C3D_VaxD2PC (https://www.mathworks.com/matlabcentral/fileexchange/23599-c3d_vaxd2pc), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!