visual3d:documentation:pipeline:file_commands:export_data_to_ascii_file
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:file_commands:export_data_to_ascii_file [2024/07/16 19:28] – created sgranger | visual3d:documentation:pipeline:file_commands:export_data_to_ascii_file [2024/11/15 16:55] (current) – sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Export_Data_To_ASCII_File ====== | + | ===== Export Data To ASCII File ===== |
- | NOTE: This command | + | This pipeline |
- | The Visual3D pipeline | + | **NOTE**: This command |
- | + | ||
- | ==== Reserved Signal Names ==== | + | |
- | + | ||
- | Visual3D reserves the signal names ORIGIN, ROTATION and QUATERNION for exporting | + | |
- | + | ||
- | ==== Normalization ==== | + | |
- | + | ||
- | Data can be exported to a normalized ASCII output. The user can select | + | |
==== Pipeline Command ==== | ==== Pipeline Command ==== | ||
- | |||
- | The command parameter details follow: | ||
|**Export_Data_To_Ascii_File** | |**Export_Data_To_Ascii_File** | ||
- | |/ | + | |/ |
|/ | |/ | ||
|! / | |! / | ||
Line 44: | Line 34: | ||
|**; | |**; | ||
+ | ==== 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. | 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}} |
+ | |||
+ | ==== 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. | ||
+ | |||
+ | If you choose to normalize the data for the ASCII output, by setting the parameter **/ | ||
==== Examples ==== | ==== Examples ==== | ||
- | We have listed a few examples | + | We have listed a few examples |
- | === Example 1: File Export of multiple files === | + | === Example 1: Exporting |
Using [[# | Using [[# | ||
Line 58: | Line 55: | ||
Assuming: | Assuming: | ||
- | - the cmo file is already open | + | - the CMZ file is already open |
- you want to export data from each C3D file to a txt of the same name (or prefix). | - you want to export data from each C3D file to a txt of the same name (or prefix). | ||
- you want to be prompted to select the FOLDER for the exported files. (If you want, you can hard code this) | - you want to be prompted to select the FOLDER for the exported files. (If you want, you can hard code this) | ||
- | The Following Pipeline | + | The following pipeline |
< | < | ||
Line 112: | Line 109: | ||
</ | </ | ||
- | === Example 2: File Export of multiple files === | + | === Example 2: Exporting |
- | In this example, the output | + | In this example, the output |
- | The pipline | + | The pipeline |
< | < | ||
Line 178: | Line 175: | ||
</ | </ | ||
- | === Example 3 : Export selected ranges === | + | === Example 3 : Export selected ranges |
- | One can export ASCII data for a 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. |
- | == Option 1: Selected Range == | + | == Option 1: Exporting All Ranges |
- | Given a file with many occurrences of the range RHS it is possible to export all ranges using the command. | + | Given a file with many occurrences of the event sequence RHS+RHS it is possible to export all of these ranges using the command |
< | < | ||
Line 253: | Line 250: | ||
</ | </ | ||
- | === Example 4: Export a MODEL metric from Several CMO files === | + | === Example 4: Export a MODEL metric from several CMX files === |
- | Given a set of cmo files, open each cmo file and export one or more METRICS from the MODEL. In this example, the Pelvis segment mass will be exported into an ASCII file with the same name as the cmo file. | + | Given a set of CMZ files, |
< | < | ||
- | ! Prompt the user for the Folder containing the cmo files. In this case Sub Folders | + | ! Prompt the user for the Folder containing the CMZfiles. In this case sub-folders |
! be searched as well | ! be searched as well | ||
Set_Pipeline_Parameter_To_Folder_Path | Set_Pipeline_Parameter_To_Folder_Path | ||
Line 265: | Line 262: | ||
; | ; | ||
- | ! Set Pipeline Parameter to all cmo files in the FOLDER and SUBFOLDERS | + | ! Set Pipeline Parameter to all CMZ files in the FOLDER and SUBFOLDERS |
Set_Pipeline_Parameter_To_List_Of_Files | Set_Pipeline_Parameter_To_List_Of_Files | ||
- | / | + | / |
/ | / | ||
/ | / | ||
- | / | + | / |
; | ; | ||
- | ! Loop over all cmo files | + | ! Loop over all CMZfiles |
For_Each | For_Each | ||
/ | / | ||
- | /ITEMS=::CMO_FILES | + | /ITEMS=::CMZ_FILES |
; | ; | ||
- | ! Create a pipeline parameter containing the name of the cmo file | + | ! Create a pipeline parameter containing the name of the CMZ file |
- | ! but replace the extension .cmo with the extension .txt which | + | ! but replace the extension .cmz with the extension .txt which |
! will be used for the exported file. | ! will be used for the exported file. | ||
Set_Pipeline_Parameter | Set_Pipeline_Parameter | ||
/ | / | ||
/ | / | ||
- | / | + | / |
/ | / | ||
! / | ! / | ||
Line 291: | Line 288: | ||
; | ; | ||
- | ! Open the cmo file | + | ! Open the CMZ file |
File_Open | File_Open | ||
/ | / | ||
; | ; | ||
- | ! Assuming one model in the cmo file, store the MASS | + | ! Assuming one model in the CMZ file, store the MASS |
! of the pelvis segment in a signal in the GLOBAL Workspace | ! of the pelvis segment in a signal in the GLOBAL Workspace | ||
Evaluate_Expression | Evaluate_Expression | ||
Line 331: | Line 328: | ||
; | ; | ||
- | ! Clear the workspace in preparation for the next cmo file. | + | ! Clear the workspace in preparation for the next CMZ file. |
File_New | File_New | ||
; | ; | ||
Line 340: | Line 337: | ||
</ | </ | ||
- | === Example 5: Export Events === | + | === Example 5: Export Events |
- | This example will export | + | This example will export |
< | < | ||
Line 418: | Line 415: | ||
</ | </ | ||
- | === Example 6: Export Concatenated | + | === 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/ | All signals are exported to separate columns in the exported file. For metric signals (e.g. signals with only one or two entries/ | ||
Line 424: | Line 421: | ||
Consider a metric signal created as follows: | Consider a metric signal created as follows: | ||
- | {{ExportMetric1.jpg}} | + | {{:ExportMetric1.jpg}} |
< | < | ||
Metric_Signal_Value_At_Event | Metric_Signal_Value_At_Event | ||
Line 442: | Line 440: | ||
In the test file I used for this example, this resulted in a metric with two metric values for two signals. | In the test file I used for this example, this resulted in a metric with two metric values for two signals. | ||
- | {{ExportMetric2.jpg}} | + | {{:ExportMetric2.jpg}} |
If the signal were exported as follows: | If the signal were exported as follows: | ||
- | {{ExportMetric3.jpg}} | + | {{:ExportMetric3.jpg}} |
< | < | ||
Export_Data_To_Ascii_File | Export_Data_To_Ascii_File | ||
Line 468: | Line 466: | ||
The resulting file would contain 6 columns of data (3 for each file). | The resulting file would contain 6 columns of data (3 for each file). | ||
- | {{ExportMetric4.jpg}} | + | {{:ExportMetric4.jpg}} |
The signals could be concatenated using the following pipeline: | The signals could be concatenated using the following pipeline: | ||
Line 530: | Line 528: | ||
The last command of the above script will export to ASCII. The image below will show how it looks in the Export_to_ASCII_file command. | The last command of the above script will export to ASCII. The image below will show how it looks in the Export_to_ASCII_file command. | ||
- | {{ExportMetric5.jpg}} | + | {{:ExportMetric5.jpg}} |
The resulting output file contains: | The resulting output file contains: | ||
- | {{ExportMetric6.jpg}} | + | {{:ExportMetric6.jpg}} |
- | In very old versions of Visual3D | + | In versions of Visual3D |
- | \\ | ||
[[Visual3D: | [[Visual3D: | ||
visual3d/documentation/pipeline/file_commands/export_data_to_ascii_file.1721158110.txt.gz · Last modified: 2024/07/16 19:28 by sgranger