pymovements.datasets.dataset.Dataset#
- class pymovements.datasets.dataset.Dataset(root: str | Path, experiment: Experiment | None = None, filename_regex: str = '.*', filename_regex_dtypes: dict[str, type] | None = None, custom_read_kwargs: dict[str, Any] | None = None)[source]#
Dataset base class.
- __init__(root: str | Path, experiment: Experiment | None = None, filename_regex: str = '.*', filename_regex_dtypes: dict[str, type] | None = None, custom_read_kwargs: dict[str, Any] | None = None)[source]
Initialize the dataset object.
- Parameters:
root (str, Path) – Path to the root directory of the dataset.
experiment (Experiment) – The experiment definition.
filename_regex (str) – Regular expression which needs to be matched before trying to load the file. Named groups will appear in the fileinfo dataframe.
filename_regex_dtypes (dict[str, type], optional) – If named groups are present in the filename_regex, this makes it possible to cast specific named groups to a particular datatype.
custom_read_kwargs (dict[str, Any], optional) – If specified, these keyword arguments will be passed to the file reading function.
Methods
__init__(root[, experiment, filename_regex, ...])Initialize the dataset object.
detect_events(method[, eye, verbose])Detect events by applying a specific event detection method.
Infer information from filepaths and filenames.
load([events, preprocessed, subset])Parse file information and load all gaze files.
Load all available event files.
load_gaze_files([preprocessed])Load all available gaze data files.
pix2deg([verbose])Compute gaze positions in degrees of visual angle from pixel coordinates.
pos2vel([method, verbose])Compute gaze velocites in dva/s from dva coordinates.
save([verbose])Save preprocessed gaze and event files.
save_events([verbose])Save events to files.
save_preprocessed([verbose])Save preprocessed gaze files.
take_subset([subset])Take a subset of the dataset.
Attributes
events_rootpathGet the path to the directory of the event data.
preprocessed_rootpathGet the path to the directory of the preprocessed gaze data.
raw_rootpathGet the path to the directory of the raw data.
rootpathGet the path to the dataset directory.