EyeData Class Reference

Simple struct for eye-tracker data. More...

#include <Psycho/EyeData.H>

Collaboration diagram for EyeData:
Collaboration graph
[legend]

List of all members.

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< ParamMapgetMetaData () const
 Get all metadata.
std::vector< std::stringgetMetaDataList () 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.

Detailed Description

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.


Constructor & Destructor Documentation

EyeData::EyeData ( const float  x_,
const float  y_,
const float  pdiam_,
const SaccadeState  sstate_,
const bool  bstate_ 
) [inline]

Fully initialized constructor, no extra data.

Definition at line 219 of file EyeData.H.

EyeData::EyeData ( const float  x_,
const float  y_,
const float  pdiam_,
const SaccadeState  sstate_,
const bool  bstate_,
rutz::shared_ptr< ParamMap dat 
) [inline]

Fully initialized constructor, extra data in ParamMap.

Definition at line 225 of file EyeData.H.


Member Function Documentation

rutz::shared_ptr< ParamMap > EyeData::getMetaData (  )  const [inline]

Get all metadata.

Definition at line 325 of file EyeData.H.

Referenced by getMetaDataList().

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]

Get eye position, not rounded.

Definition at line 316 of file EyeData.H.

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]

Do we have valid pupil diameter data?

Definition at line 270 of file EyeData.H.

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]

Are we in blink?

Definition at line 261 of file EyeData.H.

bool EyeData::isInCombinedSaccade (  )  const [inline]

Are we in a series of combined saccades.

Definition at line 264 of file EyeData.H.

bool EyeData::isInFixation (  )  const [inline]

Are we in fixation?

Definition at line 253 of file EyeData.H.

References SACSTATE_FIX.

bool EyeData::isInSaccade (  )  const [inline]

Are we in saccade?

Definition at line 255 of file EyeData.H.

References SACSTATE_SAC.

bool EyeData::isInSmoothPursuit (  )  const [inline]

Are we in smooth pursuit?

Definition at line 258 of file EyeData.H.

References SACSTATE_SMO.

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]

Is this field name a special field?

Definition at line 311 of file EyeData.H.

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]

Are our coordinates within some dims?

Definition at line 304 of file EyeData.H.

References Dims::h(), isValid(), and Dims::w().

Point2D< int > EyeData::position (  )  const [inline]

Get eye position, rounded to nearest int coordinates.

Definition at line 319 of file EyeData.H.

float EyeData::pupilDiameter (  )  const [inline]

Get pupil diameter.

Note that this may be a NaN or other trash if there is no available data about pupil diameter, check with hasPupilDiameter() before if you want to ensure that you get a valid number.

Definition at line 322 of file EyeData.H.

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.

Definition at line 368 of file EyeData.H.

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.

Definition at line 374 of file EyeData.H.

SaccadeState EyeData::saccadeState (  )  const [inline]

Get the saccade state directly.

Definition at line 267 of file EyeData.H.

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.

Definition at line 371 of file EyeData.H.


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:43:20 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3