5.0

5.0 | 1 rating Rate this file 1 Download (last 30 days) File Size: 7.24 KB File ID: #23599

C3D_VaxD2PC

by Jan Simon

 

08 Apr 2009 (Updated 20 Aug 2010)

Convert C3D file from DEC (VAXD) to PC (IEEE-LE) format so that they can be read in Matlab >= 2008b.

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.8 (R2009a)
Other requirements Works under Matlab 6 and Matlab >= 2008b
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
08 Oct 2009 Jun Wang

great. how to convert PC to DEC (VAXD) format? or how to check if a c3d fils is in PC or DEC format, then I can choose to open it accordingly. thanks!

Please login to add a comment or rating.
Updates
20 Aug 2010

- Consider C3Ds with up to 65535 frames
- Find end of the parameter section for non-Vicon style

Tag Activity for this File
Tag Applied By Date/Time
c3d Jan Simon 09 Apr 2009 09:28:47
vaxd Jan Simon 09 Apr 2009 09:28:48
dec Jan Simon 09 Apr 2009 09:28:48
data import Jan Simon 09 Apr 2009 09:28:48
ieeele Jan Simon 09 Apr 2009 09:28:48
c3d Henk 24 Aug 2010 09:38:49

Contact us at files@mathworks.com