User Tools

Site Tools


visual3d:documentation:pipeline:file_commands:export_data_to_ascii_file

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:file_commands:export_data_to_ascii_file [2024/11/15 16:55] sgrangervisual3d:documentation:pipeline:file_commands:export_data_to_ascii_file [2025/06/09 21:27] (current) wikisysop
Line 1: Line 1:
-===== Export Data To ASCII File =====+====== Export Data To ASCII File ====== 
 + 
 +===== Overview =====
  
 This pipeline command converts data from the [[visual3d:documentation:visual3d_signal_types:data_tree|Data Tree]] into ASCII (plain text) data in one of 2 formatted data files ([[visual3d:documentation:definitions:file_formats:visual3d_ascii_format|Visual3D ASCII]] and [[visual3d:documentation:definitions:file_formats:p2d_format|P2D]]) and saves the result to disk. This pipeline command converts data from the [[visual3d:documentation:visual3d_signal_types:data_tree|Data Tree]] into ASCII (plain text) data in one of 2 formatted data files ([[visual3d:documentation:definitions:file_formats:visual3d_ascii_format|Visual3D ASCII]] and [[visual3d:documentation:definitions:file_formats:p2d_format|P2D]]) and saves the result to disk.
Line 5: Line 7:
 **NOTE**: This command pulls data from the [[visual3d:documentation:definitions:active_files|active files]] in the workspace. Make sure you have set the correct files to be active using the graphical interface or the [[visual3d:documentation:pipeline:file_commands:select_active_file|Select_Active_File]] pipeline command. **NOTE**: This command pulls data from the [[visual3d:documentation:definitions:active_files|active files]] in the workspace. Make sure you have set the correct files to be active using the graphical interface or the [[visual3d:documentation:pipeline:file_commands:select_active_file|Select_Active_File]] pipeline command.
  
-==== Pipeline Command ====+===== Pipeline Command =====
  
