core

Collection of the most central classes of the gait_analysis package:

source

EventBout

 EventBout (event_type:str, event_id:int, start_idx:int, end_idx:int,
            fps:int)

Analysis of the gait_analysis package is mainly composed of identifying different types of events and their combined analysis thereafter. This class represents the core interface for these analyses, as it bundles all relevant information of such events.

Attributes: self.event_type(str): type of event (e.g. “freezing” or “gait”) self.event_id(int): index of the occurance of this event type in a recording in chronological order self.start_idx(int): frame index in which this event bout starts self.end_idx(int): frame index at which this event bout ends self.fps(int): frames-per-second of the recording self.duration(float): duration of the event bout in s

Type Details
event_type str type of event (e.g. “immobility” or “gait”)
event_id int evnt index (e.g. 0 for the first occurance of this event type in a recording)
start_idx int index of the frame at which this event bout starts
end_idx int index of the frame at which this event bout ends
fps int frames-per-second value of the corresponding video recording
Returns None

source

TrackedRecording

 TrackedRecording (filepath:pathlib.Path, week_id:int)

While the analysis depends mainly on the identification of EventBouts and their integrated analyses, TrackedRecordings are the data objects on which these events are identified. They are implemented here as an abstract base class, as they will require slightly different functionalities depending on whether a 2D or 3D tracking needs to be handled.

Type Details
filepath Path the filepath to the output of DLC (.h5 or .csv file)
week_id int the experimental week post injection in which the recording was performed. Has to be an element of the self.valid_week_ids list
Returns None

source

Bodypart

 Bodypart (bodypart_id:str, df:pandas.core.frame.DataFrame, fps:int)

Bundles all information and functions needed to process the data of a single bodypart (i.e. marker id). Requires that the coordinates have already been normalized (translated & rotated) and converted to cm.

Type Details
bodypart_id str The ID of the bodypart, i.e. the marker_id
df DataFrame The normalized (rotated & translated) & converted (in cm) DataFrame that holds the DLC tracking information about this marker
fps int frames-per-second at which this recording was acquired
Returns None