boris-behav-obs 9.7.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of boris-behav-obs might be problematic. Click here for more details.
- boris/__init__.py +26 -0
- boris/__main__.py +25 -0
- boris/about.py +143 -0
- boris/add_modifier.py +635 -0
- boris/add_modifier_ui.py +303 -0
- boris/advanced_event_filtering.py +455 -0
- boris/analysis_plugins/__init__.py +0 -0
- boris/analysis_plugins/_latency.py +59 -0
- boris/analysis_plugins/irr_cohen_kappa.py +109 -0
- boris/analysis_plugins/irr_cohen_kappa_with_modifiers.py +112 -0
- boris/analysis_plugins/irr_weighted_cohen_kappa.py +157 -0
- boris/analysis_plugins/irr_weighted_cohen_kappa_with_modifiers.py +162 -0
- boris/analysis_plugins/list_of_dataframe_columns.py +22 -0
- boris/analysis_plugins/number_of_occurences.py +22 -0
- boris/analysis_plugins/number_of_occurences_by_independent_variable.py +54 -0
- boris/analysis_plugins/time_budget.py +61 -0
- boris/behav_coding_map_creator.py +1110 -0
- boris/behavior_binary_table.py +305 -0
- boris/behaviors_coding_map.py +239 -0
- boris/boris_cli.py +340 -0
- boris/cmd_arguments.py +49 -0
- boris/coding_pad.py +280 -0
- boris/config.py +785 -0
- boris/config_file.py +356 -0
- boris/connections.py +409 -0
- boris/converters.py +333 -0
- boris/converters_ui.py +225 -0
- boris/cooccurence.py +250 -0
- boris/core.py +5901 -0
- boris/core_qrc.py +15958 -0
- boris/core_ui.py +1107 -0
- boris/db_functions.py +324 -0
- boris/dev.py +134 -0
- boris/dialog.py +1108 -0
- boris/duration_widget.py +238 -0
- boris/edit_event.py +245 -0
- boris/edit_event_ui.py +233 -0
- boris/event_operations.py +1040 -0
- boris/events_cursor.py +61 -0
- boris/events_snapshots.py +596 -0
- boris/exclusion_matrix.py +141 -0
- boris/export_events.py +1006 -0
- boris/export_observation.py +1203 -0
- boris/external_processes.py +332 -0
- boris/geometric_measurement.py +941 -0
- boris/gui_utilities.py +135 -0
- boris/image_overlay.py +72 -0
- boris/import_observations.py +242 -0
- boris/ipc_mpv.py +325 -0
- boris/irr.py +634 -0
- boris/latency.py +244 -0
- boris/measurement_widget.py +161 -0
- boris/media_file.py +115 -0
- boris/menu_options.py +213 -0
- boris/modifier_coding_map_creator.py +1013 -0
- boris/modifiers_coding_map.py +157 -0
- boris/mpv.py +2016 -0
- boris/mpv2.py +2193 -0
- boris/observation.py +1453 -0
- boris/observation_operations.py +2538 -0
- boris/observation_ui.py +679 -0
- boris/observations_list.py +337 -0
- boris/otx_parser.py +442 -0
- boris/param_panel.py +201 -0
- boris/param_panel_ui.py +305 -0
- boris/player_dock_widget.py +198 -0
- boris/plot_data_module.py +536 -0
- boris/plot_events.py +634 -0
- boris/plot_events_rt.py +237 -0
- boris/plot_spectrogram_rt.py +316 -0
- boris/plot_waveform_rt.py +230 -0
- boris/plugins.py +431 -0
- boris/portion/__init__.py +31 -0
- boris/portion/const.py +95 -0
- boris/portion/dict.py +365 -0
- boris/portion/func.py +52 -0
- boris/portion/interval.py +581 -0
- boris/portion/io.py +181 -0
- boris/preferences.py +510 -0
- boris/preferences_ui.py +770 -0
- boris/project.py +2007 -0
- boris/project_functions.py +2041 -0
- boris/project_import_export.py +1096 -0
- boris/project_ui.py +794 -0
- boris/qrc_boris.py +10389 -0
- boris/qrc_boris5.py +2579 -0
- boris/select_modifiers.py +312 -0
- boris/select_observations.py +210 -0
- boris/select_subj_behav.py +286 -0
- boris/state_events.py +197 -0
- boris/subjects_pad.py +106 -0
- boris/synthetic_time_budget.py +290 -0
- boris/time_budget_functions.py +1136 -0
- boris/time_budget_widget.py +1039 -0
- boris/transitions.py +365 -0
- boris/utilities.py +1810 -0
- boris/version.py +24 -0
- boris/video_equalizer.py +159 -0
- boris/video_equalizer_ui.py +248 -0
- boris/video_operations.py +310 -0
- boris/view_df.py +104 -0
- boris/view_df_ui.py +75 -0
- boris/write_event.py +538 -0
- boris_behav_obs-9.7.7.dist-info/METADATA +139 -0
- boris_behav_obs-9.7.7.dist-info/RECORD +109 -0
- boris_behav_obs-9.7.7.dist-info/WHEEL +5 -0
- boris_behav_obs-9.7.7.dist-info/entry_points.txt +2 -0
- boris_behav_obs-9.7.7.dist-info/licenses/LICENSE.TXT +674 -0
- boris_behav_obs-9.7.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BORIS
|
|
3
|
+
Behavioral Observation Research Interactive Software
|
|
4
|
+
Copyright 2012-2025 Olivier Friard
|
|
5
|
+
|
|
6
|
+
This file is part of BORIS.
|
|
7
|
+
|
|
8
|
+
BORIS is free software; you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation; either version 3 of the License, or
|
|
11
|
+
any later version.
|
|
12
|
+
|
|
13
|
+
BORIS is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with this program; if not see <http://www.gnu.org/licenses/>.
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
import logging
|
|
24
|
+
from PySide6.QtWidgets import (
|
|
25
|
+
QDialog,
|
|
26
|
+
QVBoxLayout,
|
|
27
|
+
QHBoxLayout,
|
|
28
|
+
QPushButton,
|
|
29
|
+
QLabel,
|
|
30
|
+
QTableWidget,
|
|
31
|
+
QSpacerItem,
|
|
32
|
+
QAbstractItemView,
|
|
33
|
+
QSizePolicy,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ExclusionMatrix(QDialog):
|
|
38
|
+
def __init__(self):
|
|
39
|
+
super().__init__()
|
|
40
|
+
|
|
41
|
+
hbox = QVBoxLayout(self)
|
|
42
|
+
|
|
43
|
+
self.label = QLabel()
|
|
44
|
+
self.label.setText(
|
|
45
|
+
("Check if behaviors are mutually exclusive.\nThe Point events (displayed on blue background) cannot be excluded)")
|
|
46
|
+
)
|
|
47
|
+
hbox.addWidget(self.label)
|
|
48
|
+
|
|
49
|
+
self.twExclusions = QTableWidget()
|
|
50
|
+
self.twExclusions.setSelectionBehavior(QAbstractItemView.SelectRows)
|
|
51
|
+
self.twExclusions.setAlternatingRowColors(True)
|
|
52
|
+
self.twExclusions.setEditTriggers(QAbstractItemView.NoEditTriggers)
|
|
53
|
+
hbox.addWidget(self.twExclusions)
|
|
54
|
+
|
|
55
|
+
hbox2 = QHBoxLayout()
|
|
56
|
+
spacer_item = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
|
57
|
+
hbox2.addItem(spacer_item)
|
|
58
|
+
|
|
59
|
+
self.pb_select_all = QPushButton("Check all")
|
|
60
|
+
self.pb_select_all.clicked.connect(lambda: self.pb_cb_selection("select"))
|
|
61
|
+
hbox2.addWidget(self.pb_select_all)
|
|
62
|
+
|
|
63
|
+
self.pb_unselect_all = QPushButton("Uncheck all")
|
|
64
|
+
self.pb_unselect_all.clicked.connect(lambda: self.pb_cb_selection("unselect"))
|
|
65
|
+
hbox2.addWidget(self.pb_unselect_all)
|
|
66
|
+
|
|
67
|
+
self.pb_revert_selection = QPushButton("Revert check")
|
|
68
|
+
self.pb_revert_selection.clicked.connect(lambda: self.pb_cb_selection("revert"))
|
|
69
|
+
hbox2.addWidget(self.pb_revert_selection)
|
|
70
|
+
|
|
71
|
+
self.pb_check_selected = QPushButton("Check selected")
|
|
72
|
+
self.pb_check_selected.clicked.connect(lambda: self.pb_selected(True))
|
|
73
|
+
hbox2.addWidget(self.pb_check_selected)
|
|
74
|
+
|
|
75
|
+
self.pb_uncheck_selected = QPushButton("Uncheck selected")
|
|
76
|
+
self.pb_uncheck_selected.clicked.connect(lambda: self.pb_selected(False))
|
|
77
|
+
hbox2.addWidget(self.pb_uncheck_selected)
|
|
78
|
+
|
|
79
|
+
self.pbCancel = QPushButton("Cancel")
|
|
80
|
+
self.pbCancel.clicked.connect(self.reject)
|
|
81
|
+
hbox2.addWidget(self.pbCancel)
|
|
82
|
+
|
|
83
|
+
self.pbOK = QPushButton("OK", clicked=self.accept)
|
|
84
|
+
hbox2.addWidget(self.pbOK)
|
|
85
|
+
|
|
86
|
+
hbox.addLayout(hbox2)
|
|
87
|
+
self.setLayout(hbox)
|
|
88
|
+
|
|
89
|
+
self.setWindowTitle("Behaviors exclusion matrix")
|
|
90
|
+
self.setGeometry(100, 100, 600, 400)
|
|
91
|
+
|
|
92
|
+
def pb_selected(self, to_check: bool):
|
|
93
|
+
"""
|
|
94
|
+
check/uncheck the checkbox in selected cells
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
to_check (boolean): True to check else False
|
|
98
|
+
"""
|
|
99
|
+
for selected_range in self.twExclusions.selectedRanges():
|
|
100
|
+
for row in range(selected_range.topRow(), selected_range.bottomRow() + 1):
|
|
101
|
+
for column in range(self.twExclusions.columnCount()):
|
|
102
|
+
try:
|
|
103
|
+
self.twExclusions.cellWidget(row, column).setChecked(to_check)
|
|
104
|
+
except Exception:
|
|
105
|
+
logging.warning(f"Error during checking/unchecking for {row}/{column} in exclusion matrix")
|
|
106
|
+
self.cb_clicked()
|
|
107
|
+
|
|
108
|
+
def pb_cb_selection(self, mode):
|
|
109
|
+
"""
|
|
110
|
+
button for checkbox selection/deselection and revert selection
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
mode (str): select, unselect, revert
|
|
114
|
+
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
for r in range(self.twExclusions.rowCount()):
|
|
118
|
+
for c in range(self.twExclusions.columnCount()):
|
|
119
|
+
if mode == "select":
|
|
120
|
+
state = True
|
|
121
|
+
if mode == "unselect":
|
|
122
|
+
state = False
|
|
123
|
+
try:
|
|
124
|
+
if mode == "revert":
|
|
125
|
+
state = not self.twExclusions.cellWidget(r, c).isChecked()
|
|
126
|
+
self.twExclusions.cellWidget(r, c).setChecked(state)
|
|
127
|
+
except Exception:
|
|
128
|
+
logging.warning(f"Error during checking/unchecking for {r}/{c} in exclusion matrix")
|
|
129
|
+
|
|
130
|
+
def cb_clicked(self):
|
|
131
|
+
"""
|
|
132
|
+
de/select the corresponding checkbox
|
|
133
|
+
"""
|
|
134
|
+
for r, r_name in enumerate(self.stateBehaviors + self.point_behaviors):
|
|
135
|
+
for c, c_name in enumerate(self.stateBehaviors):
|
|
136
|
+
if c_name != r_name:
|
|
137
|
+
try:
|
|
138
|
+
if f"{c_name}|{r_name}" in self.checkboxes:
|
|
139
|
+
self.checkboxes[f"{c_name}|{r_name}"].setChecked(self.checkboxes[f"{r_name}|{c_name}"].isChecked())
|
|
140
|
+
except Exception:
|
|
141
|
+
logging.warning(f"Error during checking/unchecking for {r_name}/{c_name} in exclusion matrix")
|