Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support missing dummy row in asc files #917

Open
dkrako opened this issue Jan 7, 2025 · 2 comments · May be fixed by #918
Open

support missing dummy row in asc files #917

dkrako opened this issue Jan 7, 2025 · 2 comments · May be fixed by #918
Labels
enhancement New feature or request

Comments

@dkrako
Copy link
Contributor

dkrako commented Jan 7, 2025

Description of the problem

There are configurations of EyeLink eye trackers that lead to unparsed eye tracking samples.

The following regex:

EYE_TRACKING_SAMPLE = re.compile(
    r'(?P<time>(\d+[.]?\d*))\s+'
    r'(?P<x_pix>[-]?\d*[.]\d*)\s+'
    r'(?P<y_pix>[-]?\d*[.]\d*)\s+'
    r'(?P<pupil>\d*[.]\d*)\s+'
    r'(?P<dummy>\d*[.]\d*)\s+'
    r'(?P<dots>[A-Za-z.]{3,5})?\s*',
)

match: 2498958 77.1 96.4 454.0 0.0 ...

no match: 677671 1488.6 309.1 1085.0 ...

The second

Description of a solution

An alternative regex definition that would match both lines:

EYE_TRACKING_SAMPLE = re.compile(
    r'(?P<time>(\d+[.]?\d*))\s+'
    r'(?P<x_pix>[-]?\d*[.]\d*)\s+'
    r'(?P<y_pix>[-]?\d*[.]\d*)\s+'
    r'(?P<pupil>\d*[.]\d*)\s+'
    r'((?P<dummy>\d*[.]\d*)\s+)?'
    r'(?P<dots>[A-Za-z.]{3,5})?\s*',
)

The difference is in the dummy line. This way the dummy row is completely optional by using ?.

Context

The differences between the two example messages seem to result from MODE RECORD:

  • !MODE RECORD CR 1000 0 0 R -- has dummy 0 on 5th column
  • !MODE RECORD CR 500 2 1 L -- does not have dummy 0

Disclaimer

I copied substantial parts of descirption, proposal and data from @senisioi

@dkrako dkrako added the enhancement New feature or request label Jan 7, 2025
@dkrako dkrako linked a pull request Jan 7, 2025 that will close this issue
14 tasks
@dkrako dkrako linked a pull request Jan 7, 2025 that will close this issue
14 tasks
@dkrako
Copy link
Contributor Author

dkrako commented Jan 8, 2025

@saeub can you post the info on the row specification you showed in the meeting today for reference? it was in one of the manuals right?

@saeub
Copy link
Collaborator

saeub commented Jan 8, 2025

From the User Manual of the EyeLink Portable Duo (Version 1.0.9), section 4.9.2 (p. 92):

SAMPLE LINE FORMATS

  • Monocular:
    <time> <xp> <yp> <ps>
  • Monocular, with velocity
    <time> <xp> <yp> <ps> <xv> <yv>
  • Monocular, with resolution
    <time> <xp> <yp> <ps> <xr> <yr>
  • Monocular, with velocity and resolution
    <time> <xp> <yp> <ps> <xv> <yv> <xr> <yr>
  • Binocular
    <time> <xpl> <ypl> <psl> <xpr> <ypr> <psr>
  • Binocular, with velocity
    <time> <xpl> <ypl> <psl> <xpr> <ypr> <psr> <xvl> <yvl> <xvr> <yvr>
  • Binocular, with resolution
    <time> <xpl> <ypl> <psl> <xpr> <ypr> <psr> <xr> <yr>
  • Binocular, with velocity and resolution
    <time> <xpl> <ypl> <psl> <xpr> <ypr> <psr> <xvl> <yvl> <xvr> <yvr> <xr> <yr>

The manual doesn't mention the -input flag, so that might add some more possible formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants