Functions to clean Optical Marker Data and re-assign labels. More...
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <curses.h>
#include <vector>
#include "postprocess.h"
#include "c3d.h"
Functions | |
int | clean_opti_data (vector< vector< double > > &datapoints, vector< vector< int > > &point_flag, vector< string > &point_labels) |
Clean Optical Marker Data and re-assign labels. | |
double | getdist (vector< double > &basepoint, vector< double > &newpoint) |
Get distance between basepoint and newpoint. | |
double | getcang (vector< double > &oldpoint, vector< double > &basepoint, vector< double > &newpoint) |
int | getmaxmin (vector< double > &currpt, vector< double > &max_pt, vector< double > &min_pt) |
Redefine diagonal points of box so that currpt is inside it. | |
int | checkinbox (vector< double > &currpt, vector< double > &max_pt, vector< double > &min_pt) |
Check if currpt is inside box defined by diagonal points max_pt and min_pt. |
Functions to clean Optical Marker Data and re-assign labels.
int checkinbox | ( | vector< double > & | currpt, |
vector< double > & | max_pt, | ||
vector< double > & | min_pt | ||
) |
Check if currpt is inside box defined by diagonal points max_pt and min_pt.
Referenced by clean_opti_data().
int clean_opti_data | ( | vector< vector< double > > & | datapoints, |
vector< vector< int > > & | point_flag, | ||
vector< string > & | point_labels | ||
) |
Clean Optical Marker Data and re-assign labels.
This program analyses the Motion Capture Data stored in the vectors (created by the load_opti_data function) and reassigns labels to the correct point trajectory. This is necessary since the ARENA software tends to fail at recognizing points for their correct names and labels them either as "Unlabeled" points or assigns correct labels.
This function will scan the data framewise for each point (labeled and unlabeled) and assign the closest recognized point (under 10 mm)
WE ASSUME THAT FIRST 100 FRAMES ARE CORRECTLY IDENTIFIED!
[in,out] | datapoints | Vector containing point data. |
[out] | point_flag | Vector containing flag = 1 if point is reliable, 0 if not. Same size as datapoints vector |
[in] | point_labels | Labels assigned to the points by the ARENA software |
Number of points identified automatically by the software
Number of "real" markers labeled for the rigid body.
Number of frames of data stored
Flag indicates whether closest point method is applicable or not. 0 indicates closest point approach is to be used. 1 indicates that closest point approach will not work (since previous point is either "bad" or masked).
threshold for distance between point in frame i and frame i+1.
threshold for point velocity difference in frame i and i+1
References checkinbox(), getcang(), getdist(), and getmaxmin().
Referenced by load_all_measures(), and main().
double getcang | ( | vector< double > & | oldpoint, |
vector< double > & | basepoint, | ||
vector< double > & | newpoint | ||
) |
get cosine of angle between vectors sharing 1 point. head of 1 vector is tail of the other. and use it to calculate the acceleration magnitude.
References getdist().
Referenced by clean_opti_data().
double getdist | ( | vector< double > & | basepoint, |
vector< double > & | newpoint | ||
) |
Get distance between basepoint and newpoint.
Referenced by clean_opti_data(), and getcang().
int getmaxmin | ( | vector< double > & | currpt, |
vector< double > & | max_pt, | ||
vector< double > & | min_pt | ||
) |
Redefine diagonal points of box so that currpt is inside it.
Referenced by clean_opti_data().