clean_opti_data.cpp File Reference

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"
Include dependency graph for clean_opti_data.cpp:

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.

Detailed Description

Functions to clean Optical Marker Data and re-assign labels.


Function Documentation

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().

Here is the caller graph for this function:

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!

Parameters:
[in,out]datapointsVector containing point data.
[out]point_flagVector containing flag = 1 if point is reliable, 0 if not. Same size as datapoints vector
[in]point_labelsLabels 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

\[ \left | accl \right | = \left |v_2 - v_1 \right | \]

\[ \left | accl \right | = \sqrt{((v_2 cos(\theta)- v_1)^2 + (v_2 sin(\theta))^2)} \]

\[ \left | accl \right | = \sqrt{(v_2^2 +v_1^2 - 2*v_1 \dot v_2)} \]

References getdist().

Referenced by clean_opti_data().

Here is the call graph for this function:

Here is the caller graph for this function:

double getdist ( vector< double > &  basepoint,
vector< double > &  newpoint 
)

Get distance between basepoint and newpoint.

Referenced by clean_opti_data(), and getcang().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Defines