User Tools

Site Tools


visual3d:documentation:pipeline:file_commands:import_signals_from_c3d_file

Import Signals From C3D File

This command imports signals from a C3D file into the active file.

NOTE: This command can also apply to other file formats that are opened as C3D files within Visual3D's workspace. Notably this includes MVNX files.

Pipeline Command

The command can be found in the Pipeline Workshop within the File Open/Import folder as so:

Import_Signals_From_C3D_File
! /FILE_NAME=
! /IMPORT_FILE_NAME=
! /REPLACE_EXISTING_SIGNALS=FALSE
! /SYNCH_OFFSET=
! /IMPORT_ANALOG_SYNCH=
! /IMPORT_ANALOG_THRESHOLD=0.0
! /IMPORT_ANALOG_ASCENDING=TRUE
! /ANALOG_RATE=
! /ANALOG_RATIO=
! /ALLOW_RESAMPLE=FALSE
! /INTERPOLATION_METHOD=CUBIC_SPLINE
! /IMPORT_AS_DERIVED=FALSE
! /DERIVED_FOLDER=EMG
! /IMPORT_FORCE_PLATFORM_PARAMETERS=FALSE
! /ADD_PREFIX_TO_IMPORT=
;

Command Parameters

The following table shows the command parameters seen above and their descriptions:

Parameter Description
! /FILE_NAME=Name of your file
! /IMPORT_FILE_NAME=Name of your file
! /REPLACE_EXISTING_SIGNALS=Override existing signals with same name
! /SYNCH_OFFSET=Assumed to be analog signals
! /IMPORT_ANALOG_SYNCH=Only ANALOG and ROTATION signals can be imported.
! /IMPORT_ANALOG_THRESHOLD=0.0
! /IMPORT_ANALOG_ASCENDING=True
! /ANALOG_RATE=If analog signals already exist in the c3d file, and the imported analog signals are at a different sampling rate, these new signals must be imported as DERIVED signals.
! /ANALOG_RATIO=
! /ALLOW_RESAMPLE==Allow to resample the sampling rate
! /INTERPOLATION_METHOD=CUBIC_SPLINE
! /IMPORT_AS_DERIVED=If sampling rate is different, this should be TRUE
! /DERIVED_FOLDER=Location of derived folder
! /IMPORT_FORCE_PLATFORM_PARAMETERS=If force platform is used, import here
! /ADD_PREFIX_TO_IMPORT=

Examples

Example: Bring EMG signals into a file with existing Analog data

This example brings EMG signals into a file that already contains analog signals from force platforms. Because a C3D file can only have one ANALOG rate, the imported signals are brought in as DERIVED signals.

Import_Signals_From_C3D_File
/FILE_NAME=<Destination File>
/IMPORT_FILE_NAME=<EMG Data File>
! /REPLACE_EXISTING_SIGNALS=FALSE
! /SYNCH_OFFSET=
! /IMPORT_ANALOG_SYNCH=
/IMPORT_ANALOG_THRESHOLD=0.0
! /IMPORT_ANALOG_ASCENDING=TRUE
! /ANALOG_RATE=
! /ANALOG_RATIO=
! /ALLOW_RESAMPLE=FALSE
! /INTERPOLATION_METHOD=CUBIC_SPLINE
/IMPORT_AS_DERIVED=TRUE
! /DERIVED_FOLDER=EMG
! /IMPORT_FORCE_PLATFORM_PARAMETERS=FALSE
! /IMPORT_EVENT_LABELS=FALSE
! /ADD_PREFIX_TO_IMPORT=
;

Example: Bring IMU Data into Motion Capture File

This example assumes that a number of C3D motion captures files exist in a folder with matching MVNX files containing synchronized IMU data. We will use the Import_Signals_From_C3D_File command to bring the IMU data into our C3D files.

! Specify the root folder
Set_Pipeline_Parameter_To_Folder_Path
/PARAMETER_NAME=ROOTFOLDER
/PARAMETER_VALUE=<Set to Path>
/ALPHABETIZE=TRUE
;

! List all C3D files in ROOTFOLDER
Set_Pipeline_Parameter_To_List_Of_Files
/PARAMETER_NAME=FILES
/FOLDER=::ROOTFOLDER
! /SEARCH_SUBFOLDERS=FALSE
/FILE_MASK=*.c3d
! /ALPHABETIZE=TRUE
! /RETURN_FOLDER_NAMES=FALSE
/RETURN_RELATIVE_FILENAMES=TRUE
! /FILES=
;

! Execute a For_Each loop that opens the mvnx file based on an incremental counter
! The counter buffer is needed because otherwise the COUNT=1 would match both *1.mvnx and *11.mvnx.
For_Each
/ITERATION_PARAMETER_NAME=INDEX
/ITERATION_PARAMETER_COUNT_NAME=COUNT
/ITERATION_PARAMETER_COUNT_BUFFER=2
/ITEMS=::FILES
;

! Open the mvnx file
File_Open
/FILE_NAME=*&::COUNT&.mvnx
/FILE_PATH=::ROOTFOLDER
! /SEARCH_SUBFOLDERS=FALSE
! /SUFFIX=
! /SET_PROMPT=File_Open
! /ON_FILE_NOT_FOUND=PROMPT
! /FILE_TYPES_ON_PROMPT=
;

! Then import the first motion capture file (assuming matching order)
Import_Signals_From_C3D_File
 /FILE_NAME=::FILE_NAME.    ! This syntax says to use the value of FILE_NAME from the previous command
 /IMPORT_FILE_NAME=::ROOTFOLDER&::INDEX
! /REPLACE_EXISTING_SIGNALS=FALSE
! /SYNCH_OFFSET=
! /IMPORT_ANALOG_SYNCH=
! /IMPORT_ANALOG_THRESHOLD=0.0
! /IMPORT_ANALOG_ASCENDING=TRUE
! /ANALOG_RATE=
 /ANALOG_RATIO=10
 /ALLOW_RESAMPLE=TRUE
! /INTERPOLATION_METHOD=CUBIC_SPLINE
! /IMPORT_AS_DERIVED=FALSE
! /DERIVED_FOLDER=EMG
 /IMPORT_FORCE_PLATFORM_PARAMETERS=TRUE
! /IMPORT_EVENT_LABELS=FALSE
! /ADD_PREFIX_TO_IMPORT=
;

End_For_Each
/ITERATION_PARAMETER_NAME=INDEX
;

See Also

If you want to bring in more than a C3D file's signals, consider using the Manage_File_Merge command to fully merge the files.

Back to Pipeline Commands Reference

visual3d/documentation/pipeline/file_commands/import_signals_from_c3d_file.txt · Last modified: by wikisysop