-|**Export_Data_To_Ascii_File**              |                                                                                                                                                  | +The command below is as seen on the Visual3D applicationit has many parameters as there are options to manipulate this command.
-|/FILE_NAME=C:\demo files\Example1\test.txt |The filename (Including path) for the exported data                                                                                               | +
-|/SIGNAL_TYPES=ANALOG                       |Signal Type                                                                                                                                       | +
-|! /SIGNAL_FOLDER=ORIGINAL                  |Signal Folder                                                                                                                                     | +
-|/SIGNAL_NAMES=EMG8                         |Signal Names                                                                                                                                      | +
-|! /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 parameterif 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 (exBAD,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                                                                                                  | +
-|! /EXPORT_MEAN_AND_STD_DEV_FOR_METRIC=FALSE|Option to Export the Mean and Standard Deviation for Metric signals                                                                               | +
-|! /USE_P2D_FORMAT=FALSE                    |See the Description of P2D Files in the documentation.                                                                                            | +
-|! /USE_XML_FORMAT=FALSE                    |                                                                                                                                                  | +
-|! /USE_JSON_FORMAT=FALSE                   |See the description on [[Visual3D:Documentation:Visual_3D_Formating:JSON_Formats|JSON Formats]] in the documentation.                             | +
-|! /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.                          | +
-|! /EXPORT_NAN=FALSE                        |export NAN to represent NO_DATA                                                                                                                   | +
-|! /USE_SCIENTIFIC_NOTATION=FALSE                                                                                                                                                            | +
-|**;**                                      |                                                                                                                                                  |+
  
-==== Dialog ==== +<code> 
-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.+Export_Data_To_Ascii_File 
 +!/FILE_NAME= 
 +/SIGNAL_TYPES= 
 +!/SIGNAL_FOLDER=ORIGINAL 
 +!/SIGNAL_NAMES= 
 +!/SIGNAL_COMPONENTS= 
 +!/COMPONENT_SEQUENCE= 
 +!/SIGNAL_PRECISION= 
 +!/EVENT_SEQUENCE
 +!/EXCLUDE_EVENTS= 
 +!/USE_POINT_RATE=FALSE 
 +!/NORMALIZE_DATA=FALSE 
 +!/NORMALIZE_POINTS=101 
 +!/EXPORT_MEAN_AND_STD_DEV=FALSE 
 +!/EXPORT_MEAN_AND_STD_DEV_FOR_METRIC=FALSE 
 +!/USE_P2D_FORMAT=FALSE 
 +!/USE_XML_FORMAT=FALSE 
 +!/USE_JSON_FORMAT=FALSE 
 +!/USE_SHORT_FILENAME=FALSE 
 +!/INCLUDE_TAGS_FOR_XML=FALSE 
 +!/EXPORT_EMPTY_SIGNALS=FALSE 
 +!/EXPORT_WITHOUT_HEADER=FALSE 
 +!/EXPORT_COMPONENT_AS_TEXT=FALSE 
 +!/EXPORT_NAN=FALSE 
 +!/CREATE_FOLDER_PATH=TRUE 
 +!/USE_SCIENTIFIC_NOTATION=FALSE 
 +
 +</code>
  
-{{:exportascii.png}} +**Note:** 
- +
-==== Important Notes ====+
  
 Visual3D reserves the signal names ORIGIN, ROTATION and QUATERNION for exporting the pose of a segment. Do not use these names for any signal definition other than the RESERVED intention. Visual3D reserves the signal names ORIGIN, ROTATION and QUATERNION for exporting the pose of a segment. Do not use these names for any signal definition other than the RESERVED intention.
Line 45: Line 47:
 If you choose to normalize the data for the ASCII output, by setting the parameter **/NORMALIZE_DATA= TRUE**, then the number of points to output is specified by the **/NORMALIZE_POINTS** parameter (with a default of 101 points) and the signal will be interpolated using a cubic spline. If you choose to normalize the data for the ASCII output, by setting the parameter **/NORMALIZE_DATA= TRUE**, then the number of points to output is specified by the **/NORMALIZE_POINTS** parameter (with a default of 101 points) and the signal will be interpolated using a cubic spline.
  
-==== Examples ====+===== Command Parameters ===== 
 + 
 +The following table shows the command parameters and descriptions: 
 + 
 +|**Parameter**              |**Description**                                                                                                                                                  | 
 +|**/FILE_NAME=C:\demo files\Example1\test.txt** |The filename (Including path) for the exported data                                                                                               | 
 +|**/SIGNAL_TYPES=ANALOG**                       |Signal Type                                                                                                                                       | 
 +|**! /SIGNAL_FOLDER=ORIGINAL**                  |Signal Folder                                                                                                                                     | 
 +|**/SIGNAL_NAMES=EMG8**                         |Signal Names                                                                                                                                      | 
 +|**! /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                                                                                                  | 
 +|**! /EXPORT_MEAN_AND_STD_DEV_FOR_METRIC=FALSE**|Option to Export the Mean and Standard Deviation for Metric signals                                                                               | 
 +|**! /USE_P2D_FORMAT=FALSE**                    |See the Description of P2D Files in the documentation.                                                                                            | 
 +|**! /USE_XML_FORMAT=FALSE**                    |                                                                                                                                                  | 
 +|**! /USE_JSON_FORMAT=FALSE**                   |See the description on [[Visual3D:Documentation:Visual_3D_Formating:JSON_Formats|JSON Formats]] in the documentation.                             | 
 +|**! /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.                          | 
 +|**! /EXPORT_NAN=FALSE**                        |export NAN to represent NO_DATA                                                                                                                   | 
 +|**! /USE_SCIENTIFIC_NOTATION=FALSE**                                                                                                                                                            | 
 + 
 + 
 +===== Dialog ===== 
 + 
 +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}} 
 + 
 +===== Examples =====
  
 We have listed a few examples of how this pipeline command can be used. We have listed a few examples of how this pipeline command can be used.
  
