ephys-link 2.0.0b9__tar.gz → 2.0.0b10__tar.gz

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.
Files changed (51) hide show
  1. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/PKG-INFO +1 -1
  2. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/ephys_link.spec +8 -3
  3. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/pyproject.toml +1 -1
  4. ephys_link-2.0.0b10/src/ephys_link/__about__.py +1 -0
  5. ephys_link-2.0.0b9/docs/assets/favicon.ico +0 -0
  6. ephys_link-2.0.0b9/docs/assets/icon.png +0 -0
  7. ephys_link-2.0.0b9/docs/development/adding_a_manipulator.md +0 -77
  8. ephys_link-2.0.0b9/docs/development/code_organization.md +0 -41
  9. ephys_link-2.0.0b9/docs/development/index.md +0 -27
  10. ephys_link-2.0.0b9/docs/development/socketio_api.md +0 -418
  11. ephys_link-2.0.0b9/docs/home/citing.md +0 -9
  12. ephys_link-2.0.0b9/docs/home/contact.md +0 -10
  13. ephys_link-2.0.0b9/docs/home/how_it_works.md +0 -76
  14. ephys_link-2.0.0b9/docs/home/installation.md +0 -40
  15. ephys_link-2.0.0b9/docs/home/supported_manipulators.md +0 -12
  16. ephys_link-2.0.0b9/docs/index.md +0 -52
  17. ephys_link-2.0.0b9/docs/stylesheets/extra.css +0 -5
  18. ephys_link-2.0.0b9/docs/stylesheets/mkdocstrings.css +0 -42
  19. ephys_link-2.0.0b9/docs/usage/experiment_automation.md +0 -10
  20. ephys_link-2.0.0b9/docs/usage/starting_ephys_link.md +0 -62
  21. ephys_link-2.0.0b9/docs/usage/using_ephys_link.md +0 -31
  22. ephys_link-2.0.0b9/src/ephys_link/__about__.py +0 -1
  23. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/.gitignore +0 -0
  24. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/LICENSE +0 -0
  25. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/README.md +0 -0
  26. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/mkdocs.yml +0 -0
  27. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/scripts/__init__.py +0 -0
  28. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/scripts/gen_ref_pages.py +0 -0
  29. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/scripts/logger_test.py +0 -0
  30. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/scripts/move_tester.py +0 -0
  31. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/scripts/server_tester.py +0 -0
  32. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/__init__.py +0 -0
  33. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/__main__.py +0 -0
  34. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/back_end/__init__.py +0 -0
  35. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/back_end/platform_handler.py +0 -0
  36. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/back_end/server.py +0 -0
  37. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/bindings/__init__.py +0 -0
  38. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/bindings/fake_binding.py +0 -0
  39. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/bindings/mpm_binding.py +0 -0
  40. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/bindings/ump_4_binding.py +0 -0
  41. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/front_end/__init__.py +0 -0
  42. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/front_end/cli.py +0 -0
  43. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/front_end/gui.py +0 -0
  44. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/resources/libum.dll +0 -0
  45. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/utils/__init__.py +0 -0
  46. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/utils/base_binding.py +0 -0
  47. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/utils/console.py +0 -0
  48. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/utils/constants.py +0 -0
  49. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/utils/converters.py +0 -0
  50. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/src/ephys_link/utils/startup.py +0 -0
  51. {ephys_link-2.0.0b9 → ephys_link-2.0.0b10}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ephys-link
3
- Version: 2.0.0b9
3
+ Version: 2.0.0b10
4
4
  Summary: A Python Socket.IO server that allows any Socket.IO-compliant application to communicate with manipulators used in electrophysiology experiments.
5
5
  Project-URL: Documentation, https://virtualbrainlab.org/ephys_link/installation_and_use.html
6
6
  Project-URL: Issues, https://github.com/VirtualBrainLab/ephys-link/issues
@@ -1,22 +1,27 @@
1
1
  # -*- mode: python ; coding: utf-8 -*-
2
2
 
3
- from ephys_link.__about__ import __version__ as version
4
-
5
3
  from argparse import ArgumentParser
6
4
 
5
+ from PyInstaller.utils.hooks import collect_submodules
6
+
7
+ from ephys_link.__about__ import __version__ as version
8
+
7
9
  parser = ArgumentParser()
8
10
  parser.add_argument("-d", "--dir", action="store_true", help="Outputs a directory")
9
11
  options = parser.parse_args()
10
12
 
11
13
  FILE_NAME = f"EphysLink-v{version}"
12
14
 
15
+ # Collect binding modules.
16
+ bindings = [binding for binding in collect_submodules("ephys_link.bindings") if binding != "ephys_link.bindings"]
17
+
13
18
  # noinspection PyUnresolvedReferences
