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.

Files changed (109) hide show
  1. boris/__init__.py +26 -0
  2. boris/__main__.py +25 -0
  3. boris/about.py +143 -0
  4. boris/add_modifier.py +635 -0
  5. boris/add_modifier_ui.py +303 -0
  6. boris/advanced_event_filtering.py +455 -0
  7. boris/analysis_plugins/__init__.py +0 -0
  8. boris/analysis_plugins/_latency.py +59 -0
  9. boris/analysis_plugins/irr_cohen_kappa.py +109 -0
  10. boris/analysis_plugins/irr_cohen_kappa_with_modifiers.py +112 -0
  11. boris/analysis_plugins/irr_weighted_cohen_kappa.py +157 -0
  12. boris/analysis_plugins/irr_weighted_cohen_kappa_with_modifiers.py +162 -0
  13. boris/analysis_plugins/list_of_dataframe_columns.py +22 -0
  14. boris/analysis_plugins/number_of_occurences.py +22 -0
  15. boris/analysis_plugins/number_of_occurences_by_independent_variable.py +54 -0
  16. boris/analysis_plugins/time_budget.py +61 -0
  17. boris/behav_coding_map_creator.py +1110 -0
  18. boris/behavior_binary_table.py +305 -0
  19. boris/behaviors_coding_map.py +239 -0
  20. boris/boris_cli.py +340 -0
  21. boris/cmd_arguments.py +49 -0
  22. boris/coding_pad.py +280 -0
  23. boris/config.py +785 -0
  24. boris/config_file.py +356 -0
  25. boris/connections.py +409 -0
  26. boris/converters.py +333 -0
  27. boris/converters_ui.py +225 -0
  28. boris/cooccurence.py +250 -0
  29. boris/core.py +5901 -0
  30. boris/core_qrc.py +15958 -0
  31. boris/core_ui.py +1107 -0
  32. boris/db_functions.py +324 -0
  33. boris/dev.py +134 -0
  34. boris/dialog.py +1108 -0
  35. boris/duration_widget.py +238 -0
  36. boris/edit_event.py +245 -0
  37. boris/edit_event_ui.py +233 -0
  38. boris/event_operations.py +1040 -0
  39. boris/events_cursor.py +61 -0
  40. boris/events_snapshots.py +596 -0
  41. boris/exclusion_matrix.py +141 -0
  42. boris/export_events.py +1006 -0
  43. boris/export_observation.py +1203 -0
  44. boris/external_processes.py +332 -0
  45. boris/geometric_measurement.py +941 -0
  46. boris/gui_utilities.py +135 -0
  47. boris/image_overlay.py +72 -0
  48. boris/import_observations.py +242 -0
  49. boris/ipc_mpv.py +325 -0
  50. boris/irr.py +634 -0
  51. boris/latency.py +244 -0
  52. boris/measurement_widget.py +161 -0
  53. boris/media_file.py +115 -0
  54. boris/menu_options.py +213 -0
  55. boris/modifier_coding_map_creator.py +1013 -0
  56. boris/modifiers_coding_map.py +157 -0
  57. boris/mpv.py +2016 -0
  58. boris/mpv2.py +2193 -0
  59. boris/observation.py +1453 -0
  60. boris/observation_operations.py +2538 -0
  61. boris/observation_ui.py +679 -0
  62. boris/observations_list.py +337 -0
  63. boris/otx_parser.py +442 -0
  64. boris/param_panel.py +201 -0
  65. boris/param_panel_ui.py +305 -0
  66. boris/player_dock_widget.py +198 -0
  67. boris/plot_data_module.py +536 -0
  68. boris/plot_events.py +634 -0
  69. boris/plot_events_rt.py +237 -0
  70. boris/plot_spectrogram_rt.py +316 -0
  71. boris/plot_waveform_rt.py +230 -0
  72. boris/plugins.py +431 -0
  73. boris/portion/__init__.py +31 -0
  74. boris/portion/const.py +95 -0
  75. boris/portion/dict.py +365 -0
  76. boris/portion/func.py +52 -0
  77. boris/portion/interval.py +581 -0
  78. boris/portion/io.py +181 -0
  79. boris/preferences.py +510 -0
  80. boris/preferences_ui.py +770 -0
  81. boris/project.py +2007 -0
  82. boris/project_functions.py +2041 -0
  83. boris/project_import_export.py +1096 -0
  84. boris/project_ui.py +794 -0
  85. boris/qrc_boris.py +10389 -0
  86. boris/qrc_boris5.py +2579 -0
  87. boris/select_modifiers.py +312 -0
  88. boris/select_observations.py +210 -0
  89. boris/select_subj_behav.py +286 -0
  90. boris/state_events.py +197 -0
  91. boris/subjects_pad.py +106 -0
  92. boris/synthetic_time_budget.py +290 -0
  93. boris/time_budget_functions.py +1136 -0
  94. boris/time_budget_widget.py +1039 -0
  95. boris/transitions.py +365 -0
  96. boris/utilities.py +1810 -0
  97. boris/version.py +24 -0
  98. boris/video_equalizer.py +159 -0
  99. boris/video_equalizer_ui.py +248 -0
  100. boris/video_operations.py +310 -0
  101. boris/view_df.py +104 -0
  102. boris/view_df_ui.py +75 -0
  103. boris/write_event.py +538 -0
  104. boris_behav_obs-9.7.7.dist-info/METADATA +139 -0
  105. boris_behav_obs-9.7.7.dist-info/RECORD +109 -0
  106. boris_behav_obs-9.7.7.dist-info/WHEEL +5 -0
  107. boris_behav_obs-9.7.7.dist-info/entry_points.txt +2 -0
  108. boris_behav_obs-9.7.7.dist-info/licenses/LICENSE.TXT +674 -0
  109. boris_behav_obs-9.7.7.dist-info/top_level.txt +1 -0
