Problem on accessing OPHYS eye-tracking data

Hi everyone.
First of all I’m sorry for my poor English writing skill. I’ll try to convey my problem as clear as I can.
I’m currently working on ophys dataset and I’m using AllenSDK to access the data.
I wrote this piece of code to download only experiments that contains Eye tracking data.
here is my code:

experiments = boc.get_ophys_experiments(targeted_structures=[area]
experiment_ids = [experiment[""id""] for experiment in experiments ]

Then i use these ids to get ophys experiments data and eye-tracking data using this code:

nwb = boc.get_ophys_experiment_data(ophys_experiment_id=experiments[0])

x = nwb.get_pupil_location()

but I got this error:

    849 except KeyError:
--> 850     raise NoEyeTrackingException("No eye tracking for this experiment.")
    852 return pupil_times, pupil_location

NoEyeTrackingException: No eye tracking for this experiment.

indeed I checked manually the metadata for this experiment (experiment id:652094901) using this code to ensure that eye-tracking data is available for this experiment. by this code:

>boc.get_ophys_experiments(ids = [652094901])
>[{'id': 652094901,
  'imaging_depth': 175,
  'targeted_structure': 'VISp',
  'cre_line': 'Slc17a7-IRES2-Cre',
  'reporter_line': 'Ai93(TITL-GCaMP6f)',
  'acquisition_age_days': 87,
  'experiment_container_id': 650389885,
  'session_type': 'three_session_A',
  'donor_name': '355468',
  'specimen_name': 'Slc17a7-IRES2-Cre;Camk2a-tTA;Ai93-355468',
  'fail_eye_tracking': False}]

as you can clearly see fail_eye_tracking key is false meaning that data is available.
but i did not stop and i found this method (part of brain_observatory_cache class) that returns an array with the shape of (n_frame,5) .
here is that method:
x = boc.get_eye_tracking(ophys_experiment_id=652094901)
in the doc string of this method i saw this comment:

            Contents of array unknown. Assumed to be [n_frames, 5] where
            the meaning of the values in each column are unknown.
            Ask Saskia De Vries

I’ve tried to email Saskia and to this day ive got no response.
finally I’ve ploted each column of this array and i found that first column must be time stamps:
but i have no idea about other columns.
Now my question is, is it even possible to get eye-tracking data using nwb.get_pupil_location() method or not? if not, what is the meaning of column that returned by boc.get_eye_tracking() method?
Thanks for your consideration and your time!

Hi Mohammad,

I apologize that your email must have been buried while I was traveling.

The columns are:
frame number, eye_area, pupil_area, x_position, y_position.
The positions are both in degrees.

I think the get_pupil_location method doesn’t work for this data - I’m unclear why both functions exist and will ask the Technology team about that

Good luck!

1 Like