14
19
  a = Analysis(
15
20
  ['src\\ephys_link\\__main__.py'],
16
21
  pathex=[],
17
22
  binaries=[('src\\ephys_link\\resources', 'ephys_link\\resources')],
18
23
  datas=[],
19
- hiddenimports=['engineio.async_drivers.aiohttp'],
24
+ hiddenimports=['engineio.async_drivers.aiohttp'] + bindings,
20
25
  hookspath=[],
21
26
  hooksconfig={},
22
27
  runtime_hooks=[],
@@ -56,7 +56,7 @@ el = "ephys_link.__main__:main"
56
56
  path = "src/ephys_link/__about__.py"
57
57
 
58
58
  [tool.hatch.build.targets.sdist]
59
- exclude = ["/.github", "/.idea"]
59
+ exclude = ["/.github", "/.idea", "/docs"]
60
60
 
61
61
  [tool.hatch.envs.default]
62
62
  python = "3.13.1"
@@ -0,0 +1 @@
1
+ __version__ = "2.0.0b10"
Binary file
Binary file
@@ -1,77 +0,0 @@
1
- # Adding a Manipulator
2
-
3
- By the end of this section, you will be able to add a manipulator platform to Ephys Link and control it using the server
4
- API. This is a software development guide and assumes you have experience with Python. It is encouraged to
5
- read [how the system works first](../home/how_it_works.md) before proceeding.
6
-
7
- ## Set Up for Development
8
-
9
- 1. Fork the [Ephys Link repository](https://github.com/VirtualBrainLab/ephys-link).
10
- 2. Follow the instructions for [installing Ephys Link for development](index.md#installing-for-development) to get all
11
- the necessary dependencies and tools set up. In this case, you'll want to clone your fork.
12
- 3. (Optional) Familiarize yourself with the [repo's organization](code_organization.md).
13
-
14
- ## Create a Manipulator Binding
15
-
16
- Manipulators are added to Ephys Link through bindings. A binding is a Python class that extends the abstract base class
17
- [`BaseBinding`][ephys_link.utils.base_binding] and defines the methods Ephys Link expects from a platform.
18
-
19
- Create a new Python module in `src/ephys_link/bindings` for your manipulator. Make a class that extends
20
- [`BaseBinding`][ephys_link.utils.base_binding]. Most IDEs will automatically import the necessary classes and tell you
21
- the methods you need to implement. See the reference for [`BaseBinding`][ephys_link.utils.base_binding] for detailed
22
- descriptions of the expected behavior.
23
-
24
- As described in the [system overview](../home/how_it_works.md), Ephys Link converts all manipulator movement into a
25
- common "unified space" which is
26
- the [left-hand cartesian coordinate system](https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/geometry/coordinate-systems.html).
27
- The two methods [
28
- `platform_space_to_unified_space`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.platform_space_to_unified_space)
29
- and [
30
- `unified_space_to_platform_space`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.unified_space_to_platform_space)
31
- are used to convert between your manipulator's coordinate system and the unified space.
32
-
33
- !!! tip
34
-
35
- See
36
- the [Sensapex uMp-4](https://github.com/VirtualBrainLab/ephys-link/blob/main/src/ephys_link/bindings/ump_4_bindings.py)
37
- binding for an example where the platform has a Python API (Sensapex's SDK) and
38
- the [New Scale Pathfinder MPM](https://github.com/VirtualBrainLab/ephys-link/blob/main/src/ephys_link/bindings/mpm_bindings.py)
39
- binding, for example, where the platform uses a REST API for an external provider.
40
-
41
- ### Binding Names
42
-
43
- The two naming methods [
44
- `get_display_name`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.get_display_name)
45
- and [
46
- `get_cli_name`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.get_cli_name)
47
- are used to identify the binding in the user interface. As described by their documentation, `get_display_name` should
48
- return a human-readable name for the binding, while `get_cli_name` should return the name used to launch the binding
49
- from the command line (what is passed to the `-t` flag). For example, Sensapex uMp-4 manipulator's `get_cli_name`
50
- returns `ump-4` because the CLI launch command is `ephys_link.exe -b -t ump-4`.
51
-
52
- ### Custom Additional Arguments
53
-
54
- Sometimes you may want to pass extra data to your binding on initialization. For example, New Scale Pathfinder MPM
55
- bindings need to know what the HTTP server port is. To add custom arguments, define them as arguments on the `__init__`
56
- method of your binding then pass in the appropriate data when the binding is instantiated in the [
57
- `_get_binding_instance`](https://github.com/VirtualBrainLab/ephys-link/blob/f79c1ec68ec1805e1a4e231e1934127893f7bd20/src/ephys_link/back_end/platform_handler.py#L58)
58
- method of the [`PlatformHandler`][ephys_link.back_end.platform_handler].
59
- Use [New Scale Pathfinder MPM's binding][ephys_link.bindings.mpm_binding] as an example of how to do this.
60
-
61
- ## Test Your Binding
62
-
63
- Once you've implemented your binding, you can test it by running Ephys Link using your binding
64
- `ephys_link -b -t <cli_name>`. You can interact with it using the [Socket.IO API](socketio_api.md) or Pinpoint.
65
-
66
- ## Code standards
67
-
68
- We use automatic static analyzers to check code quality. See
69
- the [corresponding section in the code organization documentation](code_organization.md#static-analysis) for more
70
- information.
71
-
72
- ## Submit Your Changes
73
-
74
- When satisfied with your changes, submit a pull request to the main repository. We will review your changes and
75
- merge them if they meet our standards!
76
-
77
- Feel free to [reach out](../home/contact.md) to us if you have any questions or need help with your binding!
@@ -1,41 +0,0 @@
1
- # Code Organization
2
-
3
- This section gives an overview of Ephys Link's internal architecture. It is intended for
4
- maintainers of Ephys Link.
5
-
6
- ## File Structure
7
-
8
- Ephys Link starts from the `__main__.py` file. It imports each component of the application and calls the launch
9
- sequence.
10
-
11
- ### Where to find things
12
-
13
- - `back_end`: the Socket.IO server and the manipulator API.
14
- - `front_end`: configuration GUI and CLI definition.
15
- - `bindings`: manipulator binding implementations.
16
- - `utils`: common utilities and helper functions (including
17
- [the base binding abstract base class][ephys_link.utils.base_binding]).
18
-
19
- ## Control Flow
20
-
21
- As described in ["How It Works"](../home/how_it_works.md), Ephys Link is primarily a server that responds to events. The
22
- server exposes the events and passes them to the chosen manipulator binding. Everything is asynchronous and uses callbacks
23
- to return responses to the clients when ready.
24
-
25
- [`PlatformHandler`][ephys_link.back_end.platform_handler] is responsible for converting between the server API and the
26
- manipulator binding API. Because of this module, you don't have to worry about the details of the server API when
27
- writing a manipulator binding.
28
-
29
- ## Static Analysis
30
-
31
- The project is strictly type-checked using [`hatch fmt` (ruff)](https://hatch.pypa.io/1.9/config/static-analysis/)
32
- and [basedpyright](https://docs.basedpyright.com/latest/). All PRs are checked against these tools.
33
-
34
- While they are invaluable in enforcing good code, they can be annoying when working with libraries that inherently
35
- return `Any` (like HTTP requests) or are not strictly statically typed. In those situations, we have added inline
36
- comments to ignore specific checks. We try to only use this in scenarios where missing typing information comes from
37
- external sources, and it is not possible to make local type hints. Do not use file-wide ignores under any circumstances.
38
- We also do not make stubs since they would be challenging to maintain.
39
-
40
- We encourage using the type checker as a tool to help strengthen your code and only apply inline comments to ignore
41
- specific instances where external libraries cause errors.
@@ -1,27 +0,0 @@
1
- # Developing with Ephys Link
2
-
3
- Ephys Link is free and open-source software. All of our code is available
4
- on [GitHub](https://github.com/VirtualBrainLab/ephys-link), and we welcome contributions from the community!
5
-
6
- This section describes:
7
-
8
- - [The Socket.IO server's API](socketio_api.md) and how to communicate with Ephys Link from a client application
9
- - How to [add a new manipulator](adding_a_manipulator.md) to Ephys Link
10
- - General [code organization](code_organization.md) for Ephys Link
11
- - Auto-generated [source code reference](../reference/SUMMARY.md) intended for developers who are maintaining Ephys Link
12
-
13
- ## Installing for Development
14
-
15
- 1. Clone the repository.
16
- 2. Install [Hatch](https://hatch.pypa.io/latest/install/)
17
- 3. In a terminal, navigate to the repository's root directory and run
18
-
19
- ```bash
20
- hatch shell
21
- ```
22
-
23
- This will create a virtual environment, install Python 13 (if not found), and install the package in editable mode.
24
-
25
- If you encounter any dependency issues (particularly with `aiohttp`), try installing the latest Microsoft Visual C++
26
- (MSVC v143+ x86/64) and the Windows SDK (10/11)
27
- via [Visual Studio Build Tools Installer](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
@@ -1,418 +0,0 @@
1
- # Socket.IO API
2
-
3
- This section documents the [Socket.IO](https://socket.io/) API. The document is intended for developers building client
4
- applications communicating with the server. If you are looking for information on how to set up and run the server, see
5
- the [installation guide](../home/installation.md)!
6
-
7
- ## Data Types
8
-
9
- All messages on Socket.IO are passed as strings. Complex data structures are JSON encoded, converted to strings, and
10
- then sent. These structures have their JSON schemas documented
11
- on [VBL Aquarium](https://github.com/VirtualBrainLab/vbl-aquarium/tree/main/models/schemas/ephys_link).
12
-
13
- This documentation will reference the Pydantic versions of these models as they are extensively documented. For most
14
- functions, their functions and responses are documented by these models. Follow the links to the VBL Aquarium
15
- documentation for a model to learn more. These models have a `.to_json_string()` method that will convert the model
16
- object to a string that can be sent over Socket.IO.
17
-
18
- ## Events
19
-
20
- Client applications should send messages to these events to interact with the server. The server will respond using
21
- [Socket.IO acknowledgments](https://socket.io/docs/v4/#acknowledgements).
22
-
23
- ### Get Ephys Link Version
24
-
25
- | Event | Input | Response |
26
- |---------------|-------|----------|
27
- | `get_version` | None | `string` |
28
-
29
- [Semantically Versioned](https://semver.org/) number.
30
-
31
- __Examples:__
32
-
33
- Input: None
34
-
35
- Response:
36
-
37
- - `"2.0.0"`
38
- - `"2.0.0b2`
39
-
40
- ### Get Pinpoint ID
41
-
42
- | Event | Input | Response |
43
- |-------------------|-------|----------|
44
- | `get_pinpoint_id` | None | `string` |
45
-
46
- Proxy connection ID (first 8 characters of a UUID v4).
47
-
48
- __Example:__
49
-
50
- Input: None
51
-
52
- Response: `"81f8de08"`
53
-
54
- ### Get Platform Info
55
-
56
- | Event | Input | Return |
57
- |---------------------|-------|---------------------------------------------------------------|
58
- | `get_platform_info` | None | [`PlatformInfo`][vbl_aquarium.models.ephys_link.PlatformInfo] |
59
-
60
- __Example:__
61
-
62
- Input: N/A
63
-
64
- Response:
65
-
66
- ```json
67
- {
68
- "Name": "Sensapex uMp-4",
69
- "CliName": "ump-4",
70
- "AxesCount": 4,
71
- "Dimensions": {
72
- "x": 20.0,
73
- "y": 20.0,
74
- "z": 20.0,
75
- "w": 20.0
76
- }
77
- }
78
- ```
79
-
80
- ### List Available Manipulators
81
-
82
- | Event | Input | Return |
83
- |--------------------|-------|------------------------------------------------------------------------------------|
84
- | `get_manipulators` | None | [`GetManipulatorResponse`][vbl_aquarium.models.ephys_link.GetManipulatorsResponse] |
85
-
86
- __Examples:__
87
-
88
- Input: N/A
89
-
90
- Response:
91
-
92
- - Normal:
93
-
94
- ```json
95
- {
96
- "Manipulators": [
97
- "1",
98
- "2",
99
- "3"
100
- ],
101
- "Error": ""
102
- }
103
- ```
104
-
105
- - Error:
106
-
107
- ```json
108
- {
109
- "Manipulators": [],
110
- "Error": "No manipulators found"
111
- }
112
- ```
113
-
114
- ### Get Manipulator Position
115
-
116
- | Event | Input | Return |
117
- |----------------|---------------------------|---------------------------------------------------------------------------|
118
- | `get_position` | Manipulator ID (`string`) | [`PositionalResponse`][vbl_aquarium.models.ephys_link.PositionalResponse] |
119
-
120
- __Examples:__
121
-
122
- Input:
123
-
124
- - `"1"`
125
- - `"A"`
126
-
127
- Response:
128
-
129
- - Normal:
130
-
131
- ```json
132
- {
133
- "Position": {
134
- "x": 12.45,
135
- "y": 7.89,
136
- "z": 0.81,
137
- "w": 8.12
138
- },
139
- "Error": ""
140
- }
141
- ```
142
-
143
- - Error:
144
-
145
- ```json
146
- {
147
- "Position": {
148
- "x": 0.0,
149
- "y": 0.0,
150
- "z": 0.0,
151
- "w": 0.0
152
- },
153
- "Error": "Unable to Read Manipulator Position"
154
- }
155
- ```
156
-
157
- ### Get Manipulator Angles
158
-
159
- | Event | Input | Return |
160
- |--------------|---------------------------|---------------------------------------------------------------------|
161
- | `get_angles` | Manipulator ID (`string`) | [`AngularResponse`][vbl_aquarium.models.ephys_link.AngularResponse] |
162
-
163
- __Examples:__
164
-
165
- Input:
166
-
167
- - `"1"`
168
- - `"A"`
169
-
170
- Response:
171
-
172
- - Normal:
173
-
174
- ```json
175
- {
176
- "Angles": {
177
- "x": 45.0,
178
- "y": 0.0,
179
- "z": 90.0
180
- },
181
- "Error": ""
182
- }
183
- ```
184
-
185
- - Error:
186
-
187
- ```json
188
- {
189
- "Angles": {
190
- "x": 0.0,
191
- "y": 0.0,
192
- "z": 0.0
193
- },
194
- "Error": "Unable to Read Manipulator Angles"
195
- }
196
-
197
- ```
198
-
199
- ### Get Probe Shank Count
200
-
201
- | Event | Input | Return |
202
- |-------------------|---------------------------|---------------------------------------------------------------------------|
203
- | `get_shank_count` | Manipulator ID (`string`) | [`ShankCountResponse`][vbl_aquarium.models.ephys_link.ShankCountResponse] |
204
-
205
- __Examples:__
206
-
207
- Input:
208
-
209
- - `"1"`
210
- - `"A"`
211
-
212
- Response:
213
-
214
- - Normal:
215
-
216
- ```json
217
- {
218
- "ShankCount": 3,
219
- "Error": ""
220
- }
221
- ```
222
-
223
- - Error:
224
-
225
- ```json
226
- {
227
- "ShankCount": 1,
228
- "Error": "Unable to Read Probe Shank Count"
229
- }
230
- ```
231
-
232
- ### Set Manipulator Position
233
-
234
- | Event | Input | Return |
235
- |----------------|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
236
- | `set_position` | [`SetPositionRequest`][vbl_aquarium.models.ephys_link.SetPositionRequest] | [`PositionalResponse`][vbl_aquarium.models.ephys_link.PositionalResponse] |
237
-
238
- __Examples:__
239
-
240
- Input:
241
-
242
- ```json
243
- {
244
- "ManipulatorId": "1",
245
- "Position": {
246
- "x": 1.5,
247
- "y": 2.0,
248
- "z": 0.0,
249
- "w": 0.84
250
- },
251
- "Speed": 0.05
252
- }
253
- ```
254
-
255
- Response:
256
-
257
- - Normal:
258
-
259
- ```json
260
- {
261
- "Position": {
262
- "x": 1.5,
263
- "y": 2.0,
264
- "z": 0.0,
265
- "w": 0.84
266
- },
267
- "Error": ""
268
- }
269
- ```
270
-
271
- - Manipulator is set to be inside the brain (position setting is disallowed):
272
-
273
- ```json
274
- {
275
- "Position": {
276
- "x": 0.0,
277
- "y": 0.0,
278
- "z": 0.0,
279
- "w": 0.0
280
- },
281
- "Error": "Can not move manipulator while inside the brain. Set the depth (\"set_depth\") instead."
282
- }
283
- ```
284
-
285
- - The manipulator did not make it to the final destination. This is not necessarily unintentional. This response is
286
- produced
287
- if a movement is stopped.
288
-
289
- ```json
290
- {
291
- "Position": {
292
- "x": 0.0,
293
- "y": 0.0,
294
- "z": 0.0,
295
- "w": 0.0
296
- },
297
- "Error": "Manipulator 1 did not reach target position on axis x. Requests: 1.5, got: 0.82."
298
- }
299
- ```
300
-
301
- ### Set Manipulator Depth
302
-
303
- | Event | Input | Return |
304
- |-------------|---------------------------------------------------------------------|-----------------------------------------------------------------------|
305
- | `set_depth` | [`SetDepthRequest`][vbl_aquarium.models.ephys_link.SetDepthRequest] | [`SetDepthResponse`][vbl_aquarium.models.ephys_link.SetDepthResponse] |
306
-
307
- __Examples:__
308
-
309
- Input:
310
-
311
- ```json
312
- {
313
- "ManipulatorId": "1",
314
- "Depth": 1.7,
315
- "Speed": 0.005
316
- }
317
- ```
318
-
319
- Response:
320
-
321
- - Normal:
322
-
323
- ```json
324
- {
325
- "Depth": 1.7,
326
- "Error": ""
327
- }
328
- ```
329
-
330
- - The manipulator did not make it to the final destination. This is not necessarily unintentional. This response is
331
- produced
332
- if a drive is stopped.
333
-
334
- ```json
335
- {
336
- "Depth": 0,
337
- "Error": "Manipulator 1 did not reach target depth. Requested: 1.7, got: 0.6."
338
- }
339
- ```
340
-
341
- ### Set Manipulator to be Inside the Brain
342
-
343
- | Event | Input | Return |
344
- |--------------------|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
345
- | `set_inside_brain` | [`SetInsideBrainRequest`][vbl_aquarium.models.ephys_link.SetInsideBrainRequest] | [`BooleanStateResponse`][vbl_aquarium.models.ephys_link.BooleanStateResponse] |
346
-
347
- __Examples:__
348
-
349
- Input:
350
-
351
- ```json
352
- {
353
- "ManipulatorId": "1",
354
- "Inside": true
355
- }
356
- ```
357
-
358
- Response:
359
-
360
- - Normal:
361
-
362
- ```json
363
- {
364
- "State": true,
365
- "Error": ""
366
- }
367
- ```
368
-
369
- - Error
370
-
371
- ```json
372
- {
373
- "State": false,
374
- "Error": "Unable to complete operation."
375
- }
376
- ```
377
-
378
- ### Stop a Manipulator's movement
379
-
380
- | Event | Input | Return |
381
- |--------|---------------------------|--------------------------|
382
- | `stop` | Manipulator ID (`string`) | Error Message (`string`) |
383
-
384
- __Examples:__
385
-
386
- Input:
387
-
388
- - "1"
389
- - "A"
390
-
391
- Response:
392
-
393
- - Normal: `""`
394
- - Error: `"Unable to stop manipulator."`
395
-
396
- ### Stop All Manipulators
397
-
398
- | Event | Input | Return |
399
- |------------|-------|--------------------------|
400
- | `stop_all` | None | Error Message (`string`) |
401
-
402
- __Examples:__
403
-
404
- Input: None
405
-
406
- Response:
407
-
408
- - Normal: `""`
409
- - Error: `"Unable to stop manipulator."`
410
-
411
- ### Unknown Event (Error)
412
-
413
- Response: `{"error", "Unknown event."}`
414
-
415
- ## Notes
416
-
417
- - In the examples, the error response messages are generic examples. The actual error strings you see will be driven by
418
- what exceptions are raised by the binding.
@@ -1,9 +0,0 @@
1
- # Citing
2
-
3
- If this project is used as part of a research project you should cite
4
- the [Pinpoint repository](https://github.com/VirtualBrainLab/Pinpoint). Please email
5
- Dan ([dbirman@uw.edu](mailto:dbirman@uw.edu)) if you have questions.
6
-
7
- Please reach out to Kenneth ([kjy5@uw.edu](mailto:kjy5@uw.edu)) for questions
8
- about the Electrophysiology Manipulator Link server. Bugs may be reported
9
- through the issues tab.
@@ -1,10 +0,0 @@
1
- # Contact
2
-
3
- Kenneth J. Yang is the primary developer and maintainer of Ephys Link. You can each him by his email: [kjy5@uw.edu](mailto:kjy5@uw.edu).
4
-
5
- Daniel Birman is the co-developer of Ephys Link. His information on the VBL [about page](https://virtualbrainlab.org/about/overview.html).
6
-
7
- As an open-source project, we welcome [bug reports](https://github.com/VirtualBrainLab/ephys-link/issues)
8
- and [discussions](https://github.com/VirtualBrainLab/ephys-link/discussions) on
9
- our [GitHub page](https://github.com/VirtualBrainLab/ephys-link)!
10
-
@@ -1,76 +0,0 @@
1
- # How It Works
2
-
3
- This section provides an overview of how Ephys Link works. It is intended for users who want to understand the
4
- software's architecture and how it interacts with other systems.
5
-
6
- ## Why Ephys Link?
7
-
8
- There exist many manipulator platforms in neuroscience research, each with its unique API and software. This diversity
9
- makes it difficult for tool developers to support multiple platforms. Ephys Link aims to solve this problem by providing
10
- a unified API for interacting with manipulators. This allows developers to write code that works with any manipulator
11
- supported by Ephys Link.
12
-
13
- ## Ephys Link Architecture
14
-
15
- ```mermaid
16
- flowchart LR
17
- n1["Client Application"]
18
- n3["Manipulator 1"]
19
- n4["Manipulator 2"]
20
- subgraph s1["Ephys Link"]
21
- n6["Rectangle"]
22
- n2["Server"]
23
- end
24
- n6["Bindings"] ---|" Manipulator 1 API "| n3
25
- n1 ---|" Send Request "| n2
26
- n2 ---|" Callback Response "| n1
27
- n6 ---|" Manipulator 2 API "| n4
28
- n3 --- n6
29
- n4 --- n6
30
- n2 ---|" Parse Request "| n6
31
- n6 ---|" Send Response "| n2
32
- ```
33
-
34
- This diagram shows the high-level architecture of Ephys Link. Ephys Link acts as an intermediary between a client
35
- applications and manipulators.
36
-
37
- Within Ephys Link, there is a server component that handles external communication and there are the bindings for each
38
- proprietary manipulator platform API. The server passes requests from client applications to the appropriate manipulator
39
- bindings which convert the requests to the appropriate manipulator API calls.
40
-
41
- ## Example Message Flow
42
-
43
- Consider the following example of a request to move a manipulator to a specific position:
44
-
45
- ```mermaid
46
- sequenceDiagram
47
- participant C as Client Application
48
- box Ephys Link
49
- participant S as Server
50
- participant B as Bindings
51
- end
52
- participant M as Manipulator Platform
53
- C ->> S: Move manipulator to position (x, y, z)
54
- S ->> B: set_position(x, y, z)
55
- B ->> M: move(a, b, c, d)
56
- loop Update Position
57
- C -->> S: Get the current position
58
- S -->> B: get_position()
59
- B -->> M: position()
60
- M -->> B: Now at (a, b, c, d)
61
- B -->> S: Now at (x, y, z)
62
- S -->> C: Now at (x, y, z)
63
- end
64
- M ->> B: Completed move, at (a, b, c, d)
65
- B ->> S: Completed move, at (x, y, z)
66
- S ->> C: Completed move, at (x, y, z)
67
- ```
68
-
69
- Some things to notice:
70
-
71
- - The client application only ever speaks in (x, y, z) coordinates, never in the native manipulator platform's
72
- coordinate system. The binding handles the conversion.
73
- - While one command is being fulfilled, the client application can still query the manipulator's current position.
74
- Later, the manipulator can report when it is done and complete the movement request.
75
- - The manipulator often has a different API than Ephys Link (`move` vs `set_position`), but the binding handles the
76
- translation.
@@ -1,40 +0,0 @@
1
- # Installation
2
-
3
- ## Prerequisites
4
-
5
- 1. An **x86 Windows PC is required** to run the server.
6
- 2. For Sensapex devices, the controller unit must be connected via an ethernet
7
- cable and powered. A USB-to-ethernet adapter is acceptable. For New Scale manipulators,
8
- the controller unit must be connected via USB and be powered by a 6V power
9
- supply.
10
- 3. To use the emergency stop feature, ensure a keyboard is attached.
11
-
12
- ## Pinpoint (Recommended Method)
13
-
14
- Pinpoint comes bundled with the correct version of Ephys Link. If you are using Pinpoint on the same computer your
15
- manipulators are connected to, you can launch the server from within Pinpoint. See the documentation
16
- on [connecting from Pinpoint](../usage/using_ephys_link.md#connecting-to-pinpoint).
17
-
18
- ## Install as a Standalone Executable
19
-
20
- Download the latest standalone executable or zip from the [releases page](https://github.com/VirtualBrainLab/ephys-link/releases/latest).
21
-
22
- Then see the [usage documentation](../usage/starting_ephys_link.md) for how to run the server.
23
-
24
- ## Install as a Python package
25
-
26
- ```bash
27
- pip install ephys-link
28
- ```
29
-
30
- or with [pipx](https://pipx.pypa.io/stable/) (recommended)
31
-
32
- ```bash
33
- pipx install ephys-link
34
- ```
35
-
36
- Then see the [usage documentation](../usage/starting_ephys_link.md) for how to run the server.
37
-
38
- ## Install for Development
39
-
40
- See [development documentation](../development/index.md#installing-for-development) for more information.
@@ -1,12 +0,0 @@
1
- # Supported Manipulators
2
-
3
- This is a current list of planned and supported manipulators in Ephys Link. If you use a manipulator that is not listed
4
- here, we suggest reaching out to your manipulator's manufacturer to request support for Ephys Link. Direct them to
5
- contact [Kenneth Yang and Daniel Birman](https://virtualbrainlab.org/about/overview.html)!
6
-
7
- | Manufacturer | Model |
8
- |--------------|---------------------------------------------------------|
9
- | Sensapex | <ul> <li>uMp-4</li> <li>uMp-3 (Coming Soon!)</li> </ul> |
10
- | New Scale | <ul> <li>Pathfinder MPM Control v2.8+</li> </ul> |
11
- | Scientifica | <ul> <li>InVivoStar (Coming Soon!)</li> </ul> |
12
- | LabMaker | <ul> <li>(Coming Soon!)</li> </ul> |
@@ -1,52 +0,0 @@
1
- # Electrophysiology Manipulator Link
2
-
3
- [![PyPI version](https://badge.fury.io/py/ephys-link.svg)](https://badge.fury.io/py/ephys-link)
4
- [![Deploy Documentation](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/deploy-docs.yml)
5
- [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
6
- [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
7
- [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
8
- [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
9
-
10
- The [Electrophysiology Manipulator Link](https://github.com/VirtualBrainLab/ephys-link)
11
- (or Ephys Link for short) is a Python [Socket.IO](https://socket.io/docs/v4/#what-socketio-is) server that allows any
12
- Socket.IO-compliant application (such
13
- as [Pinpoint](https://github.com/VirtualBrainLab/Pinpoint))
14
- to communicate with manipulators used in electrophysiology experiments.
15
-
16
- <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">
17
-
18
- <div class="grid cards" markdown>
19
-
20
- - __:fontawesome-solid-download: Get Started__
21
-
22
- ---
23
-
24
- Install Ephys Link and get started in seconds.
25
-
26
-
27
- [:octicons-arrow-right-24: Install](home/installation.md)
28
-
29
- - __:fontawesome-solid-computer: Usage__
30
-
31
- ---
32
-
33
- Learn how to use Ephys Link to control your manipulators.
34
-
35
- [:octicons-arrow-right-24: Usage](usage/starting_ephys_link.md)
36
-
37
- - __:fontawesome-regular-square-plus: Add a Manipulator Platform__
38
-
39
- ---
40
-
41
- Add a new manipulator platform to Ephys Link to enable control.
42
-
43
- [:octicons-arrow-right-24: Develop](development/adding_a_manipulator.md)
44
-
45
- - __:fontawesome-solid-book-open: Learn About Pinpoint__
46
-
47
- ---
48
-
49
- Pinpoint is an experiment planning and automation tool that uses Ephys Link.
50
-
51
- [:octicons-arrow-right-24: Learn More](https://virtualbrainlab.org/pinpoint/installation_and_use.html)
52
- </div>
@@ -1,5 +0,0 @@
1
- :root {
2
- --md-primary-fg-color: #0FBBBB;
3
- --md-primary-fg-color--light: #0FBBBB;
4
- --md-primary-fg-color--dark: #0FBBBB;
5
- }
@@ -1,42 +0,0 @@
1
- /* Fancier color for operators such as * and |. */
2
- .doc-signature .o {
3
- color: var(--md-code-hl-special-color);
4
- }
5
-
6
- /* Fancier color for constants such as None, True, and False. */
7
- .doc-signature .kc {
8
- color: var(--md-code-hl-constant-color);
9
- }
10
-
11
- /* Fancier color for built-in types (only useful when cross-references are used). */
12
- .doc-signature .n > a[href^="https://docs.python.org/"][href*="/functions.html#"],
13
- .doc-signature .n > a[href^="https://docs.python.org/"][href*="/stdtypes.html#"] {
14
- color: var(--md-code-hl-constant-color);
15
- }
16
- /* Indentation. */
17
- div.doc-contents:not(.first) {
18
- padding-left: 25px;
19
- border-left: .05rem solid var(--md-typeset-table-color);
20
- }
21
-
22
- /* Mark external links as such. */
23
- a.external::after,
24
- a.autorefs-external::after {
25
- /* https://primer.style/octicons/arrow-up-right-24 */
26
- mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
27
- -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
28
- content: ' ';
29
-
30
- display: inline-block;
31
- vertical-align: middle;
32
- position: relative;
33
-
34
- height: 1em;
35
- width: 1em;
36
- background-color: currentColor;
37
- }
38
-
39
- a.external:hover::after,
40
- a.autorefs-external:hover::after {
41
- background-color: var(--md-accent-fg-color);
42
- }
@@ -1,10 +0,0 @@
1
- # Experiment Automation
2
-
3
- Pinpoint and Ephys Link can work together to automate manual procedures in electrophysiology experiments. Follow the
4
- [instructions on Pinpoint's documentation](https://virtualbrainlab.org//pinpoint/tutorials/tutorial_ephys_copilot.html)
5
- to use automation in your next experiment!
6
-
7
- !!! note
8
-
9
- Automation is still in early development. We recommend [contacting](https://virtualbrainlab.org/about/overview.html)
10
- Dan Birman and Kenneth Yang if you would like to try it out!
@@ -1,62 +0,0 @@
1
- # Starting Ephys Link
2
-
3
- Ephys Link is a server that runs in the background.
4
-
5
- !!! info
6
-
7
- Most people should use Ephys Link through Pinpoint. See documentation
8
- on [connecting from Pinpoint](using_ephys_link.md#connecting-to-pinpoint) and using Ephys Link
9
- for [experiment automation](using_ephys_link.md#experiment-automation).
10
-
11
- If you are building a client application that will talk to Ephys Link, see
12
- the [Socket.IO API reference](../development/socketio_api.md).
13
-
14
- There are different ways of launching Ephys Link depending on its installation.
15
-
16
- ## Standalone Executable (GUI)
17
-
18
- 1. Double-click the executable file to launch the configuration window.
19
- 1. Take note of the IP address and port. **Copy this information into Pinpoint to connect**.
20
- 2. Select the desired configuration and click "Launch Server".
21
-
22
- The configuration window will close and the server will launch. Your configurations will be saved for future use.
23
-
24
- To connect to the server from Pinpoint, provide the IP address and port. For example, if the server is running on the
25
- same computer that Pinpoint is, use
26
-
27
- - Server: `localhost`
28
- - Port: `3000`
29
-
30
- If the server is running on a different (local) computer, use the IP address of that computer as shown in the startup
31
- window instead of `localhost`.
32
-
33
- ## Standalone Executable (CLI)
34
-
35
- Ephys Link can be launched from the command line directly without the
36
- configuration window. This is useful for computers
37
- or servers without graphical user interfaces.
38
-
39
- With the standalone executable downloaded, invoking the executable from the
40
- command line:
41
-
42
- ```bash
43
- EphysLink-vX.X.X.exe -b
44
- ```
45
-
46
- Use the actual name of the executable you downloaded. The `-b` or `--background` flag will launch the server without the
47
- configuration window and read configuration from CLI arguments.
48
-
49
- Here are some examples of how to start Ephys Link with a specific platform (replace `EphysLink.exe` with the actual name
50
- of the executable you downloaded):
51
-
52
- | Manipulator Platform | Command |
53
- |----------------------------------------|--------------------------------------|
54
- | Sensapex uMp-4 (default) | `EphysLink.exe -b` |
55
- | New Scale Pathfinder MPM Control v2.8+ | `EphysLink.exe -b -t pathfinder-mpm` |
56
-
57
- More options can be viewed by running `EphysLink.exe -h`.
58
-
59
- ## Python Package
60
-
61
- Ephys Link can be invoked from the command line with the same arguments as the standalone executable using the
62
- `ephys-link` binary (or `el` for short).
@@ -1,31 +0,0 @@
1
- # Using Ephys Link
2
-
3
- Ephys Link is designed to interact with other software. Any [Socket.IO](https://socket.io/) client application can talk
4
- to Ephys Link and access connected manipulators. [Pinpoint](https://github.com/VirtualBrainLab/Pinpoint) is a first-party application that does just that!
5
-
6
- !!! info "Stop All Movement"
7
-
8
- As you start using Ephys Link with other software you may want to stop all manipulators in case of an emergency.
9
- <br/><br/>
10
- Press the keyboard shortcut <kbd>ctrl</kbd> + <kbd>shift</kbd> + <kbd>alt</kbd> + <kbd>q</kbd> to "quit" all
11
- movement.
12
-
13
- ## Connecting to Pinpoint
14
-
15
- [Pinpoint](https://github.com/VirtualBrainLab/Pinpoint) is a tool for planning electrophysiology recordings and other
16
- _in vivo_ insertions, as well as tracking the position of probes in real-time inside the brain.
17
-
18
- Ephys Link was developed alongside Pinpoint to facilitate tracking and positioning of manipulators. Follow the
19
- [instructions on Pinpoint's documentation](https://virtualbrainlab.org//pinpoint/tutorials/tutorial_ephys_link.html) to
20
- use Ephys Link inside Pinpoint!
21
-
22
- ## Experiment Automation
23
-
24
- Pinpoint and Ephys Link can work together to automate manual procedures in electrophysiology experiments. Follow the
25
- [instructions on Pinpoint's documentation](https://virtualbrainlab.org//pinpoint/tutorials/tutorial_ephys_copilot.html)
26
- to use automation in your next experiment!
27
-
28
- !!! note
29
-
30
- Automation is still in early development. We recommend [contacting](https://virtualbrainlab.org/about/overview.html)
31
- Dan Birman and Kenneth Yang if you would like to try it out!
@@ -1 +0,0 @@
1
- __version__ = "2.0.0b9"
File without changes
File without changes
File without changes
File without changes