-=== Example 1: Exporting multiple files ===+==== Example 1: Exporting multiple files ====
  
 Using [[#Export_Data_to_ASCII_File|Export_Data_to_ASCII_File]] to export data from individual C3D files to unique text files. Using [[#Export_Data_to_ASCII_File|Export_Data_to_ASCII_File]] to export data from individual C3D files to unique text files.
Line 89: Line 128:
   Export_Data_To_Ascii_File    Export_Data_To_Ascii_File 
   /FILE_NAME=::FOLDER&::INDEX&.txt    /FILE_NAME=::FOLDER&::INDEX&.txt 
-  /SIGNAL_TYPES=LINK_MODEL_BASED+LINK_MODEL_BASED+LINK_MODEL_BASED+LINK_MODEL_BASED+LINK_MODEL_BASED+LINK_MODEL_BASED+LINK_MODEL_BASED+LINK_MODEL_BASED  +  /SIGNAL_TYPES=LINK_MODEL_BASED= 
-  /SIGNAL_NAMES=RKNEE_ANGLE+RKNEE_MOMENT+RKNEE_MOMENT+RHIP_ANGLE+RHIP_MOMENT+RHIP_MOMENT+RANKLE_ANGLE+RANKLE_MOMENT +/SIGNAL_NAMES=RKNEE_ANGLE+RKNEE_MOMENT+RKNEE_MOMENT+RHIP_ANGLE+RHIP_MOMENT+RHIP_MOMENT+RANKLE_ANGLE+RANKLE_MOMENT 
   /SIGNAL_FOLDER=PROCESSED    /SIGNAL_FOLDER=PROCESSED 
   /SIGNAL_COMPONENTS=X,X,X,X,X,X,X,   /SIGNAL_COMPONENTS=X,X,X,X,X,X,X,
Line 109: Line 148:
 </code> </code>
  
-=== Example 2: Exporting multiple files with extension update ===+==== Example 2: Exporting multiple files with extension update ====
  
 In this example, the output files' names will be changed by concatenating the C3D filename with a .txt extension. This is done with the [[Visual3D:Documentation:Pipeline:Pipeline_Commands:Set_Pipeline_Parameter|Set_Pipeline_Parameter]] command that will search and replace the extension. The exported data in this example is between two events and is normalized. In this example, the output files' names will be changed by concatenating the C3D filename with a .txt extension. This is done with the [[Visual3D:Documentation:Pipeline:Pipeline_Commands:Set_Pipeline_Parameter|Set_Pipeline_Parameter]] command that will search and replace the extension. The exported data in this example is between two events and is normalized.
Line 175: Line 214:
 </code> </code>
  
-=== Example 3 : Export selected ranges from files ===+==== Example 3 : Export selected ranges from files ====
  
 One can export ASCII data for selected ranges. In this example, there are two options for accomplishing this task. One can export ASCII data for selected ranges. In this example, there are two options for accomplishing this task.
Line 250: Line 289:
 </code> </code>
  
-=== Example 4: Export a MODEL metric from several CMX files ===+==== Example 4: Export a MODEL metric from several CMX files ====
  
 Given a set of CMZ files, we will open each CMZ file and export one or more METRICS from the MODEL. In this example, the Pelvis segment's mass will be exported into an ASCII file with the same name as the CMZ file. Given a set of CMZ files, we will open each CMZ file and export one or more METRICS from the MODEL. In this example, the Pelvis segment's mass will be exported into an ASCII file with the same name as the CMZ file.
Line 337: Line 376:
 </code> </code>
  
-=== Example 5: Export Events from Files ===+==== Example 5: Export Events from Files ====
  
 This example will export all Event occurrences in terms of frame numbers to ASCII. In this example the events are labeled LHS1, LHS2, LHS3, RHS1, RHS2 and were created using the Number_Events_Sequentially.v3m meta-command. This example will export all Event occurrences in terms of frame numbers to ASCII. In this example the events are labeled LHS1, LHS2, LHS3, RHS1, RHS2 and were created using the Number_Events_Sequentially.v3m meta-command.
Line 415: Line 454:
 </code> </code>
  
-=== Example 6: Export Concatenated Signals ===+==== Example 6: Export Concatenated Signals ====
  
 All signals are exported to separate columns in the exported file. For metric signals (e.g. signals with only one or two entries/frames) this can be inconvenient. It is not possible to concatenate the signals in the command, but it is possible to concatenate the signals explicitly before export. All signals are exported to separate columns in the exported file. For metric signals (e.g. signals with only one or two entries/frames) this can be inconvenient. It is not possible to concatenate the signals in the command, but it is possible to concatenate the signals explicitly before export.
Line 532: Line 571:
  
 {{:ExportMetric6.jpg}} \\ {{:ExportMetric6.jpg}} \\
-In very versions of Visual3D prior to version 5, the Merge_Data command did not provide this functionality, so a workaround was required. [[https://www.has-motion.com/download/examples/Concatenate_OLD.v3s|This script]] provides a workaround for very old versions of Visual3D. +In versions of Visual3D prior to version 5, the Merge_Data command did not provide this functionality, so a workaround was required. [[https://www.has-motion.com/download/examples/Concatenate_OLD.v3s|This script]] provides a workaround for very old versions of Visual3D. 
 +----
 [[Visual3D:Documentation:Pipeline:General_Information:Pipeline_Commands_Reference|Back to Pipeline Commands Reference]] [[Visual3D:Documentation:Pipeline:General_Information:Pipeline_Commands_Reference|Back to Pipeline Commands Reference]]
  
  
  
visual3d/documentation/pipeline/file_commands/export_data_to_ascii_file.1731689705.txt.gz · Last modified: 2024/11/15 16:55 by sgranger