twoD/utils

Basic functions used throughout the 2D module and/or that foster the use of this module

source

process_all_dlc_tracking_h5s_with_default_settings

 process_all_dlc_tracking_h5s_with_default_settings
                                                     (in_dir_path:pathlib.
                                                     Path, out_dir_path:pa
                                                     thlib.Path,
                                                     week_id:int)
Type Details
in_dir_path Path path to the input directory which contains all DLC tracking data results
out_dir_path Path path to the output directory where all processed results will be saved
week_id int number of weeks post injection
Returns None

source

get_max_odd_n_frames_for_time_interval

 get_max_odd_n_frames_for_time_interval (fps:int, time_interval:0.5)

For the savgol_filter function of scipy - which will be used during preprocessing to smooth the data - you need an odd integer as the window_length parameter. This function helps to find the maximum odd number of frames that still fit within a specified time interval at a given fps.

Type Details
fps int frames per second of the recording
time_interval 0.5 desired maximal time interval in seconds; default = 0.5 s
Returns int

source

get_column_names

 get_column_names (df:pandas.core.frame.DataFrame,
                   column_identifiers:List[str],
                   marker_ids:List[str]=['all'])

source

get_interval_border_idxs

 get_interval_border_idxs (all_matching_idxs:numpy.ndarray,
                           framerate:float,
                           min_interval_duration:Optional[float]=None,
                           max_interval_duration:Optional[float]=None)

source

compute_coverage

 compute_coverage (df:pandas.core.frame.DataFrame,
                   critical_marker_ids:List[str],
                   likelihood_threshold:float=0.5)

source

get_idxs_where_all_markers_exceed_likelihood

 get_idxs_where_all_markers_exceed_likelihood
                                               (df:pandas.core.frame.DataF
                                               rame, marker_ids:List[str],
                                               likelihood_threshold:float=
                                               0.5)