Classes
Processing (config[, isLibrary, isDebug]) |
Hub for running processing and analyzing raw data. |
imhr.Webgazer.processing.
Processing
(config, isLibrary=False, isDebug=False)[source]¶Bases: object
Hub for running processing and analyzing raw data.
Methods
Methods
append_classify (self, df, cg_df) |
Appending classification to Dataframe. |
classify (self, config, df[, ctype, …]) |
I-DT algorithm takes into account the distribution or spatial proximity of eye position points in the eye-movement trace. |
dwell (self, df[, cores, isMultiprocessing]) |
Calculate dwell time for sad and neutral images. |
filter_data (self, df, filter_type, config) |
Butterworth: Design an Nth-order digital or analog Butterworth filter and return the filter coefficients. |
getData (self[, path]) |
preparing data for use in analysis. |
getEstimatedMonitor (self, diagonal, window) |
calculate estimate monitor size (w,h;cm) using estimated diagonal monitor (hypotenuse; cm). |
onset_diff (self, df0[, merge, cores]) |
Calculate differences in onset presentation (stimulus, dotloc) using bokeh, seaborn, and pandas. |
preprocess (self, df, window) |
Initial data cleaning. |
process (self, window, filters, gxy_df, trial) |
Plotting and preparing data for classification. |
roi (self[, filters, flt, df, manual, …]) |
Check if fixation is within bounds. |
run (self, path[, task_type, single_subject, …]) |
Processing of data. |
subject_metadata (self, fpath, spath) |
Collect all subjects metadata. |
variables (self, df) |
Output list of variables for easy html viewing. |
append_classify (self, df, cg_df) |
Appending classification to Dataframe. |
classify (self, config, df[, ctype, …]) |
I-DT algorithm takes into account the distribution or spatial proximity of eye position points in the eye-movement trace. |
dwell (self, df[, cores, isMultiprocessing]) |
Calculate dwell time for sad and neutral images. |
filter_data (self, df, filter_type, config) |
Butterworth: Design an Nth-order digital or analog Butterworth filter and return the filter coefficients. |
getData (self[, path]) |
preparing data for use in analysis. |
getEstimatedMonitor (self, diagonal, window) |
calculate estimate monitor size (w,h;cm) using estimated diagonal monitor (hypotenuse; cm). |
onset_diff (self, df0[, merge, cores]) |
Calculate differences in onset presentation (stimulus, dotloc) using bokeh, seaborn, and pandas. |
preprocess (self, df, window) |
Initial data cleaning. |
process (self, window, filters, gxy_df, trial) |
Plotting and preparing data for classification. |
roi (self[, filters, flt, df, manual, …]) |
Check if fixation is within bounds. |
run (self, path[, task_type, single_subject, …]) |
Processing of data. |
subject_metadata (self, fpath, spath) |
Collect all subjects metadata. |
variables (self, df) |
Output list of variables for easy html viewing. |
getEstimatedMonitor
(self, diagonal, window)[source]¶calculate estimate monitor size (w,h;cm) using estimated diagonal monitor (hypotenuse; cm).
Attributes: |
|
---|
preprocess
(self, df, window)[source]¶Initial data cleaning.
Parameters: |
|
---|---|
Attributes: |
|
Notes
getData
(self, path=None)[source]¶preparing data for use in analysis.
Parameters: |
|
---|---|
Attributes: |
|
Returns: |
|
Notes
You can either get data from all subjects within a directory, or from a specific subject (subject_session).
Examples
>>> #if using path:
>>> df_raw = getData(path=self.config['path']['raw'])
>>> #if getting data for single subject:
>>> df_raw = getData(path=self.config['path']['raw'],subject_session=['1099','1', '0'])
filter_data
(self, df, filter_type, config)[source]¶Butterworth: Design an Nth-order digital or analog Butterworth filter and return the filter coefficients.
Parameters: |
|
---|---|
Attributes: |
|
classify
(self, config, df, ctype='ivt', filter_type=None, v_th=None, dr_th=None, di_th=None, missing=None, maxdist=None, mindur=None)[source]¶I-DT algorithm takes into account the distribution or spatial proximity of eye position points in the eye-movement trace.
In the I-VT model, the velocity value is computed for every eye position sample. The velocity value is then compared to the threshold. If the sampled velocity is less than the threshold, the corresponding eye-position sample is marked as part of a fixation, otherwise it is marked as a part of a saccade.
The simple model detects fixations, defined as consecutive samples with an inter-sample distance of less than a set amount of pixels (disregarding missing data)
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
roi
(self, filters=None, flt=None, df=None, manual=False, monitorSize=None)[source]¶Check if fixation is within bounds.
Attributes: |
|
---|---|
Returns: |
|
process
(self, window, filters, gxy_df, trial, _classify=True, ctype='simple', _param='', log=False, v_th=20, dr_th=200, di_th=20, _missing=0.0, _maxdist=25, _mindur=50)[source]¶Plotting and preparing data for classification. Combined plot of each filter.
Parameters: |
|
---|---|
Attributes: |
|
Returns: |
|
append_classify
(self, df, cg_df)[source]¶Appending classification to Dataframe.
Parameters: |
|
---|
run
(self, path, task_type='eyetracking', single_subject=False, single_trial=False, subject=0, trial=0, isMultiprocessing=True, cores=1)[source]¶Processing of data. Steps here include: cleaning data, fixation identification, and exporting data.
Parameters: |
|
---|---|
Attributes: |
|
subject_metadata
(self, fpath, spath)[source]¶Collect all subjects metadata.
Parameters: | |
---|---|
Returns: |
|
variables
(self, df)[source]¶Output list of variables for easy html viewing.
Parameters: |
|
---|---|
Returns: |
|
dwell
(self, df, cores=1, isMultiprocessing=False)[source]¶Calculate dwell time for sad and neutral images.
Parameters: |
|
---|---|
Returns: |
|
onset_diff
(self, df0, merge=None, cores=1)[source]¶Calculate differences in onset presentation (stimulus, dotloc) using bokeh, seaborn, and pandas.
Parameters: |
|
---|---|
Returns: |
|