@@ -0,0 +1,157 @@
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 binascii
24
+
25
+ from PySide6.QtCore import Signal, QPoint, Qt
26
+ from PySide6.QtGui import QPen, QPixmap, QBrush, QMouseEvent, QPolygonF, QColor
27
+ from PySide6.QtWidgets import (
28
+ QDialog,
29
+ QGraphicsView,
30
+ QGraphicsScene,
31
+ QLineEdit,
32
+ QVBoxLayout,
33
+ QHBoxLayout,
34
+ QSpacerItem,
35
+ QSizePolicy,
36
+ QPushButton,
37
+ QGraphicsPixmapItem,
38
+ QGraphicsPolygonItem,
39
+ )
40
+
41
+
42
+ class ModifiersCodingMapWindow(QDialog):
43
+ class View(QGraphicsView):
44
+ mousePress = Signal(QMouseEvent)
45
+
46
+ def mousePressEvent(self, event):
47
+ self.mousePress.emit(event)
48
+
49
+ start = 0
50
+ elList = []
51
+ points = []
52
+
53
+ def __init__(self, parent):
54
+ QGraphicsView.__init__(self, parent)
55
+ self.setScene(QGraphicsScene(self))
56
+ self.scene().update()
57
+
58
+ def __init__(self, modifiers_coding_map):
59
+ super(ModifiersCodingMapWindow, self).__init__()
60
+
61
+ self.areasList = {}
62
+ self.polygonsList2 = {}
63
+ self.codeSeparator = ","
64
+
65
+ self.codingMap = modifiers_coding_map
66
+ self.setWindowTitle(f"Modifiers coding map: {self.codingMap['name']}")
67
+ Vlayout = QVBoxLayout(self)
68
+
69
+ self.view = self.View(self)
70
+ self.view.mousePress.connect(self.viewMousePressEvent)
71
+
72
+ self.leareaCode = QLineEdit(self)
73
+ self.leareaCode.setVisible(True)
74
+
75
+ Vlayout.addWidget(self.view)
76
+ Vlayout.addWidget(self.leareaCode)
77
+
78
+ hBoxLayout = QHBoxLayout(self)
79
+
80
+ spacerItem = QSpacerItem(241, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
81
+ hBoxLayout.addItem(spacerItem)
82
+
83
+ self.pbCancel = QPushButton("Cancel", clicked=self.reject)
84
+ hBoxLayout.addWidget(self.pbCancel)
85
+
86
+ self.btDone = QPushButton("Done", self, clicked=self.accept)
87
+ self.btDone.setVisible(True)
88
+
89
+ hBoxLayout.addWidget(self.btDone)
90
+
91
+ Vlayout.addLayout(hBoxLayout)
92
+
93
+ self.setLayout(Vlayout)
94
+
95
+ self.loadMap()
96
+
97
+ def viewMousePressEvent(self, event):
98
+ """
99
+ insert clicked areas codes
100
+ """
101
+
102
+ test = self.view.mapToScene(event.pos()).toPoint()
103
+
104
+ for code in self.polygonsList2:
105
+ if self.polygonsList2[code].contains(test):
106
+ codes = self.leareaCode.text().split(self.codeSeparator)
107
+ if "" in codes:
108
+ codes.remove("")
109
+
110
+ # check if code already in codes list
111
+ if code in codes:
112
+ codes.remove(code)
113
+ else:
114
+ codes.append(code)
115
+
116
+ self.leareaCode.setText(self.codeSeparator.join(sorted(codes)))
117
+
118
+ def getCodes(self):
119
+ return self.leareaCode.text()
120
+
121
+ def loadMap(self):
122
+ """
123
+ load bitmap from data
124
+ show it in view scene
125
+ """
126
+
127
+ self.areasList = self.codingMap
128
+
129
+ bitmapContent = binascii.a2b_base64(self.areasList["bitmap"])
130
+
131
+ pixmap = QPixmap()
132
+ pixmap.loadFromData(bitmapContent)
133
+
134
+ self.view.setSceneRect(0, 0, pixmap.size().width(), pixmap.size().height())
135
+ pixItem = QGraphicsPixmapItem(pixmap)
136
+ pixItem.setPos(0, 0)
137
+ self.view.scene().addItem(pixItem)
138
+
139
+ for area in self.areasList["areas"]:
140
+ points = self.areasList["areas"][area]["geometry"]
141
+
142
+ newPolygon = QPolygonF()
143
+ for p in points:
144
+ newPolygon.append(QPoint(p[0], p[1]))
145
+
146
+ clr = QColor()
147
+ clr.setRgba(self.areasList["areas"][area]["color"])
148
+
149
+ # draw polygon
150
+ polygon = QGraphicsPolygonItem(newPolygon)
151
+
152
+ polygon.setPen(QPen(clr, 0, Qt.NoPen, Qt.RoundCap, Qt.RoundJoin))
153
+
154
+ polygon.setBrush(QBrush(clr, Qt.SolidPattern))
155
+
156
+ self.view.scene().addItem(polygon)
157
+ self.polygonsList2[area] = polygon