User Tools

Site Tools


visual3d:documentation:definitions:file_formats:ascii_format

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
visual3d:documentation:definitions:file_formats:ascii_format [2025/05/20 20:53] – WORK IN PROGRESS. wikisysopvisual3d:documentation:definitions:file_formats:ascii_format [2026/03/09 07:41] (current) – Reorganized page and removed references to hidden commands. wikisysop
Line 9: Line 9:
 There a number of ASCII file formats that are commonly used within the biomechanics community that Visual3D can import. There a number of ASCII file formats that are commonly used within the biomechanics community that Visual3D can import.
  
-==== P2D_Format ==== +==== Visual3D ASCII Format ====
- +
-The [[visual3d:documentation:definitions:file_formats:p2d_format|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) (http://pdb.cc.nih.gov). Visual3D was the result of the technology transfer of the MOVE3D software. +
- +
-==== Visual3D_ASCII_Format ====+
  
 The [[visual3d:documentation:definitions:file_formats:visual3d_ascii_format|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. The [[visual3d:documentation:definitions:file_formats:visual3d_ascii_format|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 the pipeline command [[Visual3D:Documentation:Pipeline:File_Commands:Export_Data_To_ASCII_File|Export_Data_To_ASCII_File]] 
-  * This data file can be imported to Visual3D using the pipeline command [[Visual3D:Documentation:Pipeline:File_Commands:Import_Data_From_ASCII_File|Import_Data_From_ASCII_File]] 
-  * Report data can be exported from the report tab [[#Export_Data_From_Report_Dialog|as described here]]. 
  
-==== FSV_Format ====+This data file can be exported from Visual3D using [[Visual3D:Documentation:Pipeline:File_Commands:Export_Data_To_ASCII_File|Export_Data_To_ASCII_File]], imported to Visual3D using [[Visual3D:Documentation:Pipeline:File_Commands:Import_Data_From_ASCII_File|Import_Data_From_ASCII_File]], and [[#Export_Data_From_Report_Dialog|exported from the report tab]].
  
-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.+==== P2D Format ====
  
-==== JSON_Format ====+The [[visual3d:documentation:definitions:file_formats:p2d_format|P2D file format]] was part of the origin MOVE3D software written by Tom Kepple in Dr. Steven Stanhope’s laboratory at the [[https://pdb.cc.nih.gov|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 [[visual3d:documentation:visual_3d_formating:json_formats|JSON format]] (Javascript Object Notation) using the [[visual3d:documentation:pipeline:file_commands:export_data_to_ascii_file|Export_Data_To_ASCII]] pipeline command. Data from a report graph can be exported in JSON format using the [[visual3d:documentation:visual_3d_formating:json_formats#report_graph_export|Export Data From Report Dialog]] option in the report tab. Signal data can be exported to [[visual3d:documentation:visual_3d_formating:json_formats|JSON format]] (Javascript Object Notation) using the [[visual3d:documentation:pipeline:file_commands:export_data_to_ascii_file|Export_Data_To_ASCII]] pipeline command. Data from a report graph can be exported in JSON format using the [[visual3d:documentation:visual_3d_formating:json_formats#report_graph_export|Export Data From Report Dialog]] option in the report tab.
  
-===== Opening a text file =====+==== 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.
  
-A visual3D ASCII file can be opened in the Visual3D workspace directly using the FILE OPEN menu option or the FILE_OPEN command.+===== Opening an ASCII File =====
  
-In order for Visual3D to interpret this standalone file correctly, it is important that a signal be included specifying the time.+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.c3d|C:\ExampleData\ExampleWalk.c3d|Filename from which the data came.\\ e.g. Filename withing the Visual3D Workspace| |-   |C:\ExampleData\ExampleWalk.c3d|C:\ExampleData\ExampleWalk.c3d|Filename from which the data came.\\ e.g. Filename withing the Visual3D Workspace|
Line 45: Line 44:
 |5   |0.05                          |21.0                          |-                                                                                | |5   |0.05                          |21.0                          |-                                                                                |
  
-==== Importing data from an ASCII file ====+==== Working with DERIVED Data ====
  
-Visual3D currently imports signals from an ASCII file.+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.
  
-[[Visual3D:Documentation:Pipeline:File_Commands:Import_Data_From_ASCII_File|Import_Data_From_ASCII_File]] +===== Exporting Signals to an ASCII File =====
-**/FILE_NAME=**c:\exampleData\Test Command Input Signals\testInputData.txt\\+
  
-**;** +There are several methods for exporting data from Visual3D's workspace into an ASCII file.
-Visual3D allows the importing of data to a C3D file from an ASCII file. See the description of the default ASCII file format for Visual3D.+
  
-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. NOTE: 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.+==== Via the Data Tree ====
  
-=== Import ASCII signals adds the signals to the DERIVED folder in the data tree ===+{{:DataTreeExportASCII.gif}}
  
-I would like these signals added to the ANALOG folder because I would like to export the c3d file with all of the data combined.==== There are two flavours of importing signals from an ASCII file. The first uses the import ASCII signals command in the pipeline. This is a legacy command that is used to import signals that have been processed by an external executable (e.g. matlab). These data are always imported as DERIVED signalsThe second uses custom import commands to merge the ANALGO signals with the Motion Capture signals. There are many varieties of file formats that can be imported, but ASCII files are pretty fragile (meaning they can cause system crashes quite easily). If you have signals that you need merged, please contact support@c-motion.com to confirm that your files can be imported. If not, we usually write new filters for importing data at no cost to our customers.+  - Select one of the signals in the data tree using a click of the Left Mouse Button. 
 +  - 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. 
 +  - Selecting the Export ASCII button causes a browse window to appear to save the data to a Visual3D ASCII formatted data file.
  
-==== Export Signals to an ASCII file Using Data Tree ====+==== Via Pipeline Command ====
  
-{{:DataTreeExportASCII.gif}}\\ +The Visual3D pipeline command [[Visual3D:Documentation:Pipeline:File_Commands:Export_Data_To_ASCII_File|Export_Data_To_ASCII_File]] exports data to one of 2 ASCII-formatted data files: 
-Select one of the signals in the data tree using a click of the Left Mouse Button. 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.+  - Visual3D ASCII; and 
 +  - P2D.
  
-Selecting the Export ASCII button causes a browse window to appear to save the data to a Visual3D ASCII formatted data file. +The following dialog appears when the Export_Data_To_ASCII_File command is edited within the [[visual3d:tutorials:pipeline:advanced_pipeline_commands#pipeline_editor|Pipeline Editor Workshop]].
- +
-== Pipeline Command for Exporting Signals to an ASCII File == +
- +
-The Visual3D pipeline command exports ASCII data to one of 2 formatted data files (Visual3D default and P2D). +
- +
-For Example: +
- +
-|**[[Visual3D:Documentation:Pipeline:File_Commands:Export_Data_To_ASCII_File|Export_Data_To_ASCII_File]]**|                                                                                                                                                  | +
-|/SIGNAL_TYPES=ANALOG                                                                                     |Signal Type                                                                                                                                       | +
-|! /SIGNAL_FOLDER=ORIGINAL                                                                                |Signal Folder                                                                                                                                     | +
-|/SIGNAL_NAMES=EMG8                                                                                       |Signal Names                                                                                                                                      | +
-|/FILE_NAME=C:\demo files\Example1\test.txt                                                               |The filename (Including Path) for the exported data                                                                                               | +
-|! /SIGNAL_COMPONENTS=                                                                                    |Signal Component. This is a legacy parameter, if using version 5 or later, please use COMPONENT_SEQUENCE.                                         | +
-|/COMPONENT_SEQUENCE=X                                                                                    |Signal Component                                                                                                                                  | +
-|! /SIGNAL_PRECISION=                                                                                     |Indicates the number of decimal places                                                                                                            | +
-|! /START_LABEL=                                                                                          |Event Label indicating the first frame of data to be exported. This is a legacy parameter, if using version 4 or later, please use EVENT_SEQUENCE.| +
-|! /END_LABEL=                                                                                            |Event Label indicating the last frame of data to be exported. This is a legacy parameter, if using version 4 or later, please use EVENT_SEQUENCE. | +
-|! /EVENT_SEQUENCE=                                                                                       |Event sequence the signals should be exported between (ex. LHS+LHS,RHS+RHS)                                                                       | +
-|! /EXCLUDE_EVENTS=                                                                                       |If an event sequence contains one of the events listed in this parameter (ex. BAD,BAD) the event sequence will not be exported.                   | +
-|! /USE_POINT_RATE=FALSE                                                                                  |ANALOG signals can be exported at either the ANALOG rate or the POINT rate                                                                        | +
-|! /NORMALIZE_DATA=FALSE                                                                                  |Option to Time Normalize the data                                                                                                                 | +
-|! /NORMALIZE_POINTS=101                                                                                  |Number of Output Points from the Time Normalization                                                                                               | +
-|! /EXPORT_MEAN_AND_STD_DEV=FALSE                                                                         |Option to Export the Mean and Standard Deviation                                                                                                  | +
-|! /USE_P2D_FORMAT=FALSE                                                                                  |See the Description of P2D Files in the documentation.                                                                                            | +
-|! /USE_XML_FORMAT=FALSE                                                                                  |                                                                                                                                                  | +
-|! /USE_JSON_FORMAT=FALSE                                                                                                                                                                                                                                  | +
-|! /USE_SHORT_FILENAME=FALSE                                                                              |The file path for each C3D file will not be exported when set to TRUE                                                                             | +
-|! /EXPORT_EMPTY_SIGNALS=FALSE                                                                            |                                                                                                                                                  | +
-|! /EXPORT_WITHOUT_HEADER=FALSE                                                                           |The headers (FILENAME, SIGNAL TYPE, SIGNAL FOLDER, SIGNAL NAME, SIGNAL COMPONENT) will not be exported when set to TRUE.                          | +
-|**;**                                                                                                    |                                                                                                                                                  | +
- +
-The following dialog appears when the EXPORT_DATA_TO_ASCII_FILE command has been added to the pipeline and the user double-clicks with the Left Mouse Button on the command.+
  
 {{:exportascii.png}} {{:exportascii.png}}
  
-\\ 
  
 +==== From a Report Dialog ====
  
-==== Export Data From Report Dialog ==== +Data can be exported directly from a [[visual3d:documentation:reports:reports_overview|Report graph]] to an ASCII-formatted text file. 
- +  Select one of the graphs in the edit report dialog. A button will appear below the graph list box titled ”Export Selected”. 
-Select one of the graphs in the edit report dialog. A button will appear below the graph list box titled ”Export Selected”. Selecting this button will pop up a dialog for exporting the data from the graph to an ASCII fileeither a Visual3D ASCII formatted file or a P2D formatted file. 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).+  - Select this button to pop up a dialog for exporting the data from the graph to an ASCII fileeither
 +    - a Visual3D ASCII formatted fileor 
 +    - a P2D formatted file. 
 +  - 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 [[Visual3D:Documentation:Visual_3D_Formating:JSON_Formats|JSON output format]]. The picture below shows a highlighted graph and selecting a [[Visual3D:Documentation:Visual_3D_Formating:JSON_Formats|JSON output format]].
Line 113: Line 84:
 {{:exportreport.png}} {{:exportreport.png}}
  
-==== Export 6 degree of freedom data ==== +===== Exporting Degree of Freedom Data =====
- +
-It is possible to export degree of freedom data to an ASCII format as either an ORIGIN and QUATERNION or as an ORIGIN and 3x3 ROTATION MATRIX. +
- +
-Exporting the position and orientation of segment RFT as an ORIGIN and Quaternion +
- +
-\\ +
- +
- +
-[[Visual3D:Documentation:Pipeline:File_Commands:Export_Data_To_ASCII_File|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 +
-+
- +
-\\ +
-Exporting the position and orientation of segment RFT as an ORIGIN and ROTATION matrix. Visual3D exports the following rotation matrix +
- +
-[[Visual3D:Documentation:Kinematics_and_Kinetics:Six_Degrees_of_Freedom#6_DOF_Tracking|[ XYZ local ] = [R2] [XYZ global]]] +
- +
-\\ +
- +
- +
-[[Visual3D:Documentation:Pipeline:File_Commands:Export_Data_To_ASCII_File|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 +
-;+
  
-=== DOF ASCII FORMAT ===+It is possible to export [[visual3d:documentation:kinematics_and_kinetics:six_degrees_of_freedom|degree of freedom]] pose data to an ASCII-format file as either an ORIGIN and QUATERNION or as an ORIGIN and 3x3 ROTATION MATRIX.
  
 This example file contains the ORIGIN and ROTATION matrix for the [[Visual3D:Documentation:Modeling:Segments:Segment_Overview#Default_Segment_Names|RSK segment]] at the first 5 frames of data. Note that the elements are TAB delimited. This example file contains the ORIGIN and ROTATION matrix for the [[Visual3D:Documentation:Modeling:Segments:Segment_Overview#Default_Segment_Names|RSK segment]] at the first 5 frames of data. Note that the elements are TAB delimited.
Line 188: Line 116:
 |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           | |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           |
  
-==== Other ASCII Formats ====+==== Example: Export as ORIGIN and QUATERNION ====
  
-The following ASCII commands read slightly different flavors of ASCII signals. The names are derived from the customers that have requested the importer. If C-Motion provided you with information on the command, you can make the call using the command name you were givin; even though you may not see the command listed in the pipeline.+The command below will export the position and orientation of segment RFT as an ORIGIN and Quaternion.
  
-\\ +<code> 
-**Import_Frappier_Analog_Signals**\\ +Export_Data_To_ASCII_File 
-**Import_NTNU_AnalogSignals**\\ +! /FILE_NAME= 
-**Import_Cresswell_AnalogSignals**\\ +/SIGNAL_TYPES=FRAME_NUMBERS+LINK_MODEL_BASED+LINK_MODEL_BASED 
-**Import_Natick_AnalogSignals**+/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 
 +
 +</code>
  
-\\ +==== Example: Export as ORIGIN and ROTATION ====
-This command was written for Frappier Acceleration products but has been modified to accomodate many different flavors of ASCII files from our customers. The command has several aliases as you can see from the list. As of Visual3D Version 3.20, all of these commands are hidden in the pipeline, until we have a convenient way in our licensing scheme to make it visible only to a specific user with a specific name. Each command is slightly different, but the differences are recognized automatically. This may not alway be the case, so we have given each lab their own command name, that would allow us to modify the processing if necesary.+
  
-The name of the ASCII file containing the ANALOG signals is expected to have the same name as the C3D file; eg. trial1.c3d and trial1.anc+The command below will export the position and orientation of segment RFT as an ORIGIN and ROTATION matrix
  
-The basic format of the file is: +<code> 
- +Export_Data_To_ASCII_File 
-\\ +! /FILE_NAME= 
- +/SIGNAL_TYPES=FRAME_NUMBERS+LINK_MODEL_BASED+LINK_MODEL_BASED 
- +/SIGNAL_NAMES=TIME+ORIGIN+ROTATION 
-|File_Type: |Analog              |    |    |    |    | +/SIGNAL_FOLDER=ORIGINAL+RFT+RFT 
-|Board_Type:|PCI-MIO-64E|          |    |    |    |    | +! /START_LABEL= 
-|Trial_Name:|Test       |#Channels:|6      |    |    | +! /END_LABEL= 
-|Name       |Fx1        |Fy1       |Fz1 |Mx1 |My1 |Mz1 | +! /USE_POINT_RATE=FALSE 
-|Rate       |1000       |1000      |1000|1000|1000|1000| +! /NORMALIZE_DATA=FALSE 
-|0.000      |1003       |997       |1009|1009|1006|1023| +! /NORMALIZE_POINTS=101 
-|0.001      |1003       |997       |1009|1009|1006|1023| +! /EXPORT_MEAN_AND_STD_DEV=FALSE 
- +! /USE_P2D_FORMAT=FALSE 
-[[ +; 
- +</code>
-==== Example ====+
  
-Specifying a ROOT FOLDER and a list of subject folders. Each subject folder contains a set of C3D files. For example, +**NOTE**: Visual3D exports the following rotation matrix:
-Subject1 +
-Trial16.c3d +
-Subject2 +
-Trial16.c3d +
-Subject3 +
-Trial16.c3d +
-And so on ... +
-Open each C3D file and export a signal to a filename whose prefix is the same as the C3D file.+
  
 +<code>
 +[ XYZ local ] = [R2] [XYZ global]
 +</code>
  
visual3d/documentation/definitions/file_formats/ascii_format.1747774412.txt.gz · Last modified: by wikisysop