ephys-link 2.0.0b5__py3-none-any.whl → 2.0.0b9__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.
- ephys_link/__about__.py +1 -1
- ephys_link/__main__.py +51 -43
- ephys_link/back_end/platform_handler.py +315 -305
- ephys_link/back_end/server.py +274 -202
- ephys_link/bindings/{fake_bindings.py → fake_binding.py} +84 -59
- ephys_link/bindings/{mpm_bindings.py → mpm_binding.py} +315 -278
- ephys_link/bindings/{ump_4_bindings.py → ump_4_binding.py} +157 -131
- ephys_link/front_end/cli.py +104 -98
- ephys_link/front_end/gui.py +204 -215
- ephys_link/{util/base_bindings.py → utils/base_binding.py} +176 -148
- ephys_link/{util → utils}/console.py +127 -130
- ephys_link/utils/constants.py +23 -0
- ephys_link/utils/converters.py +86 -0
- ephys_link/utils/startup.py +65 -0
- ephys_link-2.0.0b9.dist-info/METADATA +91 -0
- ephys_link-2.0.0b9.dist-info/RECORD +25 -0
- {ephys_link-2.0.0b5.dist-info → ephys_link-2.0.0b9.dist-info}/WHEEL +1 -1
- {ephys_link-2.0.0b5.dist-info → ephys_link-2.0.0b9.dist-info}/licenses/LICENSE +674 -674
- ephys_link/resources/CP210xManufacturing.dll +0 -0
- ephys_link/resources/NstMotorCtrl.dll +0 -0
- ephys_link/resources/SiUSBXp.dll +0 -0
- ephys_link/util/common.py +0 -120
- ephys_link-2.0.0b5.dist-info/METADATA +0 -166
- ephys_link-2.0.0b5.dist-info/RECORD +0 -26
- /ephys_link/{util → utils}/__init__.py +0 -0
- {ephys_link-2.0.0b5.dist-info → ephys_link-2.0.0b9.dist-info}/entry_points.txt +0 -0
|
Binary file
|
|
Binary file
|
ephys_link/resources/SiUSBXp.dll
DELETED
|
Binary file
|
ephys_link/util/common.py
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# ruff: noqa: T201
|
|
2
|
-
"""Commonly used utility functions and constants."""
|
|
3
|
-
|
|
4
|
-
from os.path import join
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
from packaging.version import parse
|
|
8
|
-
from requests import get
|
|
9
|
-
from vbl_aquarium.models.unity import Vector4
|
|
10
|
-
|
|
11
|
-
from ephys_link.__about__ import __version__
|
|
12
|
-
|
|
13
|
-
# Ephys Link ASCII.
|
|
14
|
-
ASCII = r"""
|
|
15
|
-
______ _ _ _ _
|
|
16
|
-
| ____| | | | | (_) | |
|
|
17
|
-
| |__ _ __ | |__ _ _ ___ | | _ _ __ | | __
|
|
18
|
-
| __| | '_ \| '_ \| | | / __| | | | | '_ \| |/ /
|
|
19
|
-
| |____| |_) | | | | |_| \__ \ | |____| | | | | <
|
|
20
|
-
|______| .__/|_| |_|\__, |___/ |______|_|_| |_|_|\_\
|
|
21
|
-
| | __/ |
|
|
22
|
-
|_| |___/
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
# Absolute path to the resource folder.
|
|
26
|
-
RESOURCES_PATH = join(str(Path(__file__).parent.parent.absolute()), "resources")
|
|
27
|
-
|
|
28
|
-
# Ephys Link Port
|
|
29
|
-
PORT = 3000
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# Server startup.
|
|
33
|
-
def server_preamble() -> None:
|
|
34
|
-
"""Print the server startup preamble."""
|
|
35
|
-
print(ASCII)
|
|
36
|
-
print(__version__)
|
|
37
|
-
print()
|
|
38
|
-
print("This is the Ephys Link server window.")
|
|
39
|
-
print("You may safely leave it running in the background.")
|
|
40
|
-
print("To stop it, close this window or press CTRL + Pause/Break.")
|
|
41
|
-
print()
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def check_for_updates() -> None:
|
|
45
|
-
"""Check for updates to the Ephys Link."""
|
|
46
|
-
response = get("https://api.github.com/repos/VirtualBrainLab/ephys-link/tags", timeout=10)
|
|
47
|
-
latest_version = response.json()[0]["name"]
|
|
48
|
-
if parse(latest_version) > parse(__version__):
|
|
49
|
-
print(f"Update available: {latest_version} !")
|
|
50
|
-
print("Download at: https://github.com/VirtualBrainLab/ephys-link/releases/latest")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# Unit conversions
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def scalar_mm_to_um(mm: float) -> float:
|
|
57
|
-
"""Convert scalar values of millimeters to micrometers.
|
|
58
|
-
|
|
59
|
-
:param mm: Scalar value in millimeters.
|
|
60
|
-
:type mm: float
|
|
61
|
-
:returns: Scalar value in micrometers.
|
|
62
|
-
:rtype: float
|
|
63
|
-
"""
|
|
64
|
-
return mm * 1_000
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def vector_mm_to_um(mm: Vector4) -> Vector4:
|
|
68
|
-
"""Convert vector values of millimeters to micrometers.
|
|
69
|
-
|
|
70
|
-
:param mm: Vector in millimeters.
|
|
71
|
-
:type mm: Vector4
|
|
72
|
-
:returns: Vector in micrometers.
|
|
73
|
-
:rtype: Vector4
|
|
74
|
-
"""
|
|
75
|
-
return mm * 1_000
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def um_to_mm(um: Vector4) -> Vector4:
|
|
79
|
-
"""Convert micrometers to millimeters.
|
|
80
|
-
|
|
81
|
-
:param um: Length in micrometers.
|
|
82
|
-
:type um: Vector4
|
|
83
|
-
:returns: Length in millimeters.
|
|
84
|
-
:rtype: Vector4
|
|
85
|
-
"""
|
|
86
|
-
return um / 1_000
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def vector4_to_array(vector4: Vector4) -> list[float]:
|
|
90
|
-
"""Convert a Vector4 to a list of floats.
|
|
91
|
-
|
|
92
|
-
:param vector4: Vector4 to convert.
|
|
93
|
-
:type vector4: :class:`vbl_aquarium.models.unity.Vector4`
|
|
94
|
-
:return: List of floats.
|
|
95
|
-
:rtype: list[float]
|
|
96
|
-
"""
|
|
97
|
-
return [vector4.x, vector4.y, vector4.z, vector4.w]
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def array_to_vector4(array: list[float]) -> Vector4:
|
|
101
|
-
"""Convert a list of floats to a Vector4.
|
|
102
|
-
|
|
103
|
-
:param array: List of floats.
|
|
104
|
-
:type array: list[float]
|
|
105
|
-
:return: First four elements of the list as a Vector4 padded with zeros if necessary.
|
|
106
|
-
:rtype: :class:`vbl_aquarium.models.unity.Vector4`
|
|
107
|
-
"""
|
|
108
|
-
|
|
109
|
-
def get_element(this_array: list[float], index: int) -> float:
|
|
110
|
-
try:
|
|
111
|
-
return this_array[index]
|
|
112
|
-
except IndexError:
|
|
113
|
-
return 0.0
|
|
114
|
-
|
|
115
|
-
return Vector4(
|
|
116
|
-
x=get_element(array, 0),
|
|
117
|
-
y=get_element(array, 1),
|
|
118
|
-
z=get_element(array, 2),
|
|
119
|
-
w=get_element(array, 3),
|
|
120
|
-
)
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: ephys-link
|
|
3
|
-
Version: 2.0.0b5
|
|
4
|
-
Summary: A Python Socket.IO server that allows any Socket.IO-compliant application to communicate with manipulators used in electrophysiology experiments.
|
|
5
|
-
Project-URL: Documentation, https://virtualbrainlab.org/ephys_link/installation_and_use.html
|
|
6
|
-
Project-URL: Issues, https://github.com/VirtualBrainLab/ephys-link/issues
|
|
7
|
-
Project-URL: Source, https://github.com/VirtualBrainLab/ephys-link
|
|
8
|
-
Author-email: Kenneth Yang <kjy5@uw.edu>
|
|
9
|
-
Maintainer-email: Kenneth Yang <kjy5@uw.edu>
|
|
10
|
-
License-Expression: GPL-3.0-only
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Keywords: electrophysiology,ephys,manipulator,neuroscience,neurotech,new-scale,sensapex,socket-io,virtualbrainlab
|
|
13
|
-
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
-
Classifier: Intended Audience :: Healthcare Industry
|
|
15
|
-
Classifier: Intended Audience :: Science/Research
|
|
16
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
17
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
-
Classifier: Programming Language :: Python
|
|
19
|
-
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
26
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
27
|
-
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
28
|
-
Requires-Python: <3.13,>=3.10
|
|
29
|
-
Requires-Dist: aiohttp==3.9.5
|
|
30
|
-
Requires-Dist: colorama==0.4.6
|
|
31
|
-
Requires-Dist: platformdirs==4.2.2
|
|
32
|
-
Requires-Dist: pyserial==3.5
|
|
33
|
-
Requires-Dist: python-socketio[asyncio-client]==5.11.3
|
|
34
|
-
Requires-Dist: pythonnet==3.0.3
|
|
35
|
-
Requires-Dist: requests==2.32.3
|
|
36
|
-
Requires-Dist: rich==13.7.1
|
|
37
|
-
Requires-Dist: sensapex==1.400.1
|
|
38
|
-
Requires-Dist: vbl-aquarium==0.0.22
|
|
39
|
-
Description-Content-Type: text/markdown
|
|
40
|
-
|
|
41
|
-
# Electrophysiology Manipulator Link
|
|
42
|
-
|
|
43
|
-
[](https://badge.fury.io/py/ephys-link)
|
|
44
|
-
[](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/codeql-analysis.yml)
|
|
45
|
-
[](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/dependency-review.yml)
|
|
46
|
-
[](https://github.com/pypa/hatch)
|
|
47
|
-
[](https://github.com/astral-sh/ruff)
|
|
48
|
-
|
|
49
|
-
<!-- [](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/build.yml) -->
|
|
50
|
-
|
|
51
|
-
<img width="100%" src="https://github.com/VirtualBrainLab/ephys-link/assets/82800265/0c7c60b1-0926-4697-a461-221554f82de1" alt="Manipulator and probe in pinpoint moving in sync">
|
|
52
|
-
|
|
53
|
-
The [Electrophysiology Manipulator Link](https://github.com/VirtualBrainLab/ephys-link)
|
|
54
|
-
(or Ephys Link for short) is a Python [Socket.IO](https://socket.io/docs/v4/#what-socketio-is) server that allows any
|
|
55
|
-
Socket.IO-compliant application (such
|
|
56
|
-
as [Pinpoint](https://github.com/VirtualBrainLab/Pinpoint))
|
|
57
|
-
to communicate with manipulators used in electrophysiology experiments.
|
|
58
|
-
|
|
59
|
-
**Supported Manipulators:**
|
|
60
|
-
|
|
61
|
-
| Manufacturer | Model |
|
|
62
|
-
|--------------|-------------------------------------------------------------------------|
|
|
63
|
-
| Sensapex | <ul> <li>uMp-4</li> <li>uMp-3</li> </ul> |
|
|
64
|
-
| New Scale | <ul> <li>Pathfinder MPM Control v2.8+</li> <li>M3-USB-3:1-EP</li> </ul> |
|
|
65
|
-
|
|
66
|
-
Ephys Link is an open and extensible platform. It is designed to easily support integration with other manipulators.
|
|
67
|
-
|
|
68
|
-
For more information regarding the server's implementation and how the code is organized, see
|
|
69
|
-
the [package's development documentation](https://virtualbrainlab.org/ephys_link/development.html).
|
|
70
|
-
|
|
71
|
-
For detailed descriptions of the server's API, see
|
|
72
|
-
the [API reference](https://virtualbrainlab.org/api_reference_ephys_link.html).
|
|
73
|
-
|
|
74
|
-
# Installation
|
|
75
|
-
|
|
76
|
-
## Prerequisites
|
|
77
|
-
|
|
78
|
-
1. An **x86 Windows PC is required** to run the server.
|
|
79
|
-
2. For Sensapex devices, the controller unit must be connected via an ethernet
|
|
80
|
-
cable and powered. A USB-to-ethernet adapter is acceptable. For New Scale manipulators,
|
|
81
|
-
the controller unit must be connected via USB and be powered by a 6V power
|
|
82
|
-
supply.
|
|
83
|
-
3. To use the emergency stop feature, ensure an Arduino with
|
|
84
|
-
the [StopSignal](https://github.com/VirtualBrainLab/StopSignal) sketch is
|
|
85
|
-
connected to the computer. Follow the instructions on that repo for how to
|
|
86
|
-
set up the Arduino.
|
|
87
|
-
|
|
88
|
-
**NOTE:** Ephys Link is an HTTP server without cross-origin support. The server
|
|
89
|
-
is currently designed to interface with local/desktop instances of Pinpoint. It
|
|
90
|
-
will not work with the web browser versions of Pinpoint at this time.
|
|
91
|
-
|
|
92
|
-
## Launch from Pinpoint (Recommended)
|
|
93
|
-
|
|
94
|
-
Pinpoint comes bundled with the correct version of Ephys Link. If you are using Pinpoint on the same computer your
|
|
95
|
-
manipulators are connected to, you can launch the server from within Pinpoint. Follow the instructions in
|
|
96
|
-
the [Pinpoint documentation](https://virtualbrainlab.org/pinpoint/tutorials/tutorial_ephys_link.html#configure-and-launch-ephys-link).
|
|
97
|
-
|
|
98
|
-
## Install as Standalone Executable
|
|
99
|
-
|
|
100
|
-
1. Download the latest executable from
|
|
101
|
-
the [releases page](https://github.com/VirtualBrainLab/ephys-link/releases/latest).
|
|
102
|
-
2. Double-click the executable file to launch the configuration window.
|
|
103
|
-
1. Take note of the IP address and port. **Copy this information into Pinpoint to connect**.
|
|
104
|
-
3. Select the desired configuration and click "Launch Server".
|
|
105
|
-
|
|
106
|
-
The configuration window will close and the server will launch. Your configurations will be saved for future use.
|
|
107
|
-
|
|
108
|
-
To connect to the server from Pinpoint, provide the IP address and port. For example, if the server is running on the
|
|
109
|
-
same computer that Pinpoint is, use
|
|
110
|
-
|
|
111
|
-
- Server: `localhost`
|
|
112
|
-
- Port: `8081`
|
|
113
|
-
|
|
114
|
-
If the server is running on a different (local) computer, use the IP address of that computer as shown in the startup
|
|
115
|
-
window instead of `localhost`.
|
|
116
|
-
|
|
117
|
-
## Install as a Python package
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
pip install ephys-link
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Import main and run (this will launch the setup GUI).
|
|
124
|
-
|
|
125
|
-
```python
|
|
126
|
-
from ephys_link.__main__ import main
|
|
127
|
-
|
|
128
|
-
main()
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Install for Development
|
|
132
|
-
|
|
133
|
-
1. Clone the repository.
|
|
134
|
-
2. Install [Hatch](https://hatch.pypa.io/latest/install/)
|
|
135
|
-
3. In a terminal, navigate to the repository's root directory and run
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
hatch shell
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
This will create a virtual environment, install Python 12 (if not found), and install the package in editable mode.
|
|
142
|
-
|
|
143
|
-
If you encounter any dependency issues (particularly with `aiohttp`), try installing the latest Microsoft Visual C++
|
|
144
|
-
(MSVC v143+ x86/64) and the Windows SDK (10/11)
|
|
145
|
-
via [Visual Studio Build Tools Installer](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
|
|
146
|
-
|
|
147
|
-
# Documentation and More Information
|
|
148
|
-
|
|
149
|
-
Complete documentation including API usage and development installation can be
|
|
150
|
-
found on the [Virtual Brain Lab Documentation page][docs] for Ephys Link.
|
|
151
|
-
|
|
152
|
-
# Citing
|
|
153
|
-
|
|
154
|
-
If this project is used as part of a research project you should cite
|
|
155
|
-
the [Pinpoint repository][Pinpoint]. Please email
|
|
156
|
-
Dan ([dbirman@uw.edu](mailto:dbirman@uw.edu)) if you have questions.
|
|
157
|
-
|
|
158
|
-
Please reach out to Kenneth ([kjy5@uw.edu](mailto:kjy5@uw.edu)) for questions
|
|
159
|
-
about the Electrophysiology Manipulator Link server. Bugs may be reported
|
|
160
|
-
through the issues tab.
|
|
161
|
-
|
|
162
|
-
[Pinpoint]: https://github.com/VirtualBrainLab/Pinpoint
|
|
163
|
-
|
|
164
|
-
[StopSignal]: https://github.com/VirtualBrainLab/StopSignal
|
|
165
|
-
|
|
166
|
-
[docs]: https://virtualbrainlab.org/ephys_link/installation_and_use.html
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
ephys_link/__about__.py,sha256=W8_pwZswCUyYGNDMBbTV2lPT7qpoSD2adR4yUwvZfkU,25
|
|
2
|
-
ephys_link/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
ephys_link/__main__.py,sha256=KSwJO4gPQAZitNSNChD1NjkO2j3pc8RA2dkRbiaq32w,1368
|
|
4
|
-
ephys_link/back_end/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
ephys_link/back_end/platform_handler.py,sha256=cAHZ3gqA-Y33vb0sfsH085BPVtIfSUGaFVqvTzpA2MA,13168
|
|
6
|
-
ephys_link/back_end/server.py,sha256=QZu8deE57BxULfUutPQ41q3HTmr94nPyzaIT-JoOK2I,8026
|
|
7
|
-
ephys_link/bindings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
ephys_link/bindings/fake_bindings.py,sha256=Dk9Bpv4XTYa6ooh5Ge_5-o3IRzdazj5pYMcp3O41UJI,1936
|
|
9
|
-
ephys_link/bindings/mpm_bindings.py,sha256=e4whLU7mJm-Mbw6O2ua6fPHBZNnCiyyGiePEVBr3zzY,9818
|
|
10
|
-
ephys_link/bindings/ump_4_bindings.py,sha256=rmkniiH5KyWjyXGpmUW3RCR_rar40b3vxHwYakrwbqg,4494
|
|
11
|
-
ephys_link/front_end/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
ephys_link/front_end/cli.py,sha256=KJBSWqdz4T5z0Zor1tJSHTJKZeMcHAJf5gXXu38wQPU,3105
|
|
13
|
-
ephys_link/front_end/gui.py,sha256=_gE6zFhFnzHPSyYd9MBvfK5xmDZHsUXcETDHzH66QzU,7518
|
|
14
|
-
ephys_link/resources/CP210xManufacturing.dll,sha256=aM9k_XABjkq0TOMiIw8HeteB40zqEkUDNO8wo91EdYI,810232
|
|
15
|
-
ephys_link/resources/NstMotorCtrl.dll,sha256=Xtpr3vBcxhcsOUGvgVEwYtGPvKEqDctIUGCK36GfU2Q,155136
|
|
16
|
-
ephys_link/resources/SiUSBXp.dll,sha256=187zlclZNNezCkU1o1CbICRAmKWJxbh8ahP6L6wo-_Y,469752
|
|
17
|
-
ephys_link/resources/libum.dll,sha256=YaD4dwiSNohx-XxHjx2eQWPOBEVvUIXARvx37e_yqNw,316316
|
|
18
|
-
ephys_link/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
ephys_link/util/base_bindings.py,sha256=ukomZftpwa8s_SV-jcwPSXmox0neXf8-uyie_NmiRro,5349
|
|
20
|
-
ephys_link/util/common.py,sha256=Pk7uVqEMFMPKNpeucWda_GfnHogRszej5G5qYkt43d8,3455
|
|
21
|
-
ephys_link/util/console.py,sha256=NvUH-Fp4nzkgrqQOcylctf46x4AW-qAphrtisepk1xY,4325
|
|
22
|
-
ephys_link-2.0.0b5.dist-info/METADATA,sha256=PvHqwUICg5mNPrvMvmGjpwcDQqQEtDzDacv4AuIsj88,7943
|
|
23
|
-
ephys_link-2.0.0b5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
24
|
-
ephys_link-2.0.0b5.dist-info/entry_points.txt,sha256=o8wV3AdnJ9o47vg9ymKxPNVq9pMdPq8UZHE_iyAJx-k,124
|
|
25
|
-
ephys_link-2.0.0b5.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
|
26
|
-
ephys_link-2.0.0b5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|