Dataset#

class pymovements.Dataset(definition: str | Path | DatasetDefinition | type[DatasetDefinition], path: str | Path | DatasetPaths)[source]#

Dataset base class.

Initialize the dataset object.

Parameters:
  • definition (str | Path | DatasetDefinition | type[DatasetDefinition]) – Dataset definition to initialize dataset with.

  • path (str | Path | DatasetPaths) – Path to the dataset directory. You can set up a custom directory structure by passing a DatasetPaths instance.

Methods

__init__(definition, path)

apply(function, *[, verbose])

Apply preprocessing method to all Gazes in Dataset.

clear_events()

Clear event DataFrame.

clip(lower_bound, upper_bound, *, ...[, verbose])

Clip gaze signal values.

compute_event_properties(event_properties[, ...])

Calculate an event property and add it as a column to the event dataframe.

compute_properties(event_properties[, name, ...])

Calculate an event property for and add it as a column to the event dataframe.

deg2pix([pixel_origin, position_column, ...])

Compute gaze positions in pixel coordinates from degrees of visual angle.

detect(method, *[, eye, clear, verbose])

Detect events by applying a specific event detection method.

detect_events(method, *[, eye, clear, verbose])

Detect events by applying a specific event detection method.

download(*[, extract, remove_finished, ...])

Download dataset resources.

extract(*[, remove_finished, ...])

Extract downloaded dataset archive files.

load(*[, events, preprocessed, subset, ...])

Parse file information and load all gaze files.

load_event_files([events_dirname, extension])

Load all available event files.

load_gaze_files([preprocessed, ...])

Load all available gaze data files.

load_precomputed_events()

Load precomputed events.

load_precomputed_reading_measures()

Load precomputed reading measures.

pix2deg([verbose])

Compute gaze positions in degrees of visual angle from pixel coordinates.

pos2acc(*[, degree, window_length, padding, ...])

Compute gaze accelerations in dva/s^2 from dva coordinates.

pos2vel([method, verbose])

Compute gaze velocities in dva/s from dva coordinates.

resample(resampling_rate[, columns, ...])

Resample a DataFrame to a new sampling rate by timestamps in time column.

save([events_dirname, preprocessed_dirname, ...])

Save preprocessed gaze and event files.

save_events([events_dirname, verbose, extension])

Save events to files.

save_preprocessed([preprocessed_dirname, ...])

Save preprocessed gaze files.

scan()

Infer information from filepaths and filenames.

split_gaze_data(by)

Split gaze data into separated Gaze objects.

split_precomputed_events(by)

Split precomputed event data into separated PrecomputedEventDataFrame's.

Attributes

path

The path to the dataset directory.