User Tools

Site Tools


visual3d:documentation:definitions:file_formats:ascii_format

ASCII Format

Visual3D reads and writes the C3D data file format developed by Andrew Dainis and Doug McGuire in 1987. The C3D formatted file is a compact binary data file used as a convenient and efficient means for storing 3D coordinate and analog data, with all associated parameters, for a single measurement trial. The C3D format is a publicly defined format and is currently implemented by most motion capture vendors. See C3D.org for a full description of the file format and its use by the biomechanics community.

Data file stored in formats other than the C3D format must be translated, either by the user or internally by Visual3D, into the C3D Format. One popular alternative format is ASCII-formatted text files. There are a wide variety of these ASCII-formatted files and Visual3D will load many of them; translating them into C3D format in the process. It is quite a challenge to read all varieties of ASCII formatted files, but we do our best to accommodate data that our users collect. If Visual3D does not import your formatted files, contact support@has-motion.ca and request that we implement your format. We recognize that the first task to analyze your data is to be able to load the files, so we try hard to make sure that users have their data.

Supported Formats

There a number of ASCII file formats that are commonly used within the biomechanics community that Visual3D can import.

Visual3D ASCII Format

The Visual3D ASCII Format is the preferred format for importing and exporting signals. Visual3D exports data into several file formats, this is the simplest and default file format.

This data file can be exported from Visual3D using Export_Data_To_ASCII_File, imported to Visual3D using Import_Data_From_ASCII_File, and exported from the report tab.

P2D Format

The P2D file format was part of the origin MOVE3D software written by Tom Kepple in Dr. Steven Stanhope’s laboratory at the United States National Institutes of Health (NIH). Visual3D was the result of the technology transfer of the MOVE3D software.

JSON Format

Signal data can be exported to JSON format (Javascript Object Notation) using the Export_Data_To_ASCII pipeline command. Data from a report graph can be exported in JSON format using the Export Data From Report Dialog option in the report tab.

FSV Format

The Import_Fsv_Files Visual3D plugin is a fairly general ASCII file format translator to C3D, that may be suitable for a variety of ASCII files. The FSV/TSV file formats were originally developed by Manfred Berger from Innovision Systems and are used by Qualisys and Innovision.

Opening an ASCII File

A Visual3D ASCII file can be opened in the Visual3D workspace directly using the FILE OPEN menu option or the FILE_OPEN command. In order for Visual3D to interpret this standalone file correctly, it is important that a signal be included specifying the time.

One of the constraints on the file import is that the first line of the signal column must match an open C3D file. This allows Visual3D to recognize which file to add the data to. For ANALOG and TARGET (POINT) data the following rules apply: If there are more frames of data in the ASCII file than there are in the C3D file, the ASCII signal is truncated. If there are fewer frames of data in the ASCII file than there are in the C3D file, the signal is padded with frames of data containing DATA_NOT_FOUND.

