Simple struct for eye-tracker data. More...
#include <Psycho/EyeData.H>
Public Member Functions | |
EyeData (const float x_, const float y_, const float pdiam_, const SaccadeState sstate_, const bool bstate_) | |
Fully initialized constructor, no extra data. | |
EyeData (const float x_, const float y_, const float pdiam_, const SaccadeState sstate_, const bool bstate_, rutz::shared_ptr< ParamMap > dat) | |
Fully initialized constructor, extra data in ParamMap. | |
EyeData (const float x_, const float y_, const float pdiam_, const SaccadeState sstate_, const bool bstate_, const float dx_, const float dy_, const float ampl_, const float dur_, const float time_, const unsigned int num_) | |
Helper functions | |
bool | isInUnknown () const |
Are we in unknown state (uninitialized, loss of tracking, etc). | |
bool | isInFixation () const |
Are we in fixation? | |
bool | isInSaccade () const |
Are we in saccade? | |
bool | isInSmoothPursuit () const |
Are we in smooth pursuit? | |
bool | isInBlink () const |
Are we in blink? | |
bool | isInCombinedSaccade () const |
Are we in a series of combined saccades. | |
SaccadeState | saccadeState () const |
Get the saccade state directly. | |
bool | hasPupilDiam () const |
Do we have valid pupil diameter data? | |
bool | hasMetaData (const std::string field) const |
Do we have valid extra metadata? | |
bool | hasSpecialMetaData (const std::string field) const |
bool | hasSaccadeTargetData () const |
Do we have valid extra saccade target data? | |
bool | isValid () const |
Do we have valid (x,y) coordinates? | |
bool | isWithin (const Dims &dims) const |
Are our coordinates within some dims? | |
bool | isSpecialField (std::string field) const |
Is this field name a special field? | |
Access functions | |
| |
void | getPosition (float &xx, float &yy) const |
Get eye position, not rounded. | |
Point2D< int > | position () const |
Get eye position, rounded to nearest int coordinates. | |
float | pupilDiameter () const |
Get pupil diameter. | |
rutz::shared_ptr< ParamMap > | getMetaData () const |
Get all metadata. | |
std::vector< std::string > | getMetaDataList () const |
Get list of metadata fields. | |
double | getMetaDataField (std::string field) const |
Get one field of metadata. | |
void | getSaccadeTarget (float &targx, float &targy) const |
Get saccade target, not rounded. | |
Point2D< int > | saccadeTarget () const |
Get rounded saccade target. | |
float | saccadeAmplitude () const |
Get saccade amplitude. | |
float | saccadeDuration () const |
Get saccade duration. | |
float | saccadeTime () const |
Get the time at the endpoint of the saccade. | |
unsigned int | saccadeNumber () const |
Get saccade number. |
Simple struct for eye-tracker data.
Different eye trackers may or may not fill all data members. Members that should always be filled are x and y. Note that this class is costly in terms of storage, so typically one would want to use it only to pass data samples around, but not to store a long series of samples in memory. For example, Psycho/EyeTrace.H uses a more compact format to internally store eye data, and uses EyeData objects to deliver that data to whoever wants it.
Definition at line 58 of file EyeData.H.
EyeData::EyeData | ( | const float | x_, | |
const float | y_, | |||
const float | pdiam_, | |||
const SaccadeState | sstate_, | |||
const bool | bstate_ | |||
) | [inline] |
EyeData::EyeData | ( | const float | x_, | |
const float | y_, | |||
const float | pdiam_, | |||
const SaccadeState | sstate_, | |||
const bool | bstate_, | |||
rutz::shared_ptr< ParamMap > | dat | |||
) | [inline] |
rutz::shared_ptr< ParamMap > EyeData::getMetaData | ( | ) | const [inline] |
double EyeData::getMetaDataField | ( | std::string | field | ) | const [inline] |
Get one field of metadata.
Definition at line 339 of file EyeData.H.
References hasMetaData().
Referenced by getSaccadeTarget(), and saccadeAmplitude().
std::vector< std::string > EyeData::getMetaDataList | ( | ) | const [inline] |
Get list of metadata fields.
Definition at line 328 of file EyeData.H.
References getMetaData(), and hasMetaData().
void EyeData::getPosition | ( | float & | xx, | |
float & | yy | |||
) | const [inline] |
void EyeData::getSaccadeTarget | ( | float & | targx, | |
float & | targy | |||
) | const [inline] |
Get saccade target, not rounded.
Note that this will contain trash if there is no saccade target data. Check with hasMetaData() first to avoid this.
Definition at line 349 of file EyeData.H.
References getMetaDataField().
Referenced by saccadeTarget().
bool EyeData::hasMetaData | ( | const std::string | field = "any" |
) | const [inline] |
Do we have valid extra metadata?
Only a very few samples in an eye trace have this extra data, possibly none. The data may be present at the onset of each event and contains information about each event.
Definition at line 273 of file EyeData.H.
References rutz::shared_ptr< T >::is_valid().
Referenced by getMetaDataField(), getMetaDataList(), and hasSaccadeTargetData().
bool EyeData::hasPupilDiam | ( | ) | const [inline] |
bool EyeData::hasSaccadeTargetData | ( | ) | const [inline] |
Do we have valid extra saccade target data?
Only a very few samples in an eye trace have this extra data, possibly none. The data may be present at the onset of each saccade and contains information about the target of the saccade. NB: This is rewritten now for any sample that has extra data,
Definition at line 286 of file EyeData.H.
References hasMetaData(), and split().
Referenced by saccadeTarget().
bool EyeData::isInBlink | ( | ) | const [inline] |
bool EyeData::isInCombinedSaccade | ( | ) | const [inline] |
bool EyeData::isInFixation | ( | ) | const [inline] |
bool EyeData::isInSaccade | ( | ) | const [inline] |
bool EyeData::isInSmoothPursuit | ( | ) | const [inline] |
bool EyeData::isInUnknown | ( | ) | const [inline] |
Are we in unknown state (uninitialized, loss of tracking, etc).
Definition at line 250 of file EyeData.H.
References SACSTATE_UNK.
bool EyeData::isSpecialField | ( | std::string | field | ) | const [inline] |
bool EyeData::isValid | ( | ) | const [inline] |
Do we have valid (x,y) coordinates?
Definition at line 301 of file EyeData.H.
Referenced by isWithin().
bool EyeData::isWithin | ( | const Dims & | dims | ) | const [inline] |
Point2D< int > EyeData::position | ( | ) | const [inline] |
float EyeData::pupilDiameter | ( | ) | const [inline] |
float EyeData::saccadeAmplitude | ( | ) | const [inline] |
Get saccade amplitude.
Note that this will contain trash if there is no saccade target data. Check with hasMetaData() first to avoid this.
Definition at line 365 of file EyeData.H.
References getMetaDataField().
float EyeData::saccadeDuration | ( | ) | const [inline] |
Get saccade duration.
Note that this will contain trash if there is o saccade target data. Check with hasMetaData() first to avoid this.
unsigned int EyeData::saccadeNumber | ( | ) | const [inline] |
Get saccade number.
Note that this will contain trash if there is no saccade target data. Check with hasMetaData() first to avoid this. Returned saccade number is zero-based.
SaccadeState EyeData::saccadeState | ( | ) | const [inline] |
Point2D< int > EyeData::saccadeTarget | ( | ) | const [inline] |
Get rounded saccade target.
Note that this will contain trash if there is no saccade target data. Check with hasMetaData() first to avoid this.
Definition at line 353 of file EyeData.H.
References getSaccadeTarget(), and hasSaccadeTargetData().
float EyeData::saccadeTime | ( | ) | const [inline] |
Get the time at the endpoint of the saccade.
Note that this will contain trash if there is no saccade target data. Check with hasMetaData() first to avoid this.