gazelib.conversion package

Submodules

gazelib.conversion.utils module

exception gazelib.conversion.utils.ConversionException[source]

Bases: exceptions.Exception

class gazelib.conversion.utils.ExperimentConfiguration(raw_dict)[source]

Bases: object

get_trial_configuration(trial_config_id)[source]
Available trial configuration ids are:
‘calibration_movie’, ‘calibration_stimuli’, ‘SRT1’, ‘SRT2’, ‘SRT3’, ‘SRT4’, ‘SRT5’
class gazelib.conversion.utils.TrialConfiguration(raw_dict)[source]

Bases: object

get_aoi_rectangle(aoi_index)[source]

Returns AoI in gazelib/geom/rectangle format.

get_image_name(index)[source]

Retrieves an image name from ‘images’ list at given index.

gazelib.conversion.utils.estimate_sampling_interval(times)[source]

Return mean interval in the given list of times. Return None if times is empty or contains only one element.

gazelib.conversion.utils.split_to_ranges_at_change_in_value(gd, value_converter, time_converter)[source]

Similar to gazelib.legacy.igazelib.split_at_change_in_value but returns also starting and ending times. The start time is equal to the end time of the previous range. Invalid values do not cause splits.

Parameters:
gd:
gazedata as list of dicts
value_converter:
A function that converts from raw row to the value used for comparison and also in yielded dicts. Must raise ValueError or TypeError if value cannot be converted. On ValueError or TypeError the row will be skipped.
time_converter:
A function that converts from raw row to times used in ranges. Must return integer. Must raise ValueError or TypeError if time cannot be converted. On ValueError or TypeError the row will be skipped.

Yields dicts:

{
    'start': <integer, start time of range, inclusive>,
    'end': <integer, end time of range, exclusive>,
    'value': <the value of the range>,
    'first': <first point in range>
}

Module contents

Tools to convert from a data format to another.

Usage:

icllib.conversion.<source_format>.<target_format>.convert(...)