- C:\ExampleData\ExampleWalk.c3dC:\ExampleData\ExampleWalk.c3dFilename from which the data came.
e.g. Filename withing the Visual3D Workspace
- ANALOGTIME EMG9 Signal Name
- FRAME_NUMBERS ANALOG Signal Type
- ORIGINAL ORIGINAL Signal Folder (e.g. ORIGINAL, PROCESSED, etc.)
ITEM0 X Component. (ANALOG signals have channel 0 or channel X
1 0.01 23.0 -
2 0.02 22.5 -
3 0.03 23.0 -
4 0.04 22.0 -
5 0.05 21.0 -

Working with DERIVED Data

For DERIVED signals all rows are added to the data file within Visual3D without truncation or padding. This is partly because DERIVED signals cannot be exported to the C3D file at this point, so there is no conflict with the C3D file format.

Exporting Signals to an ASCII File

There are several methods for exporting data from Visual3D's workspace into an ASCII file.

Via the Data Tree

  1. Select one of the signals in the data tree using a click of the Left Mouse Button.
  2. A dialog appears that contains two tabs. One tab is a graph of the signal, the other tab is a list of the data values.
  3. Selecting the Export ASCII button causes a browse window to appear to save the data to a Visual3D ASCII formatted data file.

Via Pipeline Command

The Visual3D pipeline command Export_Data_To_ASCII_File exports data to one of 2 ASCII-formatted data files:

  1. Visual3D ASCII; and
  2. P2D.

The following dialog appears when the Export_Data_To_ASCII_File command is edited within the Pipeline Editor Workshop.

From a Report Dialog

Data can be exported directly from a Report graph to an ASCII-formatted text file.

  1. Select one of the graphs in the edit report dialog. A button will appear below the graph list box titled ”Export Selected”.
  2. Select this button to pop up a dialog for exporting the data from the graph to an ASCII file, either:
    1. a Visual3D ASCII formatted file; or
    2. a P2D formatted file.
  3. The options exist to save the raw data (e.g. frame by frame) or to save time normalized data (e.g. a specified number of frames) using the properties of the graph template (e.g. start frame and end frame).

The picture below shows a highlighted graph and selecting a JSON output format.

Exporting 6 Degree of Freedom Data

It is possible to export 6 degree of freedom pose data to an ASCII-format file as either an ORIGIN and QUATERNION or as an ORIGIN and 3×3 ROTATION MATRIX.

This example file contains the ORIGIN and ROTATION matrix for the RSK segment at the first 5 frames of data. Note that the elements are TAB delimited.

c:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3d
ORIGIN ORIGIN ORIGIN ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION
KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC KINETIC_KINEMATIC
LSK LSK LSK LSK LSK LSK LSK LSK LSK LSK LSK LSK
ITEMX Y Z 0 1 2 3 4 5 6 7 8
1 0.37046 0.00863 0.40545 0.96567 0.21640 -0.14375 -0.24416 0.56693 -0.78675 -0.08876 0.79483 0.60030
2 0.35441 0.05135 0.41706 0.97954 0.19208 -0.05999 -0.16101 0.56933 -0.80619 -0.12070 0.79935 0.58861
3 0.35060 0.08595 0.43204 0.99376 0.11142 0.00542 -0.06290 0.59975 -0.79771 -0.09213 0.79239 0.60301
4 0.35067 0.11824 0.44677 0.99773 0.06720 0.00507 -0.03870 0.63296 -0.77322 -0.05516 0.77126 0.63412
5 0.35359 0.14253 0.46174 0.99978 0.01001 0.01839 0.00611 0.70059 -0.71353 -0.02002 0.71349 0.70038

Or in the following format

c:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3dc:\Data\mvc002.c3d
ORIGIN ORIGIN ORIGIN ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION ROTATION
LINK_MODEL_BASED LINK_MODEL_BASED LINK_MODEL_BASED LINK_MODEL_BASED LINK_MODEL_BASED LINK_MODEL_BASED LINK_MODEL_BASED LINK_MODEL_BASED LINK_MODEL_BASED
LSK LSK LSK LSK LSK LSK LSK LSK LSK LSK LSK LSK
ITEMX Y Z 0 1 2 3 4 5 6 7 8
1 0.37046 0.00863 0.40545 0.96567 0.21640 -0.14375 -0.24416 0.56693 -0.78675 -0.08876 0.79483 0.60030
2 0.35441 0.05135 0.41706 0.97954 0.19208 -0.05999 -0.16101 0.56933 -0.80619 -0.12070 0.79935 0.58861
3 0.35060 0.08595 0.43204 0.99376 0.11142 0.00542 -0.06290 0.59975 -0.79771 -0.09213 0.79239 0.60301
4 0.35067 0.11824 0.44677 0.99773 0.06720 0.00507 -0.03870 0.63296 -0.77322 -0.05516 0.77126 0.63412
5 0.35359 0.14253 0.46174 0.99978 0.01001 0.01839 0.00611 0.70059 -0.71353 -0.02002 0.71349 0.70038

Example: Export as ORIGIN and QUATERNION

The command below will export the position and orientation of segment RFT as an ORIGIN and Quaternion.

Export_Data_To_ASCII_File
! /FILE_NAME=
/SIGNAL_TYPES=FRAME_NUMBERS+LINK_MODEL_BASED+LINK_MODEL_BASED
/SIGNAL_NAMES=TIME+ORIGIN+QUATERNION
/SIGNAL_FOLDER=ORIGINAL+RFT+RFT
! /START_LABEL=
! /END_LABEL=
! /USE_POINT_RATE=FALSE
! /NORMALIZE_DATA=FALSE
! /NORMALIZE_POINTS=101
! /EXPORT_MEAN_AND_STD_DEV=FALSE
! /USE_P2D_FORMAT=FALSE
;

Example: Export as ORIGIN and ROTATION

The command below will export the position and orientation of segment RFT as an ORIGIN and ROTATION matrix.

Export_Data_To_ASCII_File
! /FILE_NAME=
/SIGNAL_TYPES=FRAME_NUMBERS+LINK_MODEL_BASED+LINK_MODEL_BASED
/SIGNAL_NAMES=TIME+ORIGIN+ROTATION
/SIGNAL_FOLDER=ORIGINAL+RFT+RFT
! /START_LABEL=
! /END_LABEL=
! /USE_POINT_RATE=FALSE
! /NORMALIZE_DATA=FALSE
! /NORMALIZE_POINTS=101
! /EXPORT_MEAN_AND_STD_DEV=FALSE
! /USE_P2D_FORMAT=FALSE
;

NOTE: Visual3D exports the following rotation matrix:

[ XYZ local ] = [R2] [XYZ global]
visual3d/documentation/definitions/file_formats/ascii_format.txt · Last modified: by wikisysop