User Tools

Site Tools


visual3d:documentation:pipeline:expressions:overview

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:expressions:overview [2024/06/19 12:49] sgrangervisual3d:documentation:pipeline:expressions:overview [2024/07/12 13:29] (current) – removed sgranger
Line 1: Line 1:
-many (but not all) edit boxes and pipeline command parameters allow the use of expressions instead of numerical values. visual3d uses a common expression parser, so the following syntax is common across all command parameters that allow expressions. 
- 
-===== evaluate_expression command ===== 
- 
-the evaluate_expression command allows the users to include expressions for defining the processing of the signals. 
- 
-evaluate_expression 
-/expression= 
-!/signal_type= 
-!/signal_folder= 
-!/signal_name= 
-/result_type= 
-/result_folder= 
-/result_name= 
-!/apply_as_suffix_to_signal_name=false 
-**;** 
-==== expression_items ==== 
- 
-[[visual3d:documentation:pipeline:expressions:expression_items#data_tree|data tree signals]] 
-[[visual3d:documentation:pipeline:expressions:expression_items#model_builder|expressions_in_model_builder_mode]] 
-[[visual3d:documentation:pipeline:expressions:expression_items#pipeline_parameters|pipeline_parameters]] 
-[[visual3d:documentation:pipeline:expressions:expression_items#tags|tags]] 
-[[visual3d:documentation:pipeline:expressions:expression_items#c3d_parameters|c3d_parameters]] 
-[[visual3d:documentation:pipeline:expressions:expression_items#model_metrics|model metrics]] 
-[[visual3d:documentation:pipeline:general_information:string_data|string data]] 
-==== visual3d reserved characters ==== 
- 
-there are five characters that cause the equation parser considerable trouble. we have introduced reserved pipeline commands that can be used in the place of these characters. 
- 
-|reserved_characters                                                            |             | 
-|[[visual3d:documentation:pipeline:expressions:reserved_characters#amp|&]]      |ampersand    | 
-|[[visual3d:documentation:pipeline:expressions:reserved_characters#colon|:]]    |colon        | 
-|[[visual3d:documentation:pipeline:expressions:reserved_characters#semicolon|;]]|semicolon    | 
-|[[visual3d:documentation:pipeline:expressions:reserved_characters#plus|+]]     |plus         | 
-|[[visual3d:documentation:pipeline:expressions:reserved_characters#fslash|/]]   |forward slash| 
- 
-==== visual3d reserved names ==== 
- 
-|reserved_names                                                                              |                           | 
-|[[visual3d:documentation:pipeline:expressions:reserved_names#current_signal|current_signal]]|short hand for signal names| 
-|[[visual3d:documentation:pipeline:expressions:reserved_names#nan|nan]]                      |not a number               | 
-|[[visual3d:documentation:pipeline:expressions:reserved_names#isnan|isnan]]                  |is not a number?           | 
- 
-==== numbers ==== 
- 
-|mathematical constants                                                          |                                                                                                    | 
-|pi()                                                                            |3.14159265358979323846                                                                              | 
-|gravity_vector()                                                                |gravity vector in the laboratory coordinate system. for a z-up coordinate system returns (0,0,-9.81)| 
-|[[visual3d:documentation:pipeline:expressions:expression_numbers#random|rand()]]|generate a random number                                                                            | 
- 
-==== mathematical operators ==== 
- 
-**note: visual3d parses the mathematical operators before it parses the signal names. if you have a signal name that contains a mathematical operator (e.g. r-foot1), visual3d will probably not be able to parse the equation expression properly.** 
-**also note the potential conflict between some of the operators and the reserved characters. if the string is obviously an expression, there is no conflict.** 
-|mathematical operators                                                                                                                            | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#plus|+]]                         |plus or add                                 | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#minus|-]]                        |minus or subtract                           | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#multiply|*]]                     |multiply                                    | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#divide|/]]                       |divide                                      | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#power|^]]                        |power -> for example, x^2 = x to the power 2| 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#logical_or||]]                   |logical or -> the adjective not is allowed  | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#logical_and|&]]                  |logical and -> the adjective not is allowed | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#equals|== or =]]                 |equals                                      | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#not_equals|<> or ><]]            |not equals                                  | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#less_than|<]]                    |less than                                   | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#less_than_or_equals|<= or =<]]   |less than or equals to                      | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#greater_than|>]]                 |greater than                                | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#greater_than_or_equals|>= or =>]]|greater than or equals to                   | 
-|[[visual3d:documentation:pipeline:expressions:mathematical_operators_#not|not()]]                      |not()                                       | 
- 
-=== the ugly truth of the logical and === 
- 
-& is used by visual3d for concatenating strings 
-it works quite well, but there is one circumstance where this choice of delimiter is a nuisance. 
-and that is when you want & to actually be a logical and and the parser throws it away 
-in this case you can use the reserved string amp 
-it was only really ugly before version 2024_04 because it didn't work before then 
-example given a file that has tags labelled test1 and test2 
-to select files containing the tags test1 and test2 
-select_active_file 
-/file_name=all_files 
-/query=test1 & test2 
-! /subject_tags=no_subject 
-**;** 
-! but what if you want to generalize and use another pipeline parameter for test2 
-set_pipeline_parameter 
-/parameter_name=scott2 
-/parameter_value=test1 &::amp &::scott 
-**;** 
-select_active_file 
-/file_name=all_files 
-/query=test1 &::amp &::scott 
-! /subject_tags=no_subject 
-**;** 
-==== brackets ==== 
- 
-|brackets                                                                    |                                    | 
-|[[visual3d:documentation:pipeline:expressions:brackets#parentheses|( )]]    |contain the parameters in a function| 
-|[[visual3d:documentation:pipeline:expressions:brackets#square_brackets|[ ]]]|specify frame numbers and components| 
- 
-===== functions ===== 
- 
-visual3d has pre-defined functions imbedded in the pipeline to help you out. 
-these functions are commonly used or have been added based on customer use. 
-====  metric functions ==== 
- 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_minimum|metric_minimum]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_maximum|metric_maximum]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_range|metric_range]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_mean|metric_mean]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_median|metric_median]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_stddev|metric_stddev]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_rms|metric_rms]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_sum|metric_sum]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_integrate|metric_integrate]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#metric_interquartile|metric_interquartile]] 
-[[visual3d:documentation:pipeline:expressions:metric_functions#cross_correlation|cross_correlation]] 
-====  signal functions ==== 
- 
-[[visual3d:documentation:pipeline:expressions:signal_functions#data_exists|data exists]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#frame_count|frame_count]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#add|add]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#sort|sort]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#transpose|transpose]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#interpolate|interpolate]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#first_derivative|first derivative]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#second_derivative|second derivative]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#resolve_discontinuity|resolve_discontinuity]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#indefinite_integral|indefinite_integral]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#point_relative_to_3points|point_relative_to_3points]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#snip|snip]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#spline|spline]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#point_relative_to_3points|point_relative_to_3points]] 
-[[visual3d:documentation:pipeline:expressions:signal_functions#append_as...|append_as]] 
-==== string data ==== 
- 
-[[visual3d:documentation:pipeline:general_information:string_data#syntax|specifying string data]] 
-[[visual3d:documentation:pipeline:general_information:string_data#modify|modifying string data]] 
-[[visual3d:documentation:pipeline:general_information:string_data#parsing|parsing string data]] 
-[[visual3d:documentation:pipeline:general_information:string_data#string_left|string_left]] 
-[[visual3d:documentation:pipeline:general_information:string_data#string_right|string_right]] 
-[[visual3d:documentation:pipeline:general_information:string_data#string_mid|string_mid]] 
-[[visual3d:documentation:pipeline:general_information:string_data#string_find|string_find]] 
-[[visual3d:documentation:pipeline:general_information:string_data#string_reverse_find|string_reverse_find]] 
-[[visual3d:documentation:pipeline:general_information:string_data#string_to_lower|string_to_lower]] 
-[[visual3d:documentation:pipeline:general_information:string_data#string_to_upper|string_to_upper]] 
-[[visual3d:documentation:pipeline:general_information:string_data#to_string|to_string]] 
-==== least squares fitting of data ==== 
- 
-[[visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data#best_fit_plane|best_fit_plane]] 
-[[visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data#best_fit_circle|best_fit_circle]] 
-[[visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data#best_fit_sphere|best_fit_sphere]] 
-[[visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data#simple_linear_regression|simple_linear_regression]] 
-====  intersection functions ==== 
- 
-[[visual3d:documentation:pipeline:expressions:intersection_functions#line_line_intersect|line_line_intersect]] 
-[[visual3d:documentation:pipeline:expressions:intersection_functions#line_plane_intersect|line_plane_intersect]] 
-[[visual3d:documentation:pipeline:expressions:intersection_functions#project_point_on_plane|project_point_on_plane]] 
-[[visual3d:documentation:pipeline:expressions:intersection_functions#point_distance_to_plane|point_distance_to_plane]] 
-[[visual3d:documentation:pipeline:expressions:intersection_functions#point_distance_to_line|point_distance_to_line]] 
-[[visual3d:documentation:pipeline:expressions:intersection_functions#is_point_inside_polygon|is_point_inside_polygon]] 
-==== assigned force functions ==== 
- 
-[[visual3d:documentation:pipeline:expressions:assigned_force_functions#forces|force]] 
-[[visual3d:documentation:pipeline:expressions:assigned_force_functions#center_of_pressure|center of pressure]] 
-[[visual3d:documentation:pipeline:expressions:assigned_force_functions#free_moment|free moment]] 
-==== trigonometric functions ==== 
- 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#cosine|cosine]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#sine|sine]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#tangent|tangent]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#cotangent|cotangent]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#arctangent|arctangent]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#cosine|cosine]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#arcsine|arcsine]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#arccos|arccos]] 
-[[visual3d:documentation:pipeline:expressions:trigonometric_functions#arctan2|arctan2]] 
-====  array and matrix functions ==== 
- 
-[[visual3d:documentation:pipeline:expressions:array_and_matrix_functions#vector|vector]] 
-[[visual3d:documentation:pipeline:expressions:array_and_matrix_functions#unit_vector|unit_vector]] 
-[[visual3d:documentation:pipeline:expressions:array_and_matrix_functions#list|list]] 
-[[visual3d:documentation:pipeline:expressions:array_and_matrix_functions#rotation_multiply|rotation_multiply]] 
-[[visual3d:documentation:pipeline:expressions:array_and_matrix_functions#rotation_inverse|rotation_inverse]] 
-[[visual3d:documentation:pipeline:expressions:array_and_matrix_functions#rotation_transpose|rotation_transpose]] 
-[[visual3d:documentation:pipeline:expressions:array_and_matrix_functions#pose_euler2rotation4x4|pose_euler2rotation4x4]] 
-==== common math expressions ==== 
- 
-**int(a**) - truncate each component to the nearest integer 
-**round(a)** - round each component to the nearest integer 
-**fmod(y,x)** - returns the floating-point remainder of y/x 
-=> y and x must be one dimensional signals; returns a one dimensional signal 
-**abs(a)** - absolute value 
-**sign(a)**= sign of the signal ((a<0)=-1, (a>0)=1, (a==0) = 0 
-**sqrt(a)** - square root 
-**exp(a)** - exponent 
-**log(a)** - natural log 
-**log10(a)** - log base 10 
-**length(x)** -- creates the length (magnitude) of a vector 
-**distance(a,b)** -- distance between two signals. 
-example 
-evaluate_expression 
-/expression= distance(landmark::original::right_hip , target::original::lhip) 
-/result_name=prox_thigh_radius 
-! /result_type=derived 
-! /result_folder=processed 
-**;** 
-\\ 
- 
- 
-**dot (a, b)** -- creates the dot product of a and b 
-**cross (a, b)** -- creates the cross product of a and b 
-**note: often you will want to do dot (a, b)/ length (b), or cross (a, b) / length (b)** 
-===== expression examples ===== 
- 
-examples of using evaluate_expressions can be found here: **[[visual3d:documentation:pipeline:expressions:examples|expressions examples]]** 
- 
- 
  
visual3d/documentation/pipeline/expressions/overview.1718801399.txt.gz · Last modified: 2024/06/19 12:49 